Pip install tensorrt installation error in deepstream-6.4 triton multiarch conteyner with Jetson orin nx

Description

When I trying to install tensorrt python package in nvcr.io/nvidia/deepstream-l4t:6.4-triton-multiarch or nvcr.io/nvidia/deepstream:6.4-triton-multiarch (same images) the setup fails and gives the error below:

Environment

Jetson Orin Nx 16 Gb
nvcr.io/nvidia/deepstream-l4t:6.4-triton-multiarch :
TAG=gmc1",
“PLATFORM=jetson”,
“DS_REL_PKG=deepstream_sdk_v6.4.0_jetson.tbz2”,
“DS_REL_PKG_DIR=deepstream_sdk_v6.4.0_jetson”,
“DS_VERSION=6.4.0”,
“PATH=/usr/local/mpi/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ucx/bin”,
“CUDA_VERSION=12.2.12.005”,
“CUDA_DRIVER_VERSION=535.104.05”,
“CUDA_CACHE_DISABLE=1”,
“NVIDIA_REQUIRE_JETPACK_HOST_MOUNTS=base-only”,
“_CUDA_COMPAT_PATH=/usr/local/cuda/compat”,
“ENV=/etc/shinit_v2”,
“BASH_ENV=/etc/bash.bashrc”,
“SHELL=/bin/bash”,
“NVIDIA_REQUIRE_CUDA=cuda>=9.0”,
“NCCL_VERSION=2.18.5”,
“CUBLAS_VERSION=12.2.5.6”,
“CUFFT_VERSION=11.0.8.103”,
“CURAND_VERSION=10.3.3.141”,
“CUSPARSE_VERSION=12.1.2.141”,
“CUSOLVER_VERSION=11.5.2.141”,
“CUTENSOR_VERSION=”,
“NPP_VERSION=12.2.1.4”,
“NVJPEG_VERSION=12.2.12.005”,
“CUDNN_VERSION=8.9.4.25”,
“TRT_VERSION=8.6.2.3”,
“TRTOSS_VERSION=23.08”,
“NSIGHT_SYSTEMS_VERSION=12.2.12.005”,
“NSIGHT_COMPUTE_VERSION=12.2.12.005”,
“DALI_VERSION=”,
“DALI_BUILD=”,
“POLYGRAPHY_VERSION=”,
“TRANSFORMER_ENGINE_VERSION=”,
“LD_LIBRARY_PATH=/opt/tritonserver/lib:/usr/local/cuda-12.2/lib64”,
“NVIDIA_VISIBLE_DEVICES=all”,
“NVIDIA_DRIVER_CAPABILITIES=all”,
“NVIDIA_PRODUCT_NAME=Triton Inference Server”,
“GDRCOPY_VERSION=2.3”,
“HPCX_VERSION=2.16rc4”,
“MOFED_VERSION=5.4-rdmacore39.0”,
“OPENUCX_VERSION=1.15.0”,
“OPENMPI_VERSION=4.1.5rc2”,
“RDMACORE_VERSION=39.0”,
“OPAL_PREFIX=/opt/hpcx/ompi”,
“OMPI_MCA_coll_hcoll_enable=0”,
“LIBRARY_PATH=/usr/local/cuda/lib64/stubs:”,
“DEBIAN_FRONTEND=noninteractive”,

Relevant Files

nvcr.io/nvidia/deepstream-l4t:6.4-triton-multiarch

Steps To Reproduce

pip install tensorrt

Error

