Backport PR #837: Add path for CUDA static library based on CUDA_HOME #878
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.
This PR backports the changes from PR #837 to the 12.9.x branch to improve the installation process by automatically detecting CUDA library paths based on
CUDA_HOMEinstead of requiring manualLIBRARY_PATHenvironment variable setup.Problem
Previously, both
CUDA_HOME(orCUDA_PATH) andLIBRARY_PATHwere required to be set in the environment during installation. While there was already a check forCUDA_HOMEin setup.py, there was no check forLIBRARY_PATH. WhenLIBRARY_PATHwas not set, the installation would fail at link time with an error indicating thatcudart_staticcould not be found.Solution
This backport makes two key changes:
Remove manual environment variable setup from CI workflow (
.github/workflows/build-wheel.yml):LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/libfrom Linux environmentLIB="${CUDA_HOME}\\lib\\x64;${LIB}"from Windows environmentAdd automatic CUDA library path detection (
cuda_bindings/setup.py):CUDA_HOMElib64andlibsubdirectorieslib\x64subdirectorylibrary_dirs.extend(os.path.join(prefix, subdir) for prefix in CUDA_HOME for subdir in cudalib_subdirs)Impact
This change makes the installation process more robust and user-friendly by:
LIBRARY_PATHenvironment variablesCUDA_HOMEThe backport maintains full compatibility with existing installations while improving the experience for new users.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.