Compile with tensorrt lib on jetson orin nano devkit in C++

Hello,

I want to use the TensorRT library in a C++ program. So, I add the following line in my CMakeLists.txt file :
find_package(TensorRT REQUIRED)

When I run the cmake command, I’ve got an error :

CMake Error at CMakeLists.txt:18 (find_package):
  By not providing "FindTensorRT.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "TensorRT",
  but CMake did not find one.

  Could not find a package configuration file provided by "TensorRT" with any
  of the following names:

    TensorRTConfig.cmake
    tensorrt-config.cmake

  Add the installation prefix of "TensorRT" to CMAKE_PREFIX_PATH or set
  "TensorRT_DIR" to a directory containing one of the above files.  If
  "TensorRT" provides a separate development package or SDK, be sure it has
  been installed.

My configurations is as follow :
Jetson Orin nano Developer Kit (install from the SD Card Image Method)
Jetpack 5.1.1
CUDA: 11.4.315
cuDNN: 8.6.0.166
TensorRT: 8.5.2.2 (the command dpkg-query -W tensorrt return tensorrt 8.5.2.2-1+cuda11.4)

I can’t find the TensorRTConfig.cmake file, the tensorrt-config.cmake file or the TensorRT-8.5.2.2 folder. I just have a tensorrt folder in /usr/src/ :

cor@wporin:/usr/src/tensorrt$ ls
bin  data  samples

Is the TensorRt library really installed? What am I missing here?

Thanks,

Hi,

TensorRT library is called nvinfer and is located at:

$ ll /usr/lib/aarch64-linux-gnu/libnvinfer*
$ ll /usr/include/aarch64-linux-gnu/NvInfer*

Below is a sample cmake file for your reference:

Thanks.

@AastaLLL, thank you for your answer. I finally get it to work by creating a file like this one : https://github.com/smistad/FAST/blob/master/cmake/FindTensorRT.cmake

Then I copy it into the same directory as my CMakeLists.txt file and everything is fine.

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.