# TensorRT process killed with Orin Nano

**URL:** <https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652>\
**Category:** Jetson Orin Nano\
**Tags:** tensorrt\
**Created:** [July 12, 2023, 11:27pm UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652 "2023-07-12T23:27:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MDS\_Eddy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/mds_eddy/32/446782_2.png) [@MDS\_Eddy](https://forums.developer.nvidia.com/u/MDS_Eddy)\
**Post date:** [July 12, 2023, 11:27pm UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/1 "2023-07-12T23:27:48Z")

</div>

Hello,

We are trying to convert model to TensorRT.  
But it is failed with the error as below :

 ![image](https://global.discourse-cdn.com/nvidia/original/4X/e/b/6/eb67277515bf8fd61ae0436b536bfbc6e0fd8048.jpeg)

We set like this  
=\> torch2trt option : dla=True, max\_workspace\_size=1GB  
But it looks it doesn’t apply.

The conversion process is killed but we can get the output.  
This output works and inferencing time is half than before conversion.

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 13, 2023, 2:55am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/3 "2023-07-13T02:55:02Z")

</div>

Hi,

Which tool do you use for the conversion?  
Is it _trtexec_ or other tools?

Thanks.

---

<div class="post-metadata">

**Author:** ![doosikdonet](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@doosikdonet](https://forums.developer.nvidia.com/u/doosikdonet)\
**Post date:** [July 13, 2023, 8:31am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/4 "2023-07-13T08:31:20Z")

</div>

hello.  
that’s error raise when convert Pytorch model to TensorRT using torch2trt ([GitHub - NVIDIA-AI-IOT/torch2trt: An easy to use PyTorch to TensorRT converter](https://github.com/NVIDIA-AI-IOT/torch2trt)) in python code

do i understand question correctly?

more environment info is …  
device : jetson orin nano 4GB  
test pytorch model : densenet121.  
jetpack ver : 5.1.1

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 17, 2023, 6:25am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/5 "2023-07-17T06:25:27Z")

</div>

Hi,

It looks like you try to convert the model into a DLA engine.  
But Orin Nano doesn’t have the DLA hardware.

Please set `dla=False` and try it again.  
Thanks.

---

<div class="post-metadata">

**Author:** ![doosikdonet](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@doosikdonet](https://forums.developer.nvidia.com/u/doosikdonet)\
**Post date:** [July 18, 2023, 4:44am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/6 "2023-07-18T04:44:43Z")

</div>

there is no error message about dla after change above option dla=False. thanks.  
but still process killed again and i think the reason of this problem is out of memory.

when i test on jetson nano 4GB, ( cli mode, available RAM size 3.2 GB ) operation work well.  
but jetson orin nano 4GB, (cli mode, available RAM size 2.2GB) process killed.

 ![image](https://global.discourse-cdn.com/nvidia/original/4X/0/7/e/07ee688f82caee6048a1261a58cdc73c3f38ea4f.png)

Can i solve this problem using torch2trt option? ( max\_workspace\_size, etc…)  
test pytorch model is densenet121.

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 19, 2023, 4:07am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/7 "2023-07-19T04:07:14Z")

</div>

Hi,

Yes, you can try a smaller batch and workspace value.

Could you also try to add some swap memory?  
This will help if the compiling takes some host memory.

> [@Trt\_convert converter.convert() gets killed without errors](https://forums.developer.nvidia.com/t/trt-convert-converter-convert-gets-killed-without-errors/148113/7):
>
> Hi, Would you mind to create some swap space to see if help? You will need an extra space for the swap file. Ex. sudo fallocate -l 8G [/media/mySSD/swapfile] sudo chmod 600 [/media/mySSD/swapfile] sudo mkswap [/media/mySSD/swapfile] sudo /bin/sh -c 'echo "[/media/mySSD/swapfile] \t none \t swap \t defaults \t 0 \t 0" \>\> /etc/fstab' sudo swapon -a Thanks.

Thanks.

---

<div class="post-metadata">

**Author:** ![doosikdonet](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@doosikdonet](https://forums.developer.nvidia.com/u/doosikdonet)\
**Post date:** [July 19, 2023, 7:25am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/8 "2023-07-19T07:25:03Z")

</div>

thank you.  
I tried the two methods you recommend, but swap memory didn’t solve this problem, probably for the reasons below.

> [@Swap memory is not being used by the code](https://forums.developer.nvidia.com/t/swap-memory-is-not-being-used-by-the-code/178516):
>
> NVIDIA product - Jetson Nano 2gb operating system - Linux Issue - I have my yolov4 tiny code for object tracking running on Jetson Nano 2gb, but the issue is of lower frame rate on Jetson Nano 2gb, I have already created extra swap memory of 5.9GB on Jetson. Still while running the codes it is not using the Swap memory created and thus it is giving me lower frame rate in outputs. I would like to have a solution on how to increase the FPS while detection and how do I make the code utilize the …

but change the batch is worked. (change 8 to 4.) thanks.  
but problem of change batch size is do inference 2 times.  
it takes time spent 1.4 times more at inference.  
i want keep my batch size for optimize my system

my question is,  
Can you recommend another method for get more free RAM space?  
(Stop certain services or other methods, etc. current available RAM size is 2.2GB in idle state, w/o GUI )  
maybe 200MB space seems to be enough for pytorch model to TensorRT conversion and inference with keep my batchsize.

thank you for your support.

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 21, 2023, 6:50am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/9 "2023-07-21T06:50:52Z")

</div>

Hi,

Loading cuDNN memory can take up to 600M or more.  
There is a function called `setTacticSources` in TensorRT allows the user to deploy without calling cuDNN.

The function seems not been exported in torch2trt.  
Is it possible to use TensorRT API directly?  
This will require you to convert the model into ONNX format first.

Thanks.

---

<div class="post-metadata">

**Author:** ![doosikdonet](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@doosikdonet](https://forums.developer.nvidia.com/u/doosikdonet)\
**Post date:** [July 27, 2023, 6:50am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/10 "2023-07-27T06:50:21Z")

</div>

Hi,

Following your advice, I solved it in the following way.

1. pytoch model to onnx (torch.onnx.export())  
i found the way use setTacticSource in torch2trt function (i’m not sure and I don’t know if it actually applied)  
(use builder and config, in [https://github.com/NVIDIA-AI-IOT/torch2trt/blob/master/torch2trt/torch2trt.py#L654](https://github.com/NVIDIA-AI-IOT/torch2trt/blob/master/torch2trt/torch2trt.py#L654))

2. onnx to tensorrt engine (trtexec) / trtexec option : --tacticSources=-CUDNN.  
(include CUDNN tactic raised warning that memory not enough)

So i can use my batchsize and increase available RAM space almost 1GB !

thanks for your support.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [August 16, 2023, 7:17am UTC](https://forums.developer.nvidia.com/t/tensorrt-process-killed-with-orin-nano/259652/13 "2023-08-16T07:17:24Z")

</div>

Closed on August 16, 2023, 7:17am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
