TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

sample_mnist gives libnvcaffeparser.so.8 => not found

Open mkaivs opened this issue 2 years ago • 3 comments

Description

Failed to run sample program sample_mnist

Environment

TensorRT Version:8.2.5.1 NVIDIA GPU: Quadro P4000 NVIDIA Driver Version: Quadro P4000 CUDA Version: 11.6 CUDNN Version: 8.4 Operating System: Ubuntu 20.04 Python Version (if applicable): NA Tensorflow Version (if applicable): NA PyTorch Version (if applicable): NA Baremetal or Container (if so, version): NA

Steps To Reproduce

Clone and build:

git clone -b release/8.2 https://github.com/nvidia/TensorRT
cd TensorRT/
git submodule update --init --recursive
mkdir -p build && cd build
cmake .. -DGPU_ARCHS=61 -DTRT_LIB_DIR=/usr/local/TensorRT-8.2.5.1/lib -DTRT_OUT_DIR=`pwd`/out
make -j$(nproc)

Run sample_mnist sample:

cd out
ldd ./sample_mnist

Output:

linux-vdso.so.1 (0x00007fff9bb2c000)
libcudart.so.11.0 => /usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudart.so.11.0 (0x00007f61e5250000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f61e522d000)
libnvcaffeparser.so.8 => not found
libnvinfer.so.8 => /usr/local/TensorRT-8.2.5.1/lib/libnvinfer.so.8 (0x00007f61ca56b000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f61ca389000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f61ca36e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f61ca17a000)
/lib64/ld-linux-x86-64.so.2 (0x00007f61e5521000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f61ca174000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f61ca16a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f61ca01b000)

Content of ls /usr/local/TensorRT-8.2.5.1/lib:

libnvcaffe_parser.a         libnvinfer_builder_resource.so.8.2.5  libnvinfer_plugin_static.a  libnvinfer_static.a       libnvonnxparser_static.a  libnvparsers_static.a  stubs
libnvcaffe_parser.so        libnvinfer_plugin.so                  libnvinfer.so               libnvonnxparser.so        libnvparsers.so           libonnx_proto.a
libnvcaffe_parser.so.8      libnvinfer_plugin.so.8                libnvinfer.so.8             libnvonnxparser.so.8      libnvparsers.so.8         libprotobuf.a
libnvcaffe_parser.so.8.2.5  libnvinfer_plugin.so.8.2.5            libnvinfer.so.8.2.5         libnvonnxparser.so.8.2.5  libnvparsers.so.8.2.5     libprotobuf-lite.a

The libnvcaffeparser.so.8 shared lib is missing, there is libnvcaffe_parser.so.8 in TensorRT-8.2.5.1 lib dir, may be there a typo somewhere in one of the CmakeLists files?

mkaivs avatar Aug 16 '22 21:08 mkaivs

export LD_LIBRARY_PATH=/usr/local/TensorRT-8.2.5.1/lib:$LD_LIBRARY_PATH and try again?

zerollzeng avatar Aug 17 '22 10:08 zerollzeng

Thank you for reply, modify LD_LIBRARY_PATH fix the error but I already added /usr/local/TensorRT-8.2.5.1/lib to a .conf file in /etc/ld.so.conf.d/ and ldconfig --verbose shows that the loader is aware of /usr/local/TensorRT-8.2.5.1/lib:

/usr/local/TensorRT-8.2.5.1/lib:
	libnvonnxparser.so.8 -> libnvonnxparser.so.8.2.5
	libnvinfer.so.8 -> libnvinfer.so.8.2.5
	libnvinfer_plugin.so.8 -> libnvinfer_plugin.so.8.2.5
	libnvparsers.so.8 -> libnvparsers.so.8.2.5
	libnvinfer_builder_resource.so.8.2.5 -> libnvinfer_builder_resource.so.8.2.5

So how come I still need to modify LD_LIBRARY_PATH?

mkaivs avatar Aug 18 '22 21:08 mkaivs

I'm not an expert on the Linux env setup so I can't answer this question, but I would like to learn something here :-)

zerollzeng avatar Aug 20 '22 11:08 zerollzeng

closing since no activity for more than 3 weeks, please reopen if you still have question, thanks!

ttyio avatar Dec 06 '22 02:12 ttyio