Skip to content
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

Fill out python -m numba -s field for CUDA Libraries Test Output (even if GPU is absent) #9439

Open
jakirkham opened this issue Feb 15, 2024 · 1 comment
Labels
CUDA CUDA related issue/PR feature_request

Comments

@jakirkham
Copy link
Contributor

Feature request

When creating a numba environment in a Docker image or other build environment where the CUDA Toolkit libraries are present, but a GPU is absent like so...

conda create -n numba python=3.11 cuda-version=12.2 cuda-nvcc cuda-nvrtc psutil numba

...and running python -m numba -s. The information on CUDA Libraries detection is left out:

CUDA Libraries Test Output:
None

However the "CUDA Libraries Test Output:" field...

("CUDA Libraries Test Output:",),
(info.get(_cu_lib_test, "None"),),

...merely calls numba.cuda.cudadrv.libs function test:

from numba.cuda import cudadrv

output = StringIO()
with redirect_stdout(output):
cudadrv.libs.test()
sys_info[_cu_lib_test] = output.getvalue()
output.close()

Running this alone is ok:

python -c "from numba.cuda.cudadrv.libs import test; test()"
Finding driver from candidates:
	libcuda.so
	libcuda.so.1
	/usr/lib/libcuda.so
	/usr/lib/libcuda.so.1
	/usr/lib64/libcuda.so
	/usr/lib64/libcuda.so.1
Using loader <class 'ctypes.CDLL'>
	Trying to load driver...	ok
		Loaded from libcuda.so
	Mapped libcuda.so paths:
		/usr/local/cuda-11.8/compat/libcuda.so.520.61.05
Finding nvvm from Conda environment (NVIDIA package)
	Located at /opt/conda/envs/numba/nvvm/lib64/libnvvm.so.4.0.0
	Trying to open library...	ok
Finding nvrtc from Conda environment (NVIDIA package)
	Located at /opt/conda/envs/numba/lib/libnvrtc.so.12.3.107
	Trying to open library...	ok
Finding cudart from Conda environment (NVIDIA package)
	Located at /opt/conda/envs/numba/lib/libcudart.so.12.3.101
	Trying to open library...	ok
Finding cudadevrt from Conda environment (NVIDIA package)
	Located at /opt/conda/envs/numba/lib/libcudadevrt.a
	Checking library...	ok
Finding libdevice from Conda environment (NVIDIA package)
	Located at /opt/conda/envs/numba/nvvm/libdevice/libdevice.10.bc
	Checking library...	ok

It appears this happens as Numba skips including this info if a GPU is not found

cu.list_devices()[0] # will a device initialise?

However it would be nice to include this information just to provide a sanity check that Numba can find the CUDA Toolkit libraries

@jakirkham jakirkham changed the title Fill out python -m numba -s field for CUDA Libraries Test Output (even if driver is unavailable) Fill out python -m numba -s field for CUDA Libraries Test Output (even if GPU is absent) Feb 15, 2024
@guilhermeleobas
Copy link
Contributor

Hi @jakirkham, thanks for the report. I have labeled this issue as a feature request.

@sklam sklam added the CUDA CUDA related issue/PR label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CUDA CUDA related issue/PR feature_request
Projects
None yet
Development

No branches or pull requests

3 participants