Where is TensorRT located in an Ubuntu 16.04 dpkg installation?

Where is TensorRT located in Ubuntu 16.04? I have installed via dpkg in the way prescribed in the user guide without error. https://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html

$ dpkg -l | grep TensorRT
ii  graphsurgeon-tf                                             5.0.2-1+cuda10.0                                      amd64        GraphSurgeon for TensorRT package
ii  libnvinfer-dev                                              5.0.2-1+cuda10.0                                      amd64        TensorRT development libraries and headers
ii  libnvinfer-samples                                          5.0.2-1+cuda10.0                                      all          TensorRT samples and documentation
ii  libnvinfer5                                                 5.0.2-1+cuda10.0                                      amd64        TensorRT runtime libraries
ii  python-libnvinfer                                           5.0.2-1+cuda10.0                                      amd64        Python bindings for TensorRT
ii  python-libnvinfer-dev                                       5.0.2-1+cuda10.0                                      amd64        Python development package for TensorRT
ii  python3-libnvinfer                                          5.0.2-1+cuda10.0                                      amd64        Python 3 bindings for TensorRT
ii  python3-libnvinfer-dev                                      5.0.2-1+cuda10.0                                      amd64        Python 3 development package for TensorRT
ii  tensorrt                                                                              amd64        Meta package of TensorRT
ii  uff-converter-tf                                            5.0.2-1+cuda10.0                                      amd64        UFF converter for TensorRT package

I am now attempting to install onnx-tensorrt, the make/install instructions are:

“Suppose your TensorRT library is located at /opt/tensorrt. Build the onnx2trt executable and the libnvonnxparser* libraries using CMake:”

mkdir build
cd build
cmake .. -DTENSORRT_ROOT=/opt/tensorrt
make -j8
sudo make install


What should I use for DTENSORRT_ROOT? there is nothing at /opt/tensorrt, using find, I note that there exists a candidate at /usr/src/tensorrt:

$ sudo find / -name tensorrt 2> /dev/null


default installation path should be at /opt/tensorrt

root@545461589b9d:/opt/tensorrt# ls
bin  data  python  samples

/usr/src/tensorrt is a symbolic link to /opt/tensorrt.

Hi, Thanks for your reply,

I don’t have anything there:
$ ls /opt/
containerd ros teamviewer

Does this mean that I have probably installed tensorrt incorrectly? I haven’t managed to build and run any of the sample inference engines yet.

possibly. Please try running the samples.

also try ls -l /usr/src/tensorrt and see where it’s linking to.

It appears to be installed, at least according to dpkg and apt

$ sudo apt install tensorrt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
tensorrt is already the newest version (
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.

and inspecting the dir tree shows:

$ ls -ld /usr/src/tensorrt/
drwxr-xr-x 6 root root 4096 Dec 24 13:16 /usr/src/tensorrt/
$ ls /usr/src/tensorrt/
bin  data  python  samples

I am struggling with the samples, will try for longer and get back…

ok. Looks like you can point DTENSORRT_ROOT to /usr/src/tensorrt in your case

What should I give in CMake … -DTENSORRT_ROOT=

ritesh@mach-1:~$ sudo find / -name tensorrt 2> /dev/null

ritesh@mach-1:~$ ls -ld /usr/src/tensorrt/
drwxr-xr-x 5 root root 4096 Aug 24 19:37 /usr/src/tensorrt/

ritesh@mach-1:~$ ls /usr/src/tensorrt/
bin data samples

These are the result I’m getting. Can you what you wrote in DTENSORRT_ROOT path?

PS: I’ve pointed DTENSORRT_ROOT to /usr/src/tensorrt, Still I’m getting ModuleNotFoundError: No module named ‘onnx_tensorrt’.