Packages have unmet dependencies (tensorRT) but TensorRT is installed

While trying to install DeepStream I got error related to the TensorRT installation:

The following packages have unmet dependencies:
 deepstream-5.1 : Depends: libnvinfer7 (>= 7.2.1) but it is not installable
                  Depends: libnvinfer-dev (>= 7.2.1) but it is not installable
                  Depends: libnvparsers7 (>= 7.2.1) but it is not installable
                  Depends: libnvparsers-dev (>= 7.2.1) but it is not installable
                  Depends: libnvonnxparsers7 (>= 7.2.1) but it is not installable
                  Depends: libnvonnxparsers-dev (>= 7.2.1) but it is not installable
                  Depends: libnvinfer-plugin7 (>= 7.2.1) but it is not installable
                  Depends: libnvinfer-plugin-dev (>= 7.2.1) but it is not installable
E: Unable to correct problems, you have held broken packages.

To install TensorRT I followed your instructions here: Installation Guide :: NVIDIA Deep Learning TensorRT Documentation . First, I downloaded TensorRT-7.2.1.6.Ubuntu-18.04.x86_64-gnu.cuda-11.1.cudnn8.0.tar.gz. Then:

version="7.2.1.6"
arch=$(uname -m)
cuda="cuda-11.1"
cudnn="cudnn8.0"
tar -xvzf TensorRT-${version}.Ubuntu-18.04.${arch}-gnu.${cuda}.${cudnn}.tar.gz
echo '# TensorRT' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH="/home/ubuntu/pycharm/libs/TensorRT-'${version}'/lib:${LD_LIBRARY_PATH}"' >> ~/.bashrc
source ~/.bashrc
cd ~/pycharm/libs/TensorRT-${version}/python
python3 -m pip install tensorrt-${version}-cp36-none-linux_x86_64.whl
cd ~/pycharm/libs/TensorRT-${version}/uff
python3 -m pip install uff-0.6.9-py2.py3-none-any.whl
cd ~/pycharm/libs/TensorRT-${version}/graphsurgeon
python3 -m pip install graphsurgeon-0.4.5-py2.py3-none-any.whl
cd ~/pycharm/libs/TensorRT-${version}/onnx_graphsurgeon
python3 -m pip install onnx_graphsurgeon-0.2.6-py2.py3-none-any.whl

TensorRT works correctly from Python. But dpkg -l | grep TensorRT does not show anything. I think all the necessary libraries are in my folder /home/ubuntu/pycharm/libs/TensorRT-7.2.1.6/lib:

>>> ls /home/ubuntu/pycharm/libs/TensorRT-7.2.1.6/lib
libmyelin.so                 libmyelin_executor_static.a         libnvcaffe_parser.so        libnvinfer.so.7         libnvinfer_plugin.so.7.2.1  libnvonnxparser.so.7      libnvparsers.so.7      libprotobuf-lite.a
libmyelin.so.1               libmyelin_pattern_library_static.a  libnvcaffe_parser.so.7      libnvinfer.so.7.2.1     libnvinfer_plugin_static.a  libnvonnxparser.so.7.2.1  libnvparsers.so.7.2.1  libprotobuf.a
libmyelin.so.1.1.65          libmyelin_pattern_runtime_static.a  libnvcaffe_parser.so.7.2.1  libnvinfer_plugin.so    libnvinfer_static.a         libnvonnxparser_static.a  libnvparsers_static.a  stubs
libmyelin_compiler_static.a  libnvcaffe_parser.a                 libnvinfer.so               libnvinfer_plugin.so.7  libnvonnxparser.so          libnvparsers.so           libonnx_proto.a

It looks to me like the installation is correct, but I need to tell Ubuntu to look for those libraries in this folder. How can I fix this?

Could you make sure path exported successfully?

It seems to be.

 echo $LD_LIBRARY_PATH 
~/pycharm/libs/FFmpeg/build_x64_release_shared/lib:~/pycharm/libs/VideoProcessingFramework/install/bin:/home/ubuntu/pycharm/libs/VideoProcessingFramework/install/bin:/home/ubuntu/pycharm/libs/FFmpeg/build_x64_release_shared/lib:/opt/intel/openvino_2021.1.110/data_processing/dl_streamer/lib:/opt/intel/openvino_2021.1.110/data_processing/gstreamer/lib:/opt/intel/openvino_2021.1.110/opencv/lib:/opt/intel/openvino_2021.1.110/deployment_tools/ngraph/lib:/opt/intel/openvino_2021.1.110/deployment_tools/inference_engine/external/hddl_unite/lib:/opt/intel/openvino_2021.1.110/deployment_tools/inference_engine/external/hddl/lib:/opt/intel/openvino_2021.1.110/deployment_tools/inference_engine/external/gna/lib:/opt/intel/openvino_2021.1.110/deployment_tools/inference_engine/external/mkltiny_lnx/lib:/opt/intel/openvino_2021.1.110/deployment_tools/inference_engine/external/tbb/lib:/opt/intel/openvino_2021.1.110/deployment_tools/inference_engine/lib/intel64:/home/ubuntu/pycharm/venv/lib:/home/ubuntu/pycharm/libs/TensorRT-7.2.1.6/lib:/usr/local/cuda-11.1/lib64:

Hi,
Please refer to the installation steps from the below link if in case you are missing on anything
https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html
Also, we suggest you to use TRT NGC containers to avoid any system dependency related issues.
https://ngc.nvidia.com/catalog/containers/nvidia:tensorrt

Thanks!

I can’t use a container as this is my local machine. I followed the guide for tar archives as you can see from the steps above. I repeated them with no success.

I tried to install TensorRT using the deb package. It seems that the issue is caused by CuDNN:

