Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) Jetson Xavier AGX
• DeepStream Version 6.3.0
• JetPack Version (valid for Jetson only) 5.1
• TensorRT Version 8.5.2.2
My model.engine file is always being built, no matter if I set model-engine-file at the config. it says:
WARNING: Deserialize engine failed because file path: /home/ubuntu/EdgeServer/model_b4_gpu0_fp32.engine open error
0:00:02.515789206 58324 0xffff280022c0 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-gpu-inference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1976> [UID = 1]: deserialize engine from file :/home/ubuntu/EdgeServer/model_b4_gpu0_fp32.engine failed
0:00:02.564015541 58324 0xffff280022c0 WARN nvinfer gstnvinfer.cpp:679:gst_nvinfer_logger:<primary-gpu-inference-engine> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2081> [UID = 1]: deserialize backend context from engine from file :/home/ubuntu/EdgeServer/model_b4_gpu0_fp32.engine failed, try rebuild
0:00:02.564395400 58324 0xffff280022c0 INFO nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-gpu-inference-engine> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2002> [UID = 1]: Trying to create engine from model files
Building the TensorRT Engine
I saw some posts, and at first, the problem should be that the .engine path is not being correctly set, or something related to permissions. But my path and permissions seems ok. This is my environment:
Deepstream is at /opt/nvidia/deepstream/deepstream-6.3
Script runs at /home/ubuntu/EdgeServer/
The config file is at /home/ubuntu/EdgeServer/config
The model engine is being created at /home/ubuntu/EdgeServer/model_b4_gpu0_fp32.engine
In my config file I have:
#This definition overides onnx-file definition
model-engine-file=/home/ubuntu/EdgeServer/model_b4_gpu0_fp32.engine
#Yolo v5
onnx-file=/home/ubuntu/EdgeServer/model/yolov5s.onnx
labelfile-path=/home/ubuntu/EdgeServer/model/labels_yolov5s.txt
num-detected-classes=80
Note that the warning says failed because file path: /home/ubuntu/EdgeServer/model_b4_gpu0_fp32.engine open error. So tries to read the engine at the same location it was created, which took me to permissions …
DS is being able to write at /home/ubuntu/EdgeServer/, otherwise the model wouldn’t be created. In fact:
ubuntu@ubuntu:~$ ls -l
drwxrwxr-x 11 ubuntu ubuntu 4096 Apr 24 13:23 EdgeServer
and
ubuntu@ubuntu:~/EdgeServer$ ls -l
-rw-rw-r-- 1 ubuntu ubuntu 34078941 Apr 24 13:23 model_b4_gpu0_fp32.engine
I have also tried a brute force approach and did ubuntu@ubuntu:~$ sudo chmod -R 777 ~/EdgeServer but the rebuild always occurs. I am missing something here, any suggestions?