cumulo-autumn / StreamDiffusion

StreamDiffusion: A Pipeline-Level Solution for Real-Time Interactive Generation
Apache License 2.0
9.47k stars 674 forks source link

error installing tensorrt extension package 9.0.1.post11.dev4 #123

Open tomsepe opened 7 months ago

tomsepe commented 7 months ago

installation error when running the following command:

python -m streamdiffusion.tools.install-tensorrt

(note: I am installing on windows 11, not linux)

The pypi project page: https://pypi.org/project/tensorrt/9.0.1.post11.dev4/ states this warning:

WARNING: This project is not functional and is a placeholder from NVIDIA. To install, please execute the following: pip install --no-cache-dir --extra-index-url https://pypi.nvidia.com tensorrt

full error below:

"C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\Scripts\python.exe" -m pip install --pre --extra-index-url https://pypi.nvidia.com tensorrt==9.0.1.post11.dev4 --no-cache-dir Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com, https://pypi.nvidia.comCollecting tensorrt==9.0.1.post11.dev4 Downloading https://pypi.nvidia.com/tensorrt/tensorrt-9.0.1.post11.dev4.tar.gz (18 kB) Preparing metadata (setup.py) ... done Installing collected packages: tensorrt DEPRECATION: tensorrt is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 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 ╰─> [171 lines of output] C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-packages\setuptools\installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. warnings.warn( WARNING: The wheel package is not available. running install C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-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: https://pypi.org/simple, https://pypi.ngc.nvidia.com, https://pypi.nvidia.com Collecting tensorrt_libs==9.0.1.post11.dev4 Downloading https://pypi.nvidia.com/tensorrt-libs/tensorrt_libs-9.0.1.post11.dev4-py2.py3-none-win_amd64.whl (1029.8 MB) ---------------------------------------- 1.0/1.0 GB 24.2 MB/s eta 0:00:00 Collecting tensorrt_bindings==9.0.1.post11.dev4 Downloading https://pypi.nvidia.com/tensorrt-bindings/tensorrt_bindings-9.0.1.post11.dev4-cp310-none-win_amd64.whl (708 kB) ------------------------------------- 708.4/708.4 kB 43.6 MB/s eta 0:00:00 Collecting nvidia-cudnn-cu11 Downloading https://developer.download.nvidia.com/compute/redist/nvidia-cudnn-cu11/nvidia-cudnn-cu11-2022.5.19.tar.gz (16 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting nvidia-cublas-cu11 Downloading https://developer.download.nvidia.com/compute/redist/nvidia-cublas-cu11/nvidia-cublas-cu11-2022.4.8.tar.gz (16 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting nvidia-cuda-runtime-cu11 Downloading https://developer.download.nvidia.com/compute/redist/nvidia-cuda-runtime-cu11/nvidia-cuda-runtime-cu11-2022.4.25.tar.gz (16 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting nvidia-cublas-cu117 Downloading https://pypi.nvidia.com/nvidia-cublas-cu117/nvidia_cublas_cu117-11.10.1.25-py3-none-win_amd64.whl (315.0 MB) ------------------------------------- 315.0/315.0 MB 24.2 MB/s eta 0:00:00 Collecting nvidia-cuda-runtime-cu117 Downloading https://pypi.nvidia.com/nvidia-cuda-runtime-cu117/nvidia_cuda_runtime_cu117-11.7.60-py3-none-win_amd64.whl (991 kB) ------------------------------------- 991.4/991.4 kB 20.9 MB/s eta 0:00:00 Collecting nvidia-cudnn-cu116 Downloading nvidia-cudnn-cu116-0.0.1.dev5.tar.gz (4.4 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'error' error: subprocess-exited-with-error

    python setup.py egg_info did not run successfully.
    exit code: 1

    [17 lines of output]
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "C:\Users\tsepe\AppData\Local\Temp\pip-install-jj_vv_hx\nvidia-cudnn-cu116_423b88aa539c498a8aae4f6b1ae0503b\setup.py", line 152, 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.
    This package is hosted on NVIDIA Python Package Index.

    This package can be installed as:
    ```
    $ pip install nvidia-pyindex
    $ pip install nvidia-cudnn-cu116
    ```
    ###########################################################################################

    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed

  Encountered error while generating package metadata.

  See above for output.

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

  [notice] A new release of pip is available: 23.0.1 -> 24.0
  [notice] To update, run: python.exe -m pip install --upgrade pip
  Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com, https://pypi.nvidia.com
  Collecting tensorrt_libs==9.0.1.post11.dev4
    Downloading https://pypi.nvidia.com/tensorrt-libs/tensorrt_libs-9.0.1.post11.dev4-py2.py3-none-win_amd64.whl (1029.8 MB)
       ---------------------------------------- 1.0/1.0 GB 26.1 MB/s eta 0:00:00
  Collecting tensorrt_bindings==9.0.1.post11.dev4
    Downloading https://pypi.nvidia.com/tensorrt-bindings/tensorrt_bindings-9.0.1.post11.dev4-cp310-none-win_amd64.whl (708 kB)
       ------------------------------------- 708.4/708.4 kB 21.8 MB/s eta 0:00:00
  Collecting nvidia-cublas-cu11
    Downloading https://developer.download.nvidia.com/compute/redist/nvidia-cublas-cu11/nvidia-cublas-cu11-2022.4.8.tar.gz (16 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'done'
  Collecting nvidia-cudnn-cu11
    Downloading https://developer.download.nvidia.com/compute/redist/nvidia-cudnn-cu11/nvidia-cudnn-cu11-2022.5.19.tar.gz (16 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'done'
  Collecting nvidia-cuda-runtime-cu11
    Downloading https://developer.download.nvidia.com/compute/redist/nvidia-cuda-runtime-cu11/nvidia-cuda-runtime-cu11-2022.4.25.tar.gz (16 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'done'
  Collecting nvidia-cublas-cu117
    Downloading https://pypi.nvidia.com/nvidia-cublas-cu117/nvidia_cublas_cu117-11.10.1.25-py3-none-win_amd64.whl (315.0 MB)
       ------------------------------------- 315.0/315.0 MB 27.3 MB/s eta 0:00:00
  Collecting nvidia-cuda-runtime-cu117
    Downloading https://pypi.nvidia.com/nvidia-cuda-runtime-cu117/nvidia_cuda_runtime_cu117-11.7.60-py3-none-win_amd64.whl (991 kB)
       ------------------------------------- 991.4/991.4 kB 30.7 MB/s eta 0:00:00
  Collecting nvidia-cudnn-cu116
    Downloading nvidia-cudnn-cu116-0.0.1.dev5.tar.gz (4.4 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    error: subprocess-exited-with-error

    python setup.py egg_info did not run successfully.
    exit code: 1

    [17 lines of output]
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "C:\Users\tsepe\AppData\Local\Temp\pip-install-lttowf2h\nvidia-cudnn-cu116_589c206db94b49f7b02c6bb3c253e617\setup.py", line 152, 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.
    This package is hosted on NVIDIA Python Package Index.

    This package can be installed as:
    ```
    $ pip install nvidia-pyindex
    $ pip install nvidia-cudnn-cu116
    ```
    ###########################################################################################

    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed

  Encountered error while generating package metadata.

  See above for output.

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

  [notice] A new release of pip is available: 23.0.1 -> 24.0
  [notice] To update, run: python.exe -m pip install --upgrade pip
  Traceback (most recent call last):
    File "C:\Users\tsepe\AppData\Local\Temp\pip-install-3f9w90j2\tensorrt_57af7e9df70849e5bcf837ea6f016f79\setup.py", line 41, in run_pip_command
      return call_func([sys.executable, "-m", "pip"] + args, env=env)
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:\\Users\\tsepe\\Documents\\StreamDiffusionProject\\StreamDiffusion\\.venv\\Scripts\\python.exe', '-m', 'pip', 'install', '--extra-index-url', 'https://pypi.nvidia.com', 'tensorrt_libs==9.0.1.post11.dev4', 'tensorrt_bindings==9.0.1.post11.dev4']' 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 "C:\Users\tsepe\AppData\Local\Temp\pip-install-3f9w90j2\tensorrt_57af7e9df70849e5bcf837ea6f016f79\setup.py", line 120, in <module>
      setup(
    File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion\.venv\lib\site-packages\setuptools\__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion\.venv\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion\.venv\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion\.venv\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion\.venv\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion\.venv\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\Users\tsepe\AppData\Local\Temp\pip-install-3f9w90j2\tensorrt_57af7e9df70849e5bcf837ea6f016f79\setup.py", line 72, in run
      run_pip_command(
    File "C:\Users\tsepe\AppData\Local\Temp\pip-install-3f9w90j2\tensorrt_57af7e9df70849e5bcf837ea6f016f79\setup.py", line 57, in run_pip_command
      return call_func([pip_path] + args, env=env)
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:\\Users\\tsepe\\Documents\\StreamDiffusionProject\\StreamDiffusion\\.venv\\Scripts\\pip.exe', 'install', '--extra-index-url', 'https://pypi.nvidia.com', 'tensorrt_libs==9.0.1.post11.dev4', 'tensorrt_bindings==9.0.1.post11.dev4']' 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.

[notice] A new release of pip is available: 23.0.1 -> 24.0 [notice] To update, run: python.exe -m pip install --upgrade pip Error running command: -m pip install --pre --extra-index-url https://pypi.nvidia.com tensorrt==9.0.1.post11.dev4 --no-cache-dir Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-packages\streamdiffusion\tools\install-tensorrt.py", line 54, in fire.Fire(install) File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-packages\fire-0.5.0-py3.10.egg\fire\core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-packages\fire-0.5.0-py3.10.egg\fire\core.py", line 475, in _Fire component, remaining_args = _CallAndUpdateTrace( File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-packages\fire-0.5.0-py3.10.egg\fire\core.py", line 691, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-packages\streamdiffusion\tools\install-tensorrt.py", line 33, in install run_pip( File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-packages\streamdiffusion\pip_utils.py", line 52, in run_pip return run_python(f"-m pip {command}", env) File "C:\Users\tsepe\Documents\StreamDiffusionProject\StreamDiffusion.venv\lib\site-packages\streamdiffusion\pip_utils.py", line 46, in run_python raise RuntimeError(f"Error running command: {command}") RuntimeError: Error running command: -m pip install --pre --extra-index-url https://pypi.nvidia.com tensorrt==9.0.1.post11.dev4 --no-cache-dir

AtomicNixon commented 5 months ago

This did the trick for me. Upgrade Pip, wheel, tools etc. python3 -m pip install --upgrade pip python3 -m pip install wheel Install the TensorRT Python wheel. python3 -m pip install --pre --upgrade tensorrt

mikecarnohan commented 3 months ago

This did the trick for me. Upgrade Pip, wheel, tools etc. python3 -m pip install --upgrade pip python3 -m pip install wheel Install the TensorRT Python wheel. python3 -m pip install --pre --upgrade tensorrt

Be careful running:

python3 -m pip install --pre --upgrade tensorrt

If you are using the CUDA 11.8 tools, it may push you to TensorRT that only works with 12.X.

A better install path for 11.8 users is:

Activate .venv

cd streamdiffusion\.venv
scripts\activate.bat

Then run:

python -m pip install tensorrt-cu11
AtomicNixon commented 3 months ago

cd streamdiffusion.venv scripts\activate.bat

Oh yes, always.