NVIDIA / TensorRT

NVIDIA® TensorRT™ is an SDK for high-performance deep learning inference on NVIDIA GPUs. This repository contains the open source components of TensorRT.
https://developer.nvidia.com/tensorrt
Apache License 2.0
10.48k stars 2.1k forks source link

Poetry install failure of TensorRT 9.3.0.post12.dev1 when installing on Windows #3864

Open araza008 opened 3 months ago

araza008 commented 3 months ago

Description

I came across this error when installing tensorrt_llm==0.9.0 using poetry on windows. I referred to issue#3050 which described the same failure but was resolved by individually adding modules using poetry. The same steps fail on windows when installing as the dependency manager is unable to find a suitable installation candidate for nvidia-cudnn-cu12. With torch=2.2.0+cu121 already installed, running the following command: poetry add --source pyindex-nvidia tensorrt-libs==9.3.0.post12.dev1 raises an error: `Package operations: 3 installs, 0 updates, 0 removals

Cannot install nvidia-cudnn-cu12.`

As far as I looked, there is no nvidia-cuda-cu12(8.9.2.26) for windows platform on nvidia and pytorch indexes.

Environment

TensorRT Version: 9.3.0.post12.dev1

NVIDIA GPU: RTX 4090

NVIDIA Driver Version: 551.52

CUDA Version: V12.2.140

CUDNN Version:

Operating System: Windows OS Build 27552

Python Version (if applicable): 3.10.11

Tensorflow Version (if applicable):

PyTorch Version (if applicable): 2.2.0+cu121

Baremetal or Container (if so, version):

Steps To Reproduce

poetry source add --priority=explicit pytorch-gpu-src https://download.pytorch.org/whl/cu121
poetry add --source pytorch-gpu-src torch==2.2.0+cu121
poetry source add --priority=explicit pyindex-nvidia https://pypi.nvidia.com
poetry add --source pyindex-nvidia tensorrt-libs==9.3.0.post12.dev1
zeroepoch commented 3 months ago

Using the command pip install --extra-index-url https://download.pytorch.org/whl/cu121 torch==2.2.0+cu121 on Linux (I know not Windows) I see as a dependency it installs nvidia-cudnn-cu12==8.9.2.26. This looks like a direct dependency of torch. Since we don't have a Windows build of cuDNN 8.9.2.26 available I'm not sure how this particular version of Torch would be installable on Windows.

I checked the METADATA file and it shows a platform specific condition (Linux x86)

$ grep nvidia-cudnn torch-2.2.0+cu121.dist-info/METADATA 
Requires-Dist: nvidia-cudnn-cu12 (==8.9.2.26) ; platform_system == "Linux" and platform_machine == "x86_64"

I'm not too familiar with Torch's dependencies, but I'm wondering if on Windows they are expecting you to install these libraries manually. Is Poetry maybe disregarding these platform hints?

I will need to repeat this on a Windows machine when I get an opportunity but wanted to provide some debug information to get started.

araza008 commented 2 months ago

Hi @zeroepoch. Were you able to repro the issue on Windows platform? When is this expected to be resolved?

zeroepoch commented 2 months ago

@araza008 the solution to this issue is to not use Poetry. PyTorch is essentially not compatible with Poetry on Windows from what I can see. Since it doesn't consider the platform conditions in the requirements there doesn't appear to be a way to resolve the issue.