Difficulty install tensorrt

Dowloaded tensorrt from nvidia website and I run the following commands ( I already have pycuda installed, tensorflow-gpu-2.0, cudnn 7.6 and cudatoolkit 10.00, my computer has an nvidia 1050 gtx).

sudo apt-key add /var/nv-tensorrt-repo-cuda10.0-trt7.0.0.11-ga-20191216/7fa2af80.pub

sudo dpkg -i nv-tensorrt-repo-ubuntu1804-cuda10.0-trt7.0.0.11-ga-20191216_1-1_amd64.deb

sudo apt-get update

sudo apt-get install tensorrt

which gives the following error:

Depends: libnvonnxparsers-dev (= 7.0.0-1+cuda10.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

In case this matters, I want the python API and my main system uses Windows so I set up vitural box with a VM that rusn ubuntu 18.04.

Thanks in advance for any help!

A coworker had a similar issue. It seemed like it disappeared when he upgraded to 10.2

@christian.m was he also using a virtual machine or was he just getting a similar error?

As far as I can tell, he was just getting a similar error that seemed to magically disappear with an upgrade of the CUDA toolkit. I’m not sure if he was using a VM or not. I don’t think he was though…

A VM may be the cause but I don’t think it’s likely.

Hi,

It shouldn’t be related to whether it’s a VM or not. Just seems like you may have had a pre-existing install and/or something conflicted while installing.

I just installed these on my host machine and was unable to reproduce. I followed the .deb install instructions for CUDA, CUDNN, and TensorRT from online docs. Something along the lines of this:

# Install CUDA 10.0
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt install cuda-10-0

# Install CUDNN 7.6
# ...
# I already had this on my system

# Install TensorRT 7.0 for CUDA 10.0
sudo dpkg -i ~/Downloads/nv-tensorrt-repo-ubuntu1804-cuda10.0-trt7.0.0.11-ga-20191216_1-1_amd64.deb 
sudo apt-key add /var/nv-tensorrt-repo-cuda10.0-trt7.0.0.11-ga-20191216/7fa2af80.pub
sudo apt-get update
sudo apt install tensorrt
sudo apt-get install python3-libnvinfer-dev

I imagine your main problem is this: “E: Unable to correct problems, you have held broken packages.”

This is an error with “apt”, I would look into fixing this. There are several solution online.

Maybe something along the lines of these commands, but I suggest looking into it before blindly copying/pasting:

sudo apt-get update --fix-missing
sudo dpkg --configure -a
sudo apt-get install -f

@NVES_R thanks for the response! Just a general question, as a primary Windows user I’ve normally used anaconda distribution to get cuda/cudnn/TF etc, and I did the same on Ubuntu, is there any reason why this would have led to me having broken packages?

Hi,

Sorry I don’t have much experience on the Windows side, (nor with using Conda to install CUDA/CUDNN), but I would imagine it’s possible that installing cudatoolkit with Conda for example may possibly conflict or at least confuse apt when it might expect CUDA to be in a certain place rather than wherever Conda puts it when trying to install something dependent on CUDA. But that’s just a guess.