How did I install TensorRT 5.1.2 for CUDA 10.0 to Ubuntu 18.04?

Step 1

I have downloaded TensorRT 5.1.2 from

Please note that I downloaded not the latest TensorRT version but the version compatible with CUDA 10.0:


Step 2

dpkg -i nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.2.2-rc-20190227_1-1_amd64.deb
apt-key add /var/nv-tensorrt-repo-cuda10.0-trt5.1.2.2-rc-20190227/
apt-get update
apt-get install libnvinfer5=5.1.2-1+cuda10.0
apt-get install libnvinfer-dev=5.1.2-1+cuda10.0
apt-mark hold libnvinfer5 libnvinfer-dev

The documentation says:

If you want to upgrade to the latest version of TensorRT or the latest version of CUDA, then you can unhold the libnvinfer5 package using the following command:

apt-mark unhold libnvinfer5 libnvinfer-dev