From b400e345b141183d2c1d54b2e69ef14400c162c7 Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Thu, 14 Aug 2025 11:21:05 -0700 Subject: [PATCH 1/3] Adds paths for the CUDA static library based on CUDA_HOME (#608). --- cuda_bindings/setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 4ba357602c..31dace089c 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -31,6 +31,7 @@ raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set") CUDA_HOME = CUDA_HOME.split(os.pathsep) + if os.environ.get("PARALLEL_LEVEL") is not None: warn( "Environment variable PARALLEL_LEVEL is deprecated. Use CUDA_PYTHON_PARALLEL_LEVEL instead", @@ -238,6 +239,8 @@ def generate_output(infile, local): os.path.dirname(sysconfig.get_path("include")), ] + include_path_list library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")] +cudalib_subdir = r"lib\x64" if sys.platform == "win32" else "lib64" +library_dirs.extend(os.path.join(prefix, cudalib_subdir) for prefix in CUDA_HOME) extra_compile_args = [] extra_cythonize_kwargs = {} From 82dcb0646811e6676a548d9e775bb1ab78b4dc3f Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Tue, 19 Aug 2025 11:01:04 -0700 Subject: [PATCH 2/3] Removes LIB and LIBRARY_PATH environment variables from the build-wheel workflow. --- .github/workflows/build-wheel.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 20995f2cbf..803a70cbd6 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -157,11 +157,9 @@ jobs: # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} - LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" - LIB="${CUDA_HOME}\\lib\\x64;${LIB}" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}" From 73acddff5ecc5e7dded038aa79f474cc0ae9bf83 Mon Sep 17 00:00:00 2001 From: Andy Jost Date: Tue, 19 Aug 2025 11:18:16 -0700 Subject: [PATCH 3/3] Updates Linux install to search both lib and lib64 directories for CUDA libraries. --- cuda_bindings/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 31dace089c..8ebd68a752 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -239,8 +239,8 @@ def generate_output(infile, local): os.path.dirname(sysconfig.get_path("include")), ] + include_path_list library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")] -cudalib_subdir = r"lib\x64" if sys.platform == "win32" else "lib64" -library_dirs.extend(os.path.join(prefix, cudalib_subdir) for prefix in CUDA_HOME) +cudalib_subdirs = [r"lib\x64"] if sys.platform == "win32" else ["lib64", "lib"] +library_dirs.extend(os.path.join(prefix, subdir) for prefix in CUDA_HOME for subdir in cudalib_subdirs) extra_compile_args = [] extra_cythonize_kwargs = {}