Fix CUDA/cuDNN DLL preload paths for CUDA 13 consolidated wheel layout#29202
Open
tianleiwu wants to merge 1 commit into
Open
Fix CUDA/cuDNN DLL preload paths for CUDA 13 consolidated wheel layout#29202tianleiwu wants to merge 1 commit into
tianleiwu wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix #29198.
NVIDIA restructured the CUDA Python wheels starting with CUDA 13: the per-component CUDA Toolkit packages (cublas, cufft, cuda_runtime, cuda_nvrtc, curand, ...) were consolidated into a single
nvidia/cu{major}package and the-cuNNsuffix was dropped from those package names. This PR updates the DLL/shared-library preload logic and the wheel dependency metadata soonnxruntime-gpu(andonnxruntime-trt-rtx) keep working on both the legacy CUDA 12 layout and the new CUDA 13 consolidated layout.Summary of Changes
Preload logic (
onnxruntime/__init__.py)onnxruntime/__init__.py_get_nvidia_dll_pathsnow detects the CUDA 13+ consolidated layout and resolves CUDA libraries undernvidia/cu{major}— Windows uses an architecture sub-folder (bin/<arch>, e.g.bin/x86_64), Linux uses a flatlib. The legacy CUDA 12 per-component paths are preserved.onnxruntime/__init__.pybuild_cuda_versionandarchparameters (for testability/arch override); cuDNN paths factored out since cuDNN keeps its ownnvidia/cudnnpackage layout in both schemes.onnxruntime/__init__.pyprint_debug_infodrops the-cuNNsuffix from CUDA Toolkit package names for CUDA 13+ (cuDNN keeps its suffixed name).Wheel dependency metadata (
setup.py)setup.pyonnxruntime-gpucudaextras drop the-cuNNsuffix for CUDA 13+ (nvidia-cuda-nvrtc,nvidia-cuda-runtime,nvidia-cufft,nvidia-curand); cuDNN dependency keeps the suffixed name.setup.pyonnxruntime-trt-rtxCUDA Runtime dependency drops the-cuNNsuffix for CUDA 13+.Tests (
onnxruntime/test/python/onnxruntime_test_python_preload_dlls.py)liblayout, the unchanged cuDNN layout, and thecuda/cudnntoggles.Testing
python -m pytest onnxruntime/test/python/onnxruntime_test_python_preload_dlls.py(orpython -m unittest onnxruntime.test.python.onnxruntime_test_python_preload_dlls).Checklist