Failling in building sample from TLT-DEEPSTREAM

• Hardware Platform (Jetson / GPU): Jetson AGX XAVIER
• DeepStream Version: 5.0
• JetPack Version (valid for Jetson only)
• TensorRT Version:7.1.0
• NVIDIA GPU Driver Version (valid for GPU only)
Jetpack version: # R32 (release), REVISION: 4.2, GCID: 20074772, BOARD: t186ref, EABI: aarch64, DATE: Thu Apr 9 01:26:40 UTC 2020

I was running the sample in this git with the command:
./deepstream-custom -c pgie_frcnn_tlt_config.txt -i $DS_SRC_PATH/samples/streams/sample_720p.h264

I got the error like this:
(deepstream-custom:11692): GStreamer-WARNING **: 16:22:54.001: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_infer.so': libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory One element could not be created. Exiting.
How can I solve that? I checked the folder /usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/and libnvinfer_plugin.so.7is not there. Even if I sudo cp ...manually to the directory, it stil shows No such file or directory.

Thanks.

pgie_frcnn_tlt_config.txt (2.6 KB)

Move to TLT forum.

Could you please paste the result of below?

$ ldd /usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_infer.so

And also please run below command and paste the result.

$ ll -sh /usr/lib/aarch64-linux-gnu/libnvinfer_plugin*

Result of running $ ldd /usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_infer.so

linux-vdso.so.1 (0x0000007f868d6000)
	libgtk3-nocsd.so.0 => /usr/lib/aarch64-linux-gnu/libgtk3-nocsd.so.0 (0x0000007f867d4000)
	libnvds_infer.so => /opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_infer.so (0x0000007f8643f000)
	libglib-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0 (0x0000007f86331000)
	libgobject-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgobject-2.0.so.0 (0x0000007f862d3000)
	libgstreamer-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libgstreamer-1.0.so.0 (0x0000007f861a3000)
	libgstbase-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libgstbase-1.0.so.0 (0x0000007f8612c000)
	libnvbufsurface.so.1.0.0 => /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurface.so.1.0.0 (0x0000007f860af000)
	libnvbufsurftransform.so.1.0.0 => /usr/lib/aarch64-linux-gnu/tegra/libnvbufsurftransform.so.1.0.0 (0x0000007f85662000)
	libnvds_meta.so => /opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_meta.so (0x0000007f8564c000)
	libnvdsgst_helper.so => /opt/nvidia/deepstream/deepstream-5.0/lib/libnvdsgst_helper.so (0x0000007f85636000)
	libnvdsgst_meta.so => /opt/nvidia/deepstream/deepstream-5.0/lib/libnvdsgst_meta.so (0x0000007f85622000)
	libcuda.so.1 => /usr/lib/aarch64-linux-gnu/tegra/libcuda.so.1 (0x0000007f846df000)
	libdl.so.2 => /lib/aarch64-linux-gnu/libdl.so.2 (0x0000007f846ca000)
	libstdc++.so.6 => /usr/lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007f84536000)
	libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007f8450a000)
	librt.so.1 => /lib/aarch64-linux-gnu/librt.so.1 (0x0000007f844f3000)
	libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f8439a000)
	/lib/ld-linux-aarch64.so.1 (0x0000007f868ab000)
	libnvparsers.so.7 => /usr/lib/aarch64-linux-gnu/libnvparsers.so.7 (0x0000007f84055000)
	libnvonnxparser.so.7 => /usr/lib/aarch64-linux-gnu/libnvonnxparser.so.7 (0x0000007f83de2000)
	libnvinfer.so.7 => /usr/lib/aarch64-linux-gnu/libnvinfer.so.7 (0x0000007f7698c000)
	libnvinfer_plugin.so.7 => not found
	libnvds_inferutils.so => /opt/nvidia/deepstream/deepstream-5.0/lib/libnvds_inferutils.so (0x0000007f76967000)
	libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000007f768ad000)
	libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000007f76889000)
	libpcre.so.3 => /lib/aarch64-linux-gnu/libpcre.so.3 (0x0000007f76817000)
	libffi.so.6 => /usr/lib/aarch64-linux-gnu/libffi.so.6 (0x0000007f767ff000)
	libgmodule-2.0.so.0 => /usr/lib/aarch64-linux-gnu/libgmodule-2.0.so.0 (0x0000007f767eb000)
	libnvrm.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm.so (0x0000007f767a8000)
	libEGL.so.1 => /usr/lib/aarch64-linux-gnu/libEGL.so.1 (0x0000007f76787000)
	libnvos.so => /usr/lib/aarch64-linux-gnu/tegra/libnvos.so (0x0000007f76769000)
	libnvbuf_fdmap.so.1.0.0 => /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_fdmap.so.1.0.0 (0x0000007f76756000)
	libnvrm_graphics.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm_graphics.so (0x0000007f76736000)
	libnvddk_vic.so => /usr/lib/aarch64-linux-gnu/tegra/libnvddk_vic.so (0x0000007f76718000)
	libnvddk_2d_v2.so => /usr/lib/aarch64-linux-gnu/tegra/libnvddk_2d_v2.so (0x0000007f766f3000)
	libgstrtp-1.0.so.0 => /usr/lib/aarch64-linux-gnu/libgstrtp-1.0.so.0 (0x0000007f766c5000)
	libnvrm_gpu.so => /usr/lib/aarch64-linux-gnu/tegra/libnvrm_gpu.so (0x0000007f76680000)
	libnvidia-fatbinaryloader.so.440.18 => /usr/lib/aarch64-linux-gnu/tegra/libnvidia-fatbinaryloader.so.440.18 (0x0000007f76611000)
	libnvinfer_plugin.so.7 => not found
	libcudnn.so.8 => /usr/lib/aarch64-linux-gnu/libcudnn.so.8 (0x0000007f765db000)
	libcublas.so.10 => /usr/lib/aarch64-linux-gnu/libcublas.so.10 (0x0000007f718fd000)
	libcudart.so.10.2 => /usr/local/cuda-10.2/lib64/libcudart.so.10.2 (0x0000007f71887000)
	libmyelin.so.1 => /usr/lib/aarch64-linux-gnu/libmyelin.so.1 (0x0000007f713fa000)
	libnvrtc.so.10.2 => /usr/local/cuda-10.2/lib64/libnvrtc.so.10.2 (0x0000007f6ffc9000)
	libnvdla_compiler.so => /usr/lib/aarch64-linux-gnu/tegra/libnvdla_compiler.so (0x0000007f6fb95000)
	libnvmedia.so => /usr/lib/aarch64-linux-gnu/tegra/libnvmedia.so (0x0000007f6fb2e000)
	libcrypto.so.1.1 => /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1 (0x0000007f6f8ea000)
	libGLdispatch.so.0 => /usr/lib/aarch64-linux-gnu/libGLdispatch.so.0 (0x0000007f6f7bc000)
	libcublasLt.so.10 => /usr/lib/aarch64-linux-gnu/libcublasLt.so.10 (0x0000007f6d7f6000)
	libnvdc.so => /usr/lib/aarch64-linux-gnu/tegra/libnvdc.so (0x0000007f6d7d7000)
	libnvtvmr.so => /usr/lib/aarch64-linux-gnu/tegra/libnvtvmr.so (0x0000007f6d748000)
	libnvparser.so => /usr/lib/aarch64-linux-gnu/tegra/libnvparser.so (0x0000007f6d70a000)
	libnvimp.so => /usr/lib/aarch64-linux-gnu/tegra/libnvimp.so (0x0000007f6d6f5000)

