TensorRT: Intalling TensorRT: Depends: libnvinfer8 (= 8.2.2-1+cuda11.4) but it is not going to be installed

I do have a docker container with the following environment:

  • OS: Linux Ubuntu 18.04
  • Base Image: pytorch/pytorch:1.9.1-cuda11.1-cudnn8-runtime
  • GPU: Tesla K80
  • Cuda Version: 11.1
  • PyTorch Version: 1.9.1
  • downloaded .deb: nv-tensorrt-repo-ubuntu1804-cuda11.4-trt8.2.2.1-ga-20211214_1-1_amd64.deb

information from the downloaded .deb: TensorRT 8.2 GA Update 1 for Ubuntu 18.04 and CUDA 11.0, 11.1, 11.2, 11.3, 11.4 and 11.5 DEB local repo Package

As I followed the installing instructions on the Nvidia Webside an error ocurred:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-libnvinfer : Depends: libnvinfer8 (= 8.2.2-1+cuda11.4) but it is not going to be installed
                      Depends: libnvinfer-plugin8 (= 8.2.2-1+cuda11.4) but it is not going to be installed
                      Depends: libnvparsers8 (= 8.2.2-1+cuda11.4) but it is not going to be installed
                      Depends: libnvonnxparsers8 (= 8.2.2-1+cuda11.4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 10
  • Comments: 15

Most upvoted comments

the solution is to install cudnn packages through the deb installation, not tar, as described here: https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html

I encountered the same issue and found a solution! I was trying to install tensorrt libs=8.6.0.12-1+cuda11.8 on the nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 image but ran into error messages indicating unmet dependencies.

root@732029c2cefe:/# apt-get install libnvinfer-bin=8.6.0.12-1+cuda11.8
Reading package lists... Done
Building dependency tree... Done 
Reading state information... Done
Some packages could not be installed. This may mean that you have 
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:      

The following packages have unmet dependencies:
 libnvinfer-bin : Depends: libnvinfer8 (= 8.6.0.12-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
                  Depends: libnvinfer-lean8 (= 8.6.0.12-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed     
                  Depends: libnvinfer-plugin8 (= 8.6.0.12-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed   
                  Depends: libnvinfer-vc-plugin8 (= 8.6.0.12-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed
                  Depends: libnvinfer-dispatch8 (= 8.6.0.12-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed 
                  Depends: libnvparsers8 (= 8.6.0.12-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed        
                  Depends: libnvonnxparsers8 (= 8.6.0.12-1+cuda11.8) but 8.6.1.6-1+cuda12.0 is to be installed    
E: Unable to correct problems, you have held broken packages.

To resolve this, I followed a suggestion from an AskUbuntu post, which recommended installing the dependent libraries before attempting to install the desired library. This approach worked, and I was able to successfully install the TensorRT libraries.

root@732029c2cefe:/# apt-get install libnvinfer8=8.6.0.12-1+cuda11.8 libnvinfer-lean8=8.6.0.12-1+cuda11.8 libnvinfer-plugin8=8.6.0.12-1+cuda11.8 libnvinfer-vc-plugin8=8.6.0.12-1+cuda11.8 libnvinfer-dispatch8=8.6.0.12-1+cuda11.8 libnvparsers8=8.6.0.12-1+cuda11.8 libnvonnxparsers8=8.6.0.12-1+cuda11.8

image

root@732029c2cefe:/# apt-get install libnvinfer8=8.6.0.12-1+cuda11.8 libnvinfer-lean8=8.6.0.12-1+cuda11.8 libnvinfer-plugin8=8.6.0.12-1+cuda11.8 libnvinfer-vc-plugin8=8.6.0.12-1+cuda11.8 libnvinfer-dispatch8=8.6.0.12-1+cuda11.8 libnvparsers8=8.6.0.12-1+cuda11.8 libnvonnxparsers8=8.6.0.12-1+cuda11.8Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libnvinfer-dispatch8 libnvinfer-lean8 libnvinfer-plugin8 libnvinfer-vc-plugin8 libnvinfer8 libnvonnxparsers8 libnvparsers8
0 upgraded, 7 newly installed, 0 to remove and 64 not upgraded.
Need to get 505 MB of archives.
After this operation, 1308 MB of additional disk space will be used.
Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  libnvinfer-dispatch8 8.6.0.12-1+cuda11.8 [212 kB]
Get:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  libnvinfer-lean8 8.6.0.12-1+cuda11.8 [8883 kB]
Get:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  libnvinfer8 8.6.0.12-1+cuda11.8 [482 MB]
Get:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  libnvinfer-plugin8 8.6.0.12-1+cuda11.8 [12.5 MB]
Get:5 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  libnvinfer-vc-plugin8 8.6.0.12-1+cuda11.8 [240 kB]
Get:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  libnvonnxparsers8 8.6.0.12-1+cuda11.8 [718 kB]
Get:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  libnvparsers8 8.6.0.12-1+cuda11.8 [804 kB]
Fetched 505 MB in 21s (23.5 MB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libnvinfer-dispatch8.
(Reading database ... 14025 files and directories currently installed.)
Preparing to unpack .../0-libnvinfer-dispatch8_8.6.0.12-1+cuda11.8_amd64.deb ...
Unpacking libnvinfer-dispatch8 (8.6.0.12-1+cuda11.8) ...
Selecting previously unselected package libnvinfer-lean8.
Preparing to unpack .../1-libnvinfer-lean8_8.6.0.12-1+cuda11.8_amd64.deb ...
Unpacking libnvinfer-lean8 (8.6.0.12-1+cuda11.8) ...
Selecting previously unselected package libnvinfer8.
Preparing to unpack .../2-libnvinfer8_8.6.0.12-1+cuda11.8_amd64.deb ...
Unpacking libnvinfer8 (8.6.0.12-1+cuda11.8) ...
Selecting previously unselected package libnvinfer-plugin8.
Preparing to unpack .../3-libnvinfer-plugin8_8.6.0.12-1+cuda11.8_amd64.deb ...
Unpacking libnvinfer-plugin8 (8.6.0.12-1+cuda11.8) ...
Selecting previously unselected package libnvinfer-vc-plugin8.
Preparing to unpack .../4-libnvinfer-vc-plugin8_8.6.0.12-1+cuda11.8_amd64.deb ...
Unpacking libnvinfer-vc-plugin8 (8.6.0.12-1+cuda11.8) ...
Selecting previously unselected package libnvonnxparsers8.
Preparing to unpack .../5-libnvonnxparsers8_8.6.0.12-1+cuda11.8_amd64.deb ...
Unpacking libnvonnxparsers8 (8.6.0.12-1+cuda11.8) ...
Selecting previously unselected package libnvparsers8.
Preparing to unpack .../6-libnvparsers8_8.6.0.12-1+cuda11.8_amd64.deb ...
Unpacking libnvparsers8 (8.6.0.12-1+cuda11.8) ...
Setting up libnvinfer-lean8 (8.6.0.12-1+cuda11.8) ...
Setting up libnvinfer8 (8.6.0.12-1+cuda11.8) ...
Setting up libnvinfer-vc-plugin8 (8.6.0.12-1+cuda11.8) ...
Setting up libnvinfer-dispatch8 (8.6.0.12-1+cuda11.8) ...
Setting up libnvparsers8 (8.6.0.12-1+cuda11.8) ...
Setting up libnvinfer-plugin8 (8.6.0.12-1+cuda11.8) ...
Setting up libnvonnxparsers8 (8.6.0.12-1+cuda11.8) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

After first downloading unmet dependencies

image


root@732029c2cefe:/# apt-get install libnvinfer-bin=8.6.0.12-1+cuda11.8
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  libnvinfer-bin
0 upgraded, 1 newly installed, 0 to remove and 71 not upgraded.
Need to get 354 kB of archives.
After this operation, 1533 kB of additional disk space will be used.
Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  libnvinfer-bin 8.6.0.12-1+cuda11.8 [354 kB]
Fetched 354 kB in 0s (1112 kB/s)       
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libnvinfer-bin.
(Reading database ... 14065 files and directories currently installed.)
Preparing to unpack .../libnvinfer-bin_8.6.0.12-1+cuda11.8_amd64.deb ...
Unpacking libnvinfer-bin (8.6.0.12-1+cuda11.8) ...
Setting up libnvinfer-bin (8.6.0.12-1+cuda11.8) ...

any updates or fixes for this issue??

@laszloturanyi I tried that, but it is not able to locate the package for some odd reason.

apt-get install python3-libnvinfer-dev

into:

E: Unable to locate package python3-libnvinfer-dev

This problem occurs for any other libnv-package too.

Install python3-libnvinfer-dev first, then it should work.

sudo apt-get install python3-libnvinfer-dev

Order in Installation guide is mixed up