desktop:/opt/nvidia/deepstream/deepstream-6.4# pip install tensorrt
Collecting tensorrt
Downloading tensorrt-8.6.1.post1.tar.gz (18 kB)
Preparing metadata (setup.py) … done
Building wheels for collected packages: tensorrt
Building wheel for tensorrt (setup.py) … error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [66 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/tensorrt
copying tensorrt/init.py → build/lib/tensorrt
running egg_info
writing tensorrt.egg-info/PKG-INFO
writing dependency_links to tensorrt.egg-info/dependency_links.txt
writing requirements to tensorrt.egg-info/requires.txt
writing top-level names to tensorrt.egg-info/top_level.txt
reading manifest file ‘tensorrt.egg-info/SOURCES.txt’
adding license file ‘LICENSE.txt’
writing manifest file ‘tensorrt.egg-info/SOURCES.txt’
/usr/local/lib/python3.10/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
installing to build/bdist.linux-aarch64/wheel
running install
Looking in indexes: Simple index, https://pypi.nvidia.com
ERROR: Could not find a version that satisfies the requirement tensorrt_libs==8.6.1 (from versions: 9.0.0.post11.dev1, 9.0.0.post12.dev1, 9.0.1.post11.dev4, 9.0.1.post12.dev4, 9.1.0.post11.dev4, 9.1.0.post12.dev4, 9.2.0.post11.dev5, 9.2.0.post12.dev5, 9.3.0.post11.dev1, 9.3.0.post12.dev1)
ERROR: No matching distribution found for tensorrt_libs==8.6.1
Looking in indexes: Simple index, https://pypi.nvidia.com
ERROR: Could not find a version that satisfies the requirement tensorrt_libs==8.6.1 (from versions: 9.0.0.post11.dev1, 9.0.0.post12.dev1, 9.0.1.post11.dev4, 9.0.1.post12.dev4, 9.1.0.post11.dev4, 9.1.0.post12.dev4, 9.2.0.post11.dev5, 9.2.0.post12.dev5, 9.3.0.post11.dev1, 9.3.0.post12.dev1)
ERROR: No matching distribution found for tensorrt_libs==8.6.1
Traceback (most recent call last):
File “/tmp/pip-install-fioet0ib/tensorrt_8fd2b17eed434c13addae8d9545aa222/setup.py”, line 40, in run_pip_command
return call_func([sys.executable, “-m”, “pip”] + args, env=env)
File “/usr/lib/python3.10/subprocess.py”, line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[’/usr/bin/python3’, ‘-m’, ‘pip’, ‘install’, ‘–extra-index-url’, ‘https://pypi.nvidia.com’, ‘tensorrt_libs==8.6.1’, ‘tensorrt_bindings==8.6.1’]’ returned non-zero exit status 1.

  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-fioet0ib/tensorrt_8fd2b17eed434c13addae8d9545aa222/setup.py", line 110, in <module>
      setup(
    File "/usr/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 335, in run
      self.run_command('install')
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py", line 319, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-fioet0ib/tensorrt_8fd2b17eed434c13addae8d9545aa222/setup.py", line 62, in run
      run_pip_command(
    File "/tmp/pip-install-fioet0ib/tensorrt_8fd2b17eed434c13addae8d9545aa222/setup.py", line 56, in run_pip_command
      return call_func([pip_path] + args, env=env)
    File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/usr/bin/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/pip', 'install', '--extra-index-url', 'https://pypi.nvidia.com', 'tensorrt_libs==8.6.1', 'tensorrt_bindings==8.6.1']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for tensorrt
Running setup.py clean for tensorrt
Failed to build tensorrt
Installing collected packages: tensorrt
Running setup.py install for tensorrt … error
error: subprocess-exited-with-error

× Running setup.py install for tensorrt did not run successfully.
│ exit code: 1
╰─> [42 lines of output]
running install
/usr/local/lib/python3.10/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
Looking in indexes: Simple index, https://pypi.nvidia.com
ERROR: Could not find a version that satisfies the requirement tensorrt_libs==8.6.1 (from versions: 9.0.0.post11.dev1, 9.0.0.post12.dev1, 9.0.1.post11.dev4, 9.0.1.post12.dev4, 9.1.0.post11.dev4, 9.1.0.post12.dev4, 9.2.0.post11.dev5, 9.2.0.post12.dev5, 9.3.0.post11.dev1, 9.3.0.post12.dev1)
ERROR: No matching distribution found for tensorrt_libs==8.6.1
Looking in indexes: Simple index, https://pypi.nvidia.com
ERROR: Could not find a version that satisfies the requirement tensorrt_libs==8.6.1 (from versions: 9.0.0.post11.dev1, 9.0.0.post12.dev1, 9.0.1.post11.dev4, 9.0.1.post12.dev4, 9.1.0.post11.dev4, 9.1.0.post12.dev4, 9.2.0.post11.dev5, 9.2.0.post12.dev5, 9.3.0.post11.dev1, 9.3.0.post12.dev1)
ERROR: No matching distribution found for tensorrt_libs==8.6.1
Traceback (most recent call last):
File “/tmp/pip-install-fioet0ib/tensorrt_8fd2b17eed434c13addae8d9545aa222/setup.py”, line 40, in run_pip_command
return call_func([sys.executable, “-m”, “pip”] + args, env=env)
File “/usr/lib/python3.10/subprocess.py”, line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[’/usr/bin/python3’, ‘-m’, ‘pip’, ‘install’, ‘–extra-index-url’, ‘https://pypi.nvidia.com’, ‘tensorrt_libs==8.6.1’, ‘tensorrt_bindings==8.6.1’]’ returned non-zero exit status 1.

  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-fioet0ib/tensorrt_8fd2b17eed434c13addae8d9545aa222/setup.py", line 110, in <module>
      setup(
    File "/usr/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-fioet0ib/tensorrt_8fd2b17eed434c13addae8d9545aa222/setup.py", line 62, in run
      run_pip_command(
    File "/tmp/pip-install-fioet0ib/tensorrt_8fd2b17eed434c13addae8d9545aa222/setup.py", line 56, in run_pip_command
      return call_func([pip_path] + args, env=env)
    File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/usr/bin/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/pip', 'install', '--extra-index-url', 'https://pypi.nvidia.com', 'tensorrt_libs==8.6.1', 'tensorrt_bindings==8.6.1']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> tensorrt

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.