Result running$ ll -sh /usr/lib/aarch64-linux-gnu/libnvinfer_plugin*

0 lrwxrwxrwx 1 root root   28 Jun  8 21:42 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.0.0 -> libnvinfer_plugin.so.7.0.0.1*
4.5M -rwxr-xr-x 1 root root 4.5M Jun  8 21:42 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.0.0.1*
7.7M -rw-r--r-- 1 root root 7.7M Apr 15 23:34 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin_static.a

So, there is something wrong for your libnvinfer_plugin.so.7

Please double check the step of https://github.com/NVIDIA-AI-IOT/deepstream_tlt_apps/tree/master/TRT-OSS/Jetson

3. Replace “libnvinfer_plugin.so*”

sudo mv /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.x.y ${HOME}/libnvinfer_plugin.so.7.x.y.bak   // backup original libnvinfer_plugin.so.x.y
sudo cp `pwd`/out/libnvinfer_plugin.so.7.m.n  /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.x.y
sudo ldconfig

After that, it should be as below.

nvidia@nvidia:~$ ll -sh /usr/lib/aarch64-linux-gnu/libnvinfer_plugin*
0 lrwxrwxrwx 1 root root 26 Apr 27 11:23 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so -> libnvinfer_plugin.so.7.1.0*
0 lrwxrwxrwx 1 root root 26 Apr 27 11:23 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7 -> libnvinfer_plugin.so.7.1.0*
0 lrwxrwxrwx 1 root root 26 Apr 27 11:23 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.0.0 -> libnvinfer_plugin.so.7.1.0*
4.5M -rwxr-xr-x 1 root root 4.5M Apr 27 09:06 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.1.0*
7.7M -rw-r–r-- 1 root root 7.7M Apr 8 05:35 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin_static.a

Hi, there are three files in my .../TensorRT/build/out folder:
libnvinfer_plugin.so
libnvinfer_plugin.so.7.0.0
libnvinfer_plugin.so.7.0.0.1
Do I need to sudo cp all of these files to /usr/lib/aarch64-linux-gnu or just a single one?

