Python3 binding for TensorRT - Jetson AGX Xavier

Description

Hi!
I’m encountering an issue when trying to run a python3 script using the TensorRT API. When i try to execute such a script, it returns the following error:
ModuleNotFoundError: No module named 'tensorrt'

Upon further inspection, I realized python3-libnvinfer and python3-libnvinfer-dev are not installed.

I tried sudo apt-get install -y python3-libnvinfer but this returns:
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: python3 (< 3.7) but 3.8.2-0ubuntu2 is to be installed E: Unable to correct problems, you have held broken packages.

Next, I went on to check sudo apt-cache show python3-libnvinfer-dev python3-libnvinfer which returned:
Package: python3-libnvinfer-dev Source: tensorrt Version: 7.1.3-1+cuda10.2 Architecture: arm64 Maintainer: cudatools <cudatools@nvidia.com> Installed-Size: 10 Depends: python3-libnvinfer (= 7.1.3-1+cuda10.2), libnvinfer-dev (= 7.1.3-1+cuda10.2), libnvinfer-plugin-dev (= 7.1.3-1+cuda10.2), libnvparsers-dev (= 7.1.3-1+cuda10.2), libnvonnxparsers-dev (= 7.1.3-1+cuda10.2) Priority: optional Section: multiverse/devel Filename: pool/main/t/tensorrt/python3-libnvinfer-dev_7.1.3-1+cuda10.2_arm64.deb Size: 3612 Description: Python 3 development package for TensorRT Python 3 development package for TensorRT.

Package: python3-libnvinfer Source: tensorrt Version: 7.1.3-1+cuda10.2 Architecture: arm64 Maintainer: cudatools <cudatools@nvidia.com> Installed-Size: 2353 Depends: python3 (>= 3.6), python3 (<< 3.7), libnvinfer7 (= 7.1.3-1+cuda10.2), libnvinfer-plugin7 (= 7.1.3-1+cuda10.2), libnvparsers7 (= 7.1.3-1+cuda10.2), libnvonnxparsers7 (= 7.1.3-1+cuda10.2) Priority: optional Section: multiverse/devel Filename: pool/main/t/tensorrt/python3-libnvinfer_7.1.3-1+cuda10.2_arm64.deb Size: 347162 Description: Python 3 bindings for TensorRT Python 3 bindings for TensorRT.

How can I correct this and use the python3 TensorRT API ?

Important side notes:

  • I’m using the JetPack 4.5.1 SDK
  • python2 TensorRT API works fine

Environment

TensorRT Version: 7.1.3-1
GPU Type: Jetson AGX Xavier
CUDA Version: 10.2
CUDNN Version: 8.0.0.180-1
Operating System + Version: Ubuntu 20.04
Python Version (if applicable): Python 3.6.9

Hi,
This looks like a Jetson issue. We recommend you to raise it to the respective platform from the below link

Thanks!

1 Like

Hi @f.martin,

We request you to please refer support matrix doc and make sure you install required dependencies(correct versions).

We also recommend you to use TensorRT NGC container to avoid system dependencies.
https://ngc.nvidia.com/containers/nvidia:tensorrt

Thank you.

Hi,
The dependencies seem to match, my environment is:
TensorRT Version: 7.1.3-1
GPU Type: Jetson AGX Xavier
CUDA Version: 10.2
CUDNN Version: 8.0.0.180-1
Operating System + Version: Ubuntu 20.04
Python Version (if applicable): Python 3.6.9

For the TensorRT NGC containers, they are only compatible with an amd64 architecture. I’m using a Jetson AGX Xavier (arm64 architecture).

Do you have any other solutions I could try?

Hi @f.martin,

We recommend you to post your query on Jetson AGX forum to get better help.

Thank you.

Hi,

I did just this a while ago but I’m still awaiting an answer: Python3 binding for TensorRT - Jetson AGX Xavier - #4 by f.martin

Thanks a lot for your help!

1 Like