-
Notifications
You must be signed in to change notification settings - Fork 61
Locate nvvm, libdevice, nvrtc, and cudart from nvidia-*-cu12 wheels #155
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
Changes from 9 commits
b8238f9
9c56e55
886b9b0
7ffef77
fcedb13
151e565
b4ededf
4f2bc2b
5f4ed8f
d4bf113
443e998
1b436c6
532d864
59bb493
f5dbee6
43c3ec2
6a68eb8
3dbd42d
3f4ca51
3e8651c
2364278
42af9ad
8cf66d0
4f686e9
1e3f9a6
3d65c3d
78cebea
4e8f73f
00bb4da
5cebb44
c14644a
9b3bad9
51f7694
8cc37d7
d5b68a9
dfe25c8
9fc2531
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/bin/bash | ||
| # Copyright (c) 2023-2024, NVIDIA CORPORATION | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| rapids-logger "Install testing dependencies" | ||
| # TODO: Replace with rapids-dependency-file-generator | ||
| python -m pip install \ | ||
| psutil \ | ||
| cffi \ | ||
| cuda-python \ | ||
| nvidia-curand-cu12 \ | ||
| nvidia-cuda-nvcc-cu12 \ | ||
| pytest | ||
|
|
||
|
|
||
| rapids-logger "Build tests" | ||
| PY_SCRIPT=" | ||
| import numba_cuda | ||
| root = numba_cuda.__file__.rstrip('__init__.py') | ||
| test_dir = root + \"numba/cuda/tests/test_binary_generation/\" | ||
| print(test_dir) | ||
| " | ||
|
|
||
| NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") | ||
| pushd $NUMBA_CUDA_TEST_BIN_DIR | ||
| make | ||
| popd | ||
|
|
||
| rapids-logger "Install wheel" | ||
| package=$(realpath wheel/numba_cuda*.whl) | ||
| echo "Package path: $package" | ||
| python -m pip install $package | ||
|
|
||
| rapids-logger "Check GPU usage" | ||
| nvidia-smi | ||
|
|
||
| RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/ | ||
| mkdir -p "${RAPIDS_TESTS_DIR}" | ||
| pushd "${RAPIDS_TESTS_DIR}" | ||
|
|
||
| rapids-logger "Show Numba system info" | ||
| python -m numba --sysinfo | ||
|
|
||
| # remove cuda-nvvm-12-5 leaving libnvvm.so from nvidia-cuda-nvcc-cu12 only | ||
| apt-get update | ||
| apt remove --purge cuda-nvvm-12-5 -y | ||
|
||
|
|
||
| rapids-logger "Run Tests" | ||
| NUMBA_CUDA_TEST_BIN_DIR=$NUMBA_CUDA_TEST_BIN_DIR python -m numba.runtests numba.cuda.tests -v | ||
|
|
||
| popd | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following changes lead to success on Windows: diff --git a/numba_cuda/numba/cuda/cuda_paths.py b/numba_cuda/numba/cuda/cuda_paths.py
index 9b38a86..bc3822a 100644
--- a/numba_cuda/numba/cuda/cuda_paths.py
+++ b/numba_cuda/numba/cuda/cuda_paths.py
@@ -224,8 +224,9 @@ def _cuda_home_static_cudalib_path():
def _get_cudalib_wheel():
"""Get the cudalib path from the NVCC wheel."""
site_paths = [site.getusersitepackages()] + site.getsitepackages()
+ libdir = IS_LINUX and "lib" or "bin"
for sp in filter(None, site_paths):
- cudalib_path = Path(sp, "nvidia", "cuda_runtime", "lib")
+ cudalib_path = Path(sp, "nvidia", "cuda_runtime", libdir)
if cudalib_path.exists():
return str(cudalib_path)
return None
@@ -373,8 +374,20 @@ def get_cuda_home(*subdirs):
def _get_nvvm_path():
by, path = _get_nvvm_path_decision()
+
if by == "NVIDIA NVCC Wheel":
- path = os.path.join(path, "libnvvm.so")
+ platform_map = {
+ "linux": "libnvvm.so",
+ "win32": "nvvm64_40_0.dll",
+ }
+
+ for plat, dso_name in platform_map.items():
+ if sys.platform.startswith(plat):
+ break
+ else:
+ raise NotImplementedError("Unsupported platform")
+
+ path = os.path.join(path, dso_name)
else:
candidates = find_lib("nvvm", path)
path = max(candidates) if candidates else NoneLibrary test output: We will just have to ignore that the includes and cudadevrt don't seem to be available in wheels, though.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. patch added in d5b68a9 |
Uh oh!
There was an error while loading. Please reload this page.