How to install tensorrt inside deepstream container?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU): Jetson Orin
• DeepStream Version: nvcr.io/nvidia/deepstream:7.0-triton-multiarch
• JetPack Version (valid for Jetson only): Jetpack 6.0

Hi everyone, I’m trying to import tensorrt inside deepstream-7.0 container but I face this error:

python3 -c 'import tensorrt'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorrt'

How to install tensorrt for python inside deepstream container? I’m running on Jetson Orin.
Thank you guys very much.

I tried using apt-get install python3-libnvinfer*, but python3-libnvinfer 10.2.0.19-1+cuda12.5 is installed. But I want a specific version which is 8.6.2.3-1+cuda12.2 because my model is converted with this version. Can you guys help me please? Thank you very much.

This is an issue of docker on jetson,try the following steps.

1.start docker

sudo docker run --runtime nvidia --privileged -it --rm nvcr.io/nvidia/deepstream:7.0-triton-multiarch 

2.edit the apt source list

 vi /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
# SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.

deb https://repo.download.nvidia.com/jetson/common r36.3 main
deb https://repo.download.nvidia.com/jetson/t234 r36.3 main
deb https://repo.download.nvidia.com/jetson/ffmpeg r36.3 main
apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc
apt update
  1. install python-tensorrt
apt-get install python3-libnvinfer=8.6.2.3-1+cuda12.2

5.test

python3 -c "import tensorrt"
1 Like

Thank you very much. The problem is solved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.