iwatake2222 / play_with_tensorrt

Sample projects for TensorRT in C++
Apache License 2.0
191 stars 34 forks source link

/usr/bin/ld: cannot find -lnvinfer: No such file or directory #42

Closed asifpatankar closed 2 months ago

asifpatankar commented 1 year ago

Environment (Hardware)

Linux Mint 21 with CUDA 11.8, CuDNN 8.8 and TensorRT 8.6

Project Name

pj_tensorrt_cls_mobilenet_v2

Issue Details

Maybe stupid question to ask. I am getting to learn about tensorRT and came to this repo. Followed as mentioned in the installation procedures. I have TensorRT installed and export 'ed the PATH. After cmake, when make I get the following error.

Error Log

[100%] Linking CXX executable main /usr/bin/ld: cannot find -lnvinfer: No such file or directory /usr/bin/ld: cannot find -lnvonnxparser: No such file or directory /usr/bin/ld: cannot find -lnvinfer_plugin: No such file or directory collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/main.dir/build.make:210: main] Error 1 make[1]: [CMakeFiles/Makefile2:137: CMakeFiles/main.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

asifpatankar commented 1 year ago

The problem is solved by symlink to the TensorRT lib directory as below: sudo ln -s /path_to_directory/TensorRT-8.6.1.6/lib/libnvinfer.so.8.6.1 /usr/lib/libnvinfer.so sudo ln -s /path_to_directory/TensorRT-8.6.1.6/lib/libnvonnxparser.so.8.6.1 /usr/lib/libnvonnxparser.so sudo ln -s /path_to_directory/TensorRT-8.6.1.6/lib/libnvinfer_plugin.so.8.6.1 /usr/lib/libnvinfer_plugin.so