Error install torch_tensorrt

Description

Unable to install tensor rt on jetson orin.

Environment

TensorRT Version:
GPU Type: JETSON ORIN
Nvidia Driver Version:
CUDA Version: 11.4.9
CUDNN Version:
Operating System + Version: UBUNTU 20.04
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable): 2.1
Baremetal or Container (if container which image + tag):

Got the following error :

(infer) jetson@jetson:~$ python3 -m pip install torch torch-tensorrt tensorrt
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Requirement already satisfied: torch in ./envs/infer/lib/python3.8/site-packages (2.1.0a0+41361538.nv23.6)
/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pypi.ngc.nvidia.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Collecting torch-tensorrt
  Downloading torch-tensorrt-0.0.0.post1.tar.gz (9.0 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/jetson/envs/infer/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-803vkxhm/torch-tensorrt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-803vkxhm/torch-tensorrt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-803vkxhm/torch-tensorrt/pip-egg-info
         cwd: /tmp/pip-install-803vkxhm/torch-tensorrt/
    Complete output (12 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-803vkxhm/torch-tensorrt/setup.py", line 125, in <module>
        raise RuntimeError(open("ERROR.txt", "r").read())
    RuntimeError:
    ###########################################################################################
    The package you are trying to install is only a placeholder project on PyPI.org repository.
    To install Torch-TensorRT please run the following command:
    
    $ pip install torch-tensorrt -f https://github.com/NVIDIA/Torch-TensorRT/releases
    ###########################################################################################
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
(infer) jetson@jetson:~$ pip install torch-tensorrt -f https://github.com/NVIDIA/Torch-TensorRT/releases
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Looking in links: https://github.com/NVIDIA/Torch-TensorRT/releases
/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/connectionpool.py:1004: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pypi.ngc.nvidia.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Collecting torch-tensorrt
  Downloading torch-tensorrt-0.0.0.post1.tar.gz (9.0 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/jetson/envs/infer/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0u_kx_xb/torch-tensorrt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0u_kx_xb/torch-tensorrt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-0u_kx_xb/torch-tensorrt/pip-egg-info
         cwd: /tmp/pip-install-0u_kx_xb/torch-tensorrt/
    Complete output (12 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-0u_kx_xb/torch-tensorrt/setup.py", line 125, in <module>
        raise RuntimeError(open("ERROR.txt", "r").read())
    RuntimeError:
    ###########################################################################################
    The package you are trying to install is only a placeholder project on PyPI.org repository.
    To install Torch-TensorRT please run the following command:
    
    $ pip install torch-tensorrt -f https://github.com/NVIDIA/Torch-TensorRT/releases
    ###########################################################################################
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
(infer) jetson@jetson:~$ 

Hi @jay.chaudhari ,
We have official document for TRT setup. Would recommend you to reach out to Jetson Orin for further assistance.

Thanks

Thank you for response.

I have followed the same documentation. I have recived following error on executing this command “python3 -m pip install --upgrade tensorrt”

(parenv) jetson@jetson:~$ python3 -m pip install --upgrade tensorrt
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting tensorrt
  Downloading tensorrt-8.6.1.post1.tar.gz (18 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: tensorrt
  Building wheel for tensorrt (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for tensorrt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [72 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'
      installing to build/bdist.linux-aarch64/wheel
      running install
      Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com, 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)
      ERROR: No matching distribution found for tensorrt_libs==8.6.1
      Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com, 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)
      ERROR: No matching distribution found for tensorrt_libs==8.6.1
      Traceback (most recent call last):
        File "<string>", line 40, in run_pip_command
        File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/home/jetson/envs/parenv/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 "/home/jetson/envs/parenv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/jetson/envs/parenv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/jetson/envs/parenv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 404, in build_wheel
          return self._build_with_temp_dir(
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 110, in <module>
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 403, in run
          self.run_command("install")
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-hznvwtzs/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 62, in run
        File "<string>", line 56, in run_pip_command
        File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/home/jetson/envs/parenv/bin/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
Failed to build tensorrt
ERROR: Could not build wheels for tensorrt, which is required to install pyproject.toml-based projects

Hi @jay.chaudhari ,
Can you please try
pip3 install --upgrade pip
pip install wheel
pip install tensorrt==8.6.1

and see if the warning is still there?

Thanks

Hey, I tried the above steps. but the error remains the same

I would recommend reaching out to Orin Forum for better support.

Thanks