The following packages have unmet dependencies:
 tensorrt : Depends: libnvinfer-dev (= 7.2.1-1+cuda11.1) but 8.2.0-1+cuda11.4 is to be installed
            Depends: libnvinfer-plugin-dev (= 7.2.1-1+cuda11.1) but 8.2.0-1+cuda11.4 is to be installed
            Depends: libnvparsers-dev (= 7.2.1-1+cuda11.1) but 8.2.0-1+cuda11.4 is to be installed
            Depends: libnvonnxparsers-dev (= 7.2.1-1+cuda11.1) but 8.2.0-1+cuda11.4 is to be installed
            Depends: libnvinfer-samples (= 7.2.1-1+cuda11.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Why does it tried to install the version for cuda 11.4? nvcc --version reports cuda 11.1. Have they been removed from the repository? If yes, I would need to use the tar installation, but it does not work.

More details:

(venv) ubuntu@ip-172-31-3-34:~/pycharm/libs$ sudo apt list tensorrt
Listing... Done
tensorrt/unknown 7.2.1.6-1+cuda11.1 amd64
(venv) ubuntu@ip-172-31-3-34:~/pycharm/libs$ sudo apt search tensorrt
Sorting... Done
Full Text Search... Done
graphsurgeon-tf/unknown 7.2.1-1+cuda11.1 amd64
  GraphSurgeon for TensorRT package

libnvinfer-bin/unknown 7.2.1-1+cuda11.1 amd64
  TensorRT binaries

libnvinfer-dev/unknown 8.2.0-1+cuda11.4 amd64
  TensorRT development libraries and headers

libnvinfer-doc/unknown 7.2.1-1+cuda11.1 all
  TensorRT documentation

libnvinfer-plugin-dev/unknown 8.2.0-1+cuda11.4 amd64
  TensorRT plugin libraries

libnvinfer-plugin7/unknown 7.2.1-1+cuda11.1 amd64
  TensorRT plugin libraries

libnvinfer-plugin8/unknown 8.2.0-1+cuda11.4 amd64
  TensorRT plugin libraries

libnvinfer-samples/unknown 7.2.1-1+cuda11.1 all
  TensorRT samples

libnvinfer7/unknown 7.2.1-1+cuda11.1 amd64
  TensorRT runtime libraries

libnvinfer8/unknown 8.2.0-1+cuda11.4 amd64
  TensorRT runtime libraries

libnvonnxparsers-dev/unknown 8.2.0-1+cuda11.4 amd64
  TensorRT ONNX libraries

libnvonnxparsers7/unknown 7.2.1-1+cuda11.1 amd64
  TensorRT ONNX libraries

libnvonnxparsers8/unknown 8.2.0-1+cuda11.4 amd64
  TensorRT ONNX libraries

libnvparsers-dev/unknown 8.2.0-1+cuda11.4 amd64
  TensorRT parsers libraries

libnvparsers7/unknown 7.2.1-1+cuda11.1 amd64
  TensorRT parsers libraries

libnvparsers8/unknown 8.2.0-1+cuda11.4 amd64
  TensorRT parsers libraries

nv-tensorrt-repo-ubuntu1804-cuda11.1-trt7.2.1.6-ga-20201007/now 1-1 amd64 [installed,local]
  nv-tensorrt repository configuration files

onnx-graphsurgeon/unknown 7.2.1-1+cuda11.1 amd64
  ONNX GraphSurgeon for TensorRT package

python-libnvinfer/unknown 7.2.1-1+cuda11.1 amd64
  Python bindings for TensorRT

python-libnvinfer-dev/unknown 7.2.1-1+cuda11.1 amd64
  Python development package for TensorRT

python3-libnvinfer/unknown 8.2.0-1+cuda11.4 amd64
  Python 3 bindings for TensorRT

python3-libnvinfer-dev/unknown 8.2.0-1+cuda11.4 amd64
  Python 3 development package for TensorRT

tensorrt/unknown 7.2.1.6-1+cuda11.1 amd64
  Meta package of TensorRT

uff-converter-tf/unknown 7.2.1-1+cuda11.1 amd64
  UFF converter for TensorRT package

CuDNN is installed:

(venv) ubuntu@ip-172-31-3-34:~/pycharm/libs$ sudo apt-get install -y libcudnn8=${cudnn_version}-1+${cuda_version}
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libcudnn8 is already the newest version (8.0.5.39-1+cuda11.1).
The following package was automatically installed and is no longer required:
  linux-aws-5.4-headers-5.4.0-1056
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
(venv) ubuntu@ip-172-31-3-34:~/pycharm/libs$ 
(venv) ubuntu@ip-172-31-3-34:~/pycharm/libs$ sudo apt-get install -y libcudnn8-dev=${cudnn_version}-1+${cuda_version}
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libcudnn8-dev is already the newest version (8.0.5.39-1+cuda11.1).
The following package was automatically installed and is no longer required:
  linux-aws-5.4-headers-5.4.0-1056
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.

Hi @mfoglio,

Looks like you have older version of TRT package but you’re following installation steps of latest.
Please uninstall existing installation by following below
https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#uninstalling

We highly recommend you to please download latest TRT version package and make sure requirements satisfied by referring to support matrix and complete the installation by follwing Installation Guide :: NVIDIA Deep Learning TensorRT Documentation

Thank you.

I followed the instruction for the appropriate version but as of now I can’t find a way to properly setup deem stream 5.1 on a clean ubuntu machine using TensorRT 7.2.1.6, CuDNN 8.0 and Cuda 11.1.
I need Deepstream 5.1, I can’t use a newer version.

Hi,
Are you still facing this issue

I am going to use Deepstream 6.0 so we can close this thread.