Failling in building sample from TLT-DEEPSTREAM

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.

Now playing: pgie_frcnn_tlt_config.txt
0:00:00.305122592 100652 0x563207acb470 INFO nvinfer gstnvinfer.cpp:602:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1591> [UID = 1]: Trying to create engine from model files
ERROR: …/nvdsinfer/nvdsinfer_func_utils.cpp:31 [TRT]: UffParser: Could not read buffer.
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:00.411899957 100652 0x563207acb470 ERROR nvinfer gstnvinfer.cpp:596:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1611> [UID = 1]: build engine file failed
Segmentation fault (core dumped)

help me

Now playing: pgie_frcnn_tlt_config.txt
0:00:00.305122592 100652 0x563207acb470 INFO nvinfer gstnvinfer.cpp:602:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1591> [UID = 1]: Trying to create engine from model files
ERROR: …/nvdsinfer/nvdsinfer_func_utils.cpp:31 [TRT]: UffParser: Could not read buffer.
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:00.411899957 100652 0x563207acb470 ERROR nvinfer gstnvinfer.cpp:596:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1611> [UID = 1]: build engine file failed
Segmentation fault (core dumped)

0:00:00.305122592 100652 0x563207acb470 INFO nvinfer gstnvinfer.cpp:602:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1591> [UID = 1]: Trying to create engine from model files
ERROR: …/nvdsinfer/nvdsinfer_func_utils.cpp:31 [TRT]: UffParser: Could not read buffer.
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:00.411899957 100652 0x563207acb470 ERROR nvinfer gstnvinfer.cpp:596:gst_nvinfer_logger: NvDsInferContext[UID 1]: Error in NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1611> [UID = 1]: build engine file failed

Please check above reference link.
If not help, please create a new forum topic and paste your running command, config file and full log.

Hello, I do not have this file after executing this command
ll -sh /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so*
This file was not found
(libnvinfer_plugin.so.7.1.0)

@1073623056
Please create a new TLT forum topic.

But I can find this file(libnvinfer_plugin.so.7.1.0.bak)

$ 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.3
0 lrwxrwxrwx 1 root root 26 Apr 26 16:41 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7 -> libnvinfer_plugin.so.7.1.3.bak
4.5M -rw-r–r-- 1 root root 4.5M Apr 26 16:38 /usr/lib/aarch64-linux-gnu/libnvinfer_plugin.so.7.1.3.bak

@1073623056
Please create a new TLT forum topic.
And describe the detailed step you have done.