Error converting onnx to tensorrt on xavier

xavier version :jetson xavier nx developer kit
p-number: p3668-0000
soc :tegra194
cuda arch bin: 7.2
L4T:35.3.1 jetpack: 5.1.1
Libraries
CUDA: 11.4.315
tensorrt: 8.5.2.2
cuDNN: 8.6.0.166 TensorRT:8.5.2.2
OpenCV: 4.5.4 with CUDA:YES
The command executed is :
./trtexec --onnx=bestv5-400.onnx --saveEngine=bestv5-400.engine

&&&& RUNNING TensorRT.trtexec [TensorRT v8502] # ./trtexec --onnx=bestv5-400.onnx --saveEngine=bestv5-400.engine
[04/28/2023-16:53:48] [I] === Model Options ===
[04/28/2023-16:53:48] [I] Format: ONNX
[04/28/2023-16:53:48] [I] Model: bestv5-400.onnx

[04/28/2023-17:00:52] [W] [TRT] Skipping tactic 9 due to insufficient memory on requested size of 2190 detected for tactic 0x000000000000003c.
Try decreasing the workspace size with IBuilderConfig::setMemoryPoolLimit().
[04/28/2023-17:00:59] [W] [TRT] Tactic Device request: 4245MB Available: 1974MB. Device memory is insufficient to use tactic.
[04/28/2023-17:00:59] [W] [TRT] Skipping tactic 3 due to insufficient memory on requested size of 4245 detected for tactic 0x0000000000000004.
Try decreasing the workspace size with IBuilderConfig::setMemoryPoolLimit().
[04/28/2023-17:00:59] [W] [TRT] Tactic Device request: 4245MB Available: 1974MB. Device memory is insufficient to use tactic.
[04/28/2023-17:00:59] [W] [TRT] Skipping tactic 8 due to insufficient memory on requested size of 4245 detected for tactic 0x000000000000003c.
Try decreasing the workspace size with IBuilderConfig::setMemoryPoolLimit().
[04/28/2023-17:05:46] [I] [TRT] [GraphReduction] The approximate region cut reduction algorithm is called.
[04/28/2023-17:05:46] [I] [TRT] Total Activation Memory: 7856001024
[04/28/2023-17:05:46] [I] [TRT] Detected 1 inputs and 4 output network tensors.
[04/28/2023-17:05:47] [I] [TRT] Total Host Persistent Memory: 181776
[04/28/2023-17:05:47] [I] [TRT] Total Device Persistent Memory: 1861120
[04/28/2023-17:05:47] [I] [TRT] Total Scratch Memory: 134217728
[04/28/2023-17:05:47] [I] [TRT] [MemUsageStats] Peak memory usage of TRT CPU/GPU memory allocators: CPU 37 MiB, GPU 2112 MiB
[04/28/2023-17:05:47] [I] [TRT] [BlockAssignment] Started assigning block shifts. This will take 245 steps to complete.
[04/28/2023-17:05:47] [I] [TRT] [BlockAssignment] Algorithm ShiftNTopDown took 100.998ms to assign 6 blocks to 245 nodes requiring 181731328 bytes.
[04/28/2023-17:05:47] [I] [TRT] Total Activation Memory: 181731328
[04/28/2023-17:05:47] [I] [TRT] [MemUsageChange] Init cuDNN: CPU +0, GPU +0, now: CPU 1142, GPU 5054 (MiB)
[04/28/2023-17:05:47] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in building engine: CPU +13, GPU +257, now: CPU 13, GPU 257 (MiB)
[04/28/2023-17:05:49] [E] Saving engine to file failed.
[04/28/2023-17:05:49] [E] Engine set up failed
&&&& FAILED TensorRT.trtexec [TensorRT v8502] # ./trtexec --onnx=bestv5-400.onnx --saveEngine=bestv5-400.engine

Hi,

[04/28/2023-17:05:49] [E] Saving engine to file failed.

It looks like the file cannot save in the folder.
Could you try to save the engine file somewhere that you have written permission?

Thanks.

1 Like