Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 21, 2025

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_HOME instead of requiring manual LIBRARY_PATH environment variable setup.

Problem

Previously, both CUDA_HOME (or CUDA_PATH) and LIBRARY_PATH were required to be set in the environment during installation. While there was already a check for CUDA_HOME in setup.py, there was no check for LIBRARY_PATH. When LIBRARY_PATH was not set, the installation would fail at link time with an error indicating that cudart_static could not be found.

Solution

This backport makes two key changes:

  1. Remove manual environment variable setup from CI workflow (.github/workflows/build-wheel.yml):

    • Removed LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib from Linux environment
    • Removed LIB="${CUDA_HOME}\\lib\\x64;${LIB}" from Windows environment
  2. Add automatic CUDA library path detection (cuda_bindings/setup.py):

    • Automatically detects and adds CUDA library directories based on CUDA_HOME
    • For Linux: searches lib64 and lib subdirectories
    • For Windows: searches lib\x64 subdirectory
    • Uses the pattern: library_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:

  • Eliminating the need for users to manually set LIBRARY_PATH environment variables
  • Automatically finding CUDA libraries in standard locations based on CUDA_HOME
  • Reducing installation failures due to missing library path configuration

The 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.

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Aug 21, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
Copilot AI changed the title [WIP] Please try again resolving this issue. We need to backport NVIDIA/cuda-python#837 to the 12.9.x branch. Backport PR #837: Add path for CUDA static library based on CUDA_HOME Aug 21, 2025
Copilot AI requested a review from leofang August 21, 2025 14:16
Copilot finished work on behalf of leofang August 21, 2025 14:16
@leofang leofang added this to the cuda-python parking lot milestone Aug 21, 2025
@leofang leofang requested a review from Andy-Jost August 21, 2025 14:21
@leofang leofang added enhancement Any code-related improvements P1 Medium priority - Should do cuda.bindings Everything related to the cuda.bindings module labels Aug 21, 2025
@leofang leofang marked this pull request as ready for review August 21, 2025 14:22
@leofang leofang linked an issue Aug 21, 2025 that may be closed by this pull request
@leofang
Copy link
Member

leofang commented Aug 21, 2025

/ok to test ccc8b08

@github-project-automation github-project-automation bot moved this from Todo to In Review in CCCL Aug 21, 2025
@Andy-Jost Andy-Jost merged commit 48834d2 into 12.9.x Aug 21, 2025
42 checks passed
@Andy-Jost Andy-Jost deleted the copilot/fix-21f2f756-b6f8-4159-96bc-85a8c5353e08 branch August 21, 2025 15:31
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module enhancement Any code-related improvements P1 Medium priority - Should do

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

MNT: Backport PR 837

3 participants