Failure in running Deepstream SSD sample on AGX

I am a newbie using Deepstream and tried to run the SSD sample on AGX. Followed the Readme.text in the folder objectDetector_SSD, but failed at the last step. Could anyone help give any advice where the problem is? Thanks!

#copy the config file from tensorrt directory
cp /usr/src/tensorrt/samples/sampleUffSSD/config.py .

Generate SSD UFF model

python3 /usr/local/lib/python3.6/dist-packages/uff/bin/convert_to_uff.py --input-file /home/nvidia/ssd_inception_v2_coco_2017_11_17/frozen_inference_graph.pb -O NMS -p config.py

#Copy the UFF to /objectDetector_SSD
cp /home/nvidia/ssd_inception_v2_coco_2017_11_17/frozen_inference_graph.uff /home/nvidia/Downloads/deepstream_sdk_on_jetson/sources/objectDetector_SSD/sample_ssd_relu6.uff

#copy the label text
cp /usr/src/tensorrt/data/ssd/ssd_coco_labels.txt /home/nvidia/Downloads/deepstream_sdk_on_jetson/sources/objectDetector_SSD/ssd_coco_labels.txt

#Run the model—Failure
deepstream-app -c deepstream_app_config_ssd.txt

The error message after the last command:

Using winsys: x11

Warning. Could not open model engine file /home/nvidia/Downloads/deepstream_sdk_on_jetson/sources/objectDetector_SSD/sample_ssd_relu6.uff_b1_fp32.engine
Generating new TRT model engine
generateTRTModel network_mode 0 creating builder
generateTRTModel network_mode 0 creating network
generateTRTModel network_mode 0 created network
Using FP32 data type.
UFFParser: Graph error: Cycle graph detected
Error while parsing UFF file: incorrect file or incorrect input/output blob names
Error while building network
** ERROR: main:613: Failed to set pipeline to PAUSED
Quitting
ERROR from primary_gie_classifier: Failed to initialize infer context
Debug info: /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvinfer/gstnvinfer.c(2170): gst_nv_infer_start (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie_classifier
App run failed

I found the config_ssd is looking for the engine named as “sample_ssd_relu6.uff_b1_fp32.engine”, but the uff file we saved is sample_ssd_relu6.uff. Is it the problem?

Even I change the UFF name to sample_ssd_relu6.uff_b1_fp32.engine, another error appears:

Using winsys: x11

Using TRT model serialized engine /home/nvidia/Downloads/deepstream_sdk_on_jetson/sources/objectDetector_SSD/sample_ssd_relu6.uff_b1_fp32.engine crypto flags(0)
deepstream-app: engine.cpp:868: bool nvinfer1::rt::Engine::deserialize(const void*, std::size_t, nvinfer1::IGpuAllocator&, nvinfer1::IPluginFactory*): Assertion `size >= bsize && “Mismatch between allocated memory size and expected size of serialized engine.”’ failed.
Aborted (core dumped)

Hi,

The engine error is a harmless warning, indicating that it will generate a TensorRT PLAN since no available one can be reused.

The real error you meet is ‘Failed to initialize infer context’.
This issue is commonly caused by incompatible CUDA driver and libraries.

Could you share which JetPack version do you use?
Please noticed that the DeepStream 3.0 only supports JetPack4.1.1.
https://developer.nvidia.com/embedded/deepstream-on-jetson-downloads

Other JetPack version may not work correctly.

Thanks.

Hi AastaLLL,

Thanks for your kind respond. I used JetPack 4.1.1 to flash and install software on AGX. It seems the following software versions meet the requirements of Deepstrem 3.0.

CUDA version:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sun_Aug_12_21:08:25_CDT_2018
Cuda compilation tools, release 10.0, V10.0.117

CUDNN version:

#define CUDNN_MAJOR 7
#define CUDNN_MINOR 3
#define CUDNN_PATCHLEVEL 1

#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

TensorRT version:

ii libnvinfer-dev 5.0.3-1+cuda10.0 arm64 TensorRT development libraries and headers
ii libnvinfer-samples 5.0.3-1+cuda10.0 all TensorRT samples and documentation
ii libnvinfer5 5.0.3-1+cuda10.0 arm64
TensorRT runtime libraries

OpenCV version:

ii libopencv 3.3.1 arm64 Open Computer Vision Library
ii libopencv-calib3d3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Camera Calibration library
ii libopencv-contrib3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision contrlib library
ii libopencv-core3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision core library
ii libopencv-dev 3.3.1 arm64 Development files for Open Source Computer Vision Library
ii libopencv-features2d3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Feature Detection and Descriptor Extraction library
ii libopencv-flann3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Clustering and Search in Multi-Dimensional spaces library
ii libopencv-highgui3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision High-level GUI and Media I/O library
ii libopencv-imgcodecs3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Image Codecs library
ii libopencv-imgproc3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Image Processing library
ii libopencv-ml3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Machine Learning library
ii libopencv-objdetect3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Object Detection library
ii libopencv-photo3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision computational photography library
ii libopencv-samples 3.3.1 arm64 Samples for Open Source Computer Vision Library
ii libopencv-shape3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision shape descriptors and matchers library
ii libopencv-stitching3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision image stitching library
ii libopencv-superres3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Super Resolution library
ii libopencv-video3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Video analysis library
ii libopencv-videoio3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision Video I/O library
ii libopencv-videostab3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision video stabilization library
ii libopencv-viz3.2:arm64 3.2.0+dfsg-4ubuntu0.1 arm64 computer vision 3D data visualization library

VisionWorks version: 1.6

Hi,

Thanks for your feedback.
It looks like your environment is good.

Could you try to clear the cache and relaunch the pipeline to see if helps?

$ rm ${HOME}/.cache/gstreamer-1.0/registry.aarch64.bin
$ deepstream-app -c deepstream_app_config_ssd.txt

If you still meet the same error, would you mind to share the sample_ssd_relu6.uff file with us.
(Our .uff file works correctly so guess that there are something different between us.)

We will try to reproduce this issue on our environment.

Thanks.