I sudo cp all of them into the folder, and run sudo ldconfig. I got this message:
/sbin/ldconfig.real: /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.0.0 is not a symbolic link
So I removed other two and created sybolic link between each others:

    dewei@dewei-desktop:/usr/lib/aarch64-linux-gnu$ sudo rm libnvinfer_plugin.so
    dewei@dewei-desktop:/usr/lib/aarch64-linux-gnu$ sudo rm libnvinfer_plugin.so.7.0.0
    dewei@dewei-desktop:/usr/lib/aarch64-linux-gnu$ sudo ln libnvinfer_plugin.so.7.0.0.1 libnvinfer_plugin.so.7.0.0
    dewei@dewei-desktop:/usr/lib/aarch64-linux-gnu$ sudo ln libnvinfer_plugin.so.7.0.0 libnvinfer_plugin.so
    dewei@dewei-desktop:/usr/lib/aarch64-linux-gnu$ sudo ldconfig

Then I ran the $ ll -sh /usr/lib/aarch64-linux-gnu/libnvinfer_plugin*,
the result looks like different as below:

4.5M -rwxr-xr-x 3 root root 4.5M Jun  9 21:41 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so*
4.5M -rwxr-xr-x 3 root root 4.5M Jun  9 21:41 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.0.0*
4.5M -rwxr-xr-x 3 root root 4.5M Jun  9 21:41 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.0.0.1*
7.7M -rw-r--r-- 1 root root 7.7M Apr 15 23:34 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin_static.a

Thanks.

Can you run below at your device?

$ ll -sh …/TensorRT/build/out

  desktop:~/TensorRT/build/out$ ll -sh
    total 4.5M
    4.0K drwxr-xr-x 2 dewei dewei 4.0K Jun  8 21:30 ./
    4.0K drwxr-xr-x 9 dewei dewei 4.0K Jun  8 21:29 ../
       0 lrwxrwxrwx 1 dewei dewei   26 Jun  8 21:30 libnvinfer_plugin.so -> libnvinfer_plugin.so.7.0.0*
       0 lrwxrwxrwx 1 dewei dewei   28 Jun  8 21:30 libnvinfer_plugin.so.7.0.0 -> libnvinfer_plugin.so.7.0.0.1*
    4.5M -rwxr-xr-x 1 dewei dewei 4.5M Jun  8 21:30 libnvinfer_plugin.so.7.0.0.1*

Please see below.

Original:

$ ll -sh /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so*

0 lrwxrwxrwx 1 root root 26 Apr 26 16:41 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so -> libnvinfer_plugin.so.7.1.0
0 lrwxrwxrwx 1 root root 26 Apr 26 16:41 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7 -> libnvinfer_plugin.so.7.1.0
4.5M -rw-r–r-- 1 root root 4.5M Apr 26 16:38 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.1.0

If

$ sudo mv /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.1.0 ~/libnvinfer_plugin.so.7.1.0.bak

$ sudo cp {TRT_SOURCE}/build/out/libnvinfer_plugin.so.7.0.0.1 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.1.0

$ sudo ldconfig

then

nvidia@nvidia:~$ ll /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so*
lrwxrwxrwx 1 root root 26 Apr 27 08:53 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so -> libnvinfer_plugin.so.7.1.0*
lrwxrwxrwx 1 root root 26 Apr 27 08:53 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7 -> libnvinfer_plugin.so.7.1.0*
lrwxrwxrwx 1 root root 26 Apr 27 08:55 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.0.0 -> libnvinfer_plugin.so.7.1.0*
-rwxr-xr-x 1 root root 4652648 Apr 27 08:55 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.1.0*

That’s the expected now.

I checked there is no existed libnvinfer_plugin.so.* in /usr/lib/aarch64-linux-gnu/

And then I ran
sudo cp /home/dewei/TensorRT/build/out/libnvinfer_plugin.so.7.0.0.1 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.1.0.

And then sudo ldconfig

Here is the result by following the steps:

dewei@dewei-desktop:~$ ll /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so*
lrwxrwxrwx 1 root root      26 Jun 10 00:02 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.0.0 -> libnvinfer_plugin.so.7.1.0*
-rwxr-xr-x 1 root root 4652648 Jun 10 00:00 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.1.0*

That’s because you already removed libnvinfer_plugin.so and libnvinfer_plugin.so.7 several minutes ago. You have not the original now.

For your case, please generate the softlinks now.

nvidia@nvidia:~$ cd /usr/lib/aarch64-linux-gnu

nvidia@nvidia:/usr/lib/aarch64-linux-gnu$ sudo ln -s libnvinfer_plugin.so.7.1.0 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so

nvidia@nvidia:/usr/lib/aarch64-linux-gnu$ sudo ln -s libnvinfer_plugin.so.7.1.0 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7

same error!!ERROR: …/nvdsinfer/nvdsinfer_func_utils.cpp:31 [TRT]: UffParser: UFF buffer empty
parseModel: Failed to parse UFF model
ERROR: tlt/tlt_decode.cpp:274 failed to build network since parsing model errors.
ERROR: …/nvdsinfer/nvdsinfer_model_builder.cpp:797 Failed to create network using custom network creation function
ERROR: …/nvdsinfer/nvdsinfer_model_builder.cpp:862 Failed to get cuda engine from custom library API
0:00:01.098802276 6608 0x55eeee4baaf0 ERROR nvinfer gstnvinfer.cpp:596:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1611

Please check if TLT-deepstream sample app error can help you.