Skip to content

[Feature Request] Using the cuda dlls installed with pip from official Nvidia python packages in onnxruntime-gpu  #19350

@martinResearch

Description

@martinResearch

Describe the feature request

Short Description

Enable the usage of CUDA DLLs installed via pip from the NVIDIA Python index or include the CUDA DLLs in the onnxruntime-gpu wheel when installing with pip install onnxruntime-gpu[cuda_dlls].

Problem

Installing CUDA DLLs for onnxruntime-gpu currently involves limitations such as:

  1. Mandatory user account creation on the NVIDIA website.
  2. Dependency on admin rights, restricting installation on machines without such privileges.
  3. Risk of installing incompatible CUDA versions.
  4. Inconvenience of updating CUDA_PATH when switching Python environments with different CUDA versions.

In contrast, PyTorch on Windows includes CUDA DLLs in its wheels, simplifying the installation process and reducing version mismatch risks. On Linux, PyTorch seems to use NVIDIA packages from the feed https://pypi.ngc.nvidia.com (installable with pip install nvidia-pyindex) (I did not double check this).

Possible Solutions

To streamline the installation process for onnxruntime-gpu, the following solutions could be considered:

  1. Packaged CUDA DLLs with onnxruntime-gpu Wheels:

    • Create onnxruntime-gpu wheels that include CUDA DLLs, allowing users to install them conveniently with pip install onnxruntime-gpu[cuda_dlls].
  2. Dependency Configuration via onnxruntime-gpu Wheel:

    • Create an onnxruntime-gpu wheel installable with pip install onnxruntime-gpu[cuda_dlls].
    • This wheel would list packages from the NVIDIA package index as install dependencies (e.g., nvidia-cudnn-cu12), which can be installed with pip install nvidia-pyindex followed by pip install nvidia-cudnn-cu12.
    • Configure onnxruntime to utilize these DLLs instead of those in CUDA_PATH.

The second solution may facilitate reuse of the same CUDA DLLs by other packages like CuPy or PyTorch, potentially reducing the overall size of the Python environment.

Describe scenario use case

  • allow full automation of the the cuda dlls installation
  • allow the use different cuda dlls versions in different python environment with editing CUDA_PATH

Metadata

Metadata

Assignees

No one assigned

    Labels

    ep:CUDAissues related to the CUDA execution providerfeature requestrequest for unsupported feature or enhancementplatform:windowsissues related to the Windows platform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions