-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Using the cuda dlls installed with pip from official Nvidia python packages in onnxruntime-gpu #19350
Comments
Due to some internal requirements, we are not allowed to use a second feed. |
The CUDA DLLs are so huge that they cannot be hosted at pypi. So they must be hosted at somewhere else. However, due to some security concerns we are not allowed to use a second feed. So this went to a dead end. |
I will keep this issue open, while we could continue discussing the details offline. |
Is the problem that you are you not allowed to consume packages from the external feed https://pypi.ngc.nvidia.com/ in your development environment and/or in your CI tests pipelines (github actions) for security reasons? |
In CI. |
could you possibly add https://pypi.ngc.nvidia.com/ as an upstream to the feed you are currently using? |
Azure DevOps Artifact's upstream feature doesn't support that. It only supports pypi. Correct me if I was wrong. |
Indeed it seems I cannot use https://pypi.ngc.nvidia.com/ as an upstream in Azure Devops. Here is a list of package on pypi.org that allowed me to get all the dlls I needed to use onnxruntime-gpu (some might actually not be required) nvidia-nvjitlink-cu12 so for cuda 12 it seems we could potentially get onnxruntime-gpu to use the dlls from these packages. |
Are they real? The file size of nvidia-cuda-runtime-cu12 is less than 1MB. |
I think so. The whl file contains the cudart64_12.dll that is about 540KB, which is about the same as the dll we can get from the official cuda toolkit installer |
But the cudnn files looks wired. The latest one(9.0) only has binaries for ARM64, while a previous version(8.9) only has binaries for Windows/Linux x64. And we don't know if the ARM one is for sbsa or jetson. |
@snnn These cudnn wheels look reasonable to me: https://pypi.org/project/nvidia-cudnn-cu12/#files |
Now it is good. Thanks! |
Sorry the work has not been started. |
The first solution is not available to us
Because these DLLs are large and we are very tight on space. We can try the second one.
|
@martinResearch Do you know if |
I don't know. Is it required for onnxruntime-gpu? it is not not in the python environment I use to run onnxruntime-gpu. You have in libcudart.so.12 in https://files.pythonhosted.org/packages/f0/62/65c05e161eeddbafeca24dc461f47de550d9fa8a7e04eb213e32b55cfd99/nvidia_cuda_runtime_cu12-12.6.77-py3-none-manylinux2014_x86_64.whl |
|
When installing the packages |
A similar effort is planned in the cupy repository cupy/cupy#8013. It might provide some valuable information on how to proceed. |
Would you mind explaining more on this part? Do we need to manually preload the libraries, or we just need to setup some paths(like https://docs.python.org/3/library/os.html#os.add_dll_directory) |
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:
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:
Packaged CUDA DLLs with onnxruntime-gpu Wheels:
pip install onnxruntime-gpu[cuda_dlls]
.Dependency Configuration via onnxruntime-gpu Wheel:
pip install onnxruntime-gpu[cuda_dlls]
.nvidia-cudnn-cu12
), which can be installed withpip install nvidia-pyindex
followed bypip install nvidia-cudnn-cu12
.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
The text was updated successfully, but these errors were encountered: