Skip to content

Conversation

@ZzEeKkAa
Copy link
Contributor

@ZzEeKkAa ZzEeKkAa commented Jul 2, 2025

libnvrtc.so is located in the lib64 folder not in the separate folder. I guess it is a typo based on the nvvm location. Not sure about Windows path, but was following same logic as nvvm does, but without subfolder.

UPD: probably won't be needed after #308

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jul 2, 2025

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@ZzEeKkAa ZzEeKkAa self-assigned this Jul 2, 2025
@ZzEeKkAa ZzEeKkAa added the 4 - Waiting on reviewer Waiting for reviewer to respond to author label Jul 2, 2025
@brandon-b-miller
Copy link
Contributor

Thanks @ZzEeKkAa , is there a container or something similar I can use to reproduce the failure state?

@ZzEeKkAa
Copy link
Contributor Author

ZzEeKkAa commented Jul 2, 2025

Thanks @ZzEeKkAa , is there a container or something similar I can use to reproduce the failure state?

I was using just system install of ctk at /usr/local/cuda-X.Y. I would expect that any cuda container, for example https://hub.docker.com/r/rapidsai/devcontainers will work.

I was following this instructions to setup system ctk:

export CUDA_HOME=/usr/local/cuda-X.Y
export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH

Copy link
Contributor

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it was incorrect previously, and that this makes it correct (I have not tested it, beyond inspecting where the NVRTC lib appears to be placed in a toolkit installation). I don't think we do any testing with CUDA_HOME, so I can imagine this could have been non-working since it was last modified.

Copy link
Contributor

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On main, when I run:

CUDA_HOME=/usr/local/cuda-12.8 NUMBA_CUDA_USE_NVIDIA_BINDING=0 gdb --args python -c "from numba import cuda; cuda.cudadrv.libs.test(); input()"

I get

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/lib/x86_64-linux-gnu/libcuda.so.570.133.20
Finding nvvm from CUDA_HOME
	Located at /usr/local/cuda-12.8/nvvm/lib64/libnvvm.so.4.0.0
	Trying to open library...	ok
Finding nvrtc from CUDA_HOME
	Located at libnvrtc.so
	Trying to open library...	ok
Finding cudadevrt from CUDA_HOME
	Located at /usr/local/cuda-12.8/lib64/libcudadevrt.a
	Checking library...	ok
Finding libdevice from CUDA_HOME
	Located at /usr/local/cuda-12.8/nvvm/libdevice/libdevice.10.bc
	Checking library...	ok
Include directory configuration variable:
	CUDA_INCLUDE_PATH=/usr/local/cuda/include
Finding include directory from CUDA_INCLUDE_PATH Config Entry
	Located at /usr/local/cuda/include
	Checking include directory...	ok

The nvrtc path was not located correctly - gdb info shared shows it found another nvrtc.so on the linker path:

0x00007ffef6352e10  0x00007ffef9654342  Yes (*)     /usr/local/cuda-12.8/nvvm/lib64/libnvvm.so.4.0.0
0x00007ffef2643e80  0x00007ffef4c9fc92  Yes (*)     /usr/local/cuda-12.6/targets/x86_64-linux/lib/libnvrtc.so

(nvvm.so also shown for comparison).

With this branch, the correct nvrtc library is loaded:

0x00007ffef6352e10  0x00007ffef9654342  Yes (*)     /usr/local/cuda-12.8/nvvm/lib64/libnvvm.so.4.0.0
0x00007ffeefe1f170  0x00007ffef46b2892  Yes (*)     /usr/local/cuda-12.8/lib64/libnvrtc.so.12.8.93

and the output is also as expected:

Finding nvrtc from CUDA_HOME
	Located at /usr/local/cuda-12.8/lib64/libnvrtc.so.12.8.93
	Trying to open library...	ok

@gmarkall gmarkall added 4 - Waiting on author Waiting for author to respond to review and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Jul 3, 2025
@ZzEeKkAa ZzEeKkAa added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Jul 3, 2025
@gmarkall
Copy link
Contributor

gmarkall commented Jul 3, 2025

/ok to test

@kkraus14 kkraus14 merged commit f0226ba into main Jul 3, 2025
39 checks passed
@gmarkall gmarkall deleted the yhavrylko/fix/nvrtc_cuda_home_path_resolution branch July 7, 2025 13:27
gmarkall added a commit to gmarkall/numba-cuda that referenced this pull request Jul 18, 2025
- Add deadlock warnings to Stream.add_callback and Stream.async_done docstrings (NVIDIA#321)
- `MemoryPointer`: ensure `CUdeviceptr` used with NVIDIA binding (NVIDIA#328)
- Fix indexing GPUs with CUdevice object (NVIDIA#319)
- Fix bindings: consistency of contexts, streams, and events, similar to NVIDIA#295 (NVIDIA#296)
- Fix nvrtc resolution when CUDA_HOME env is set (NVIDIA#314)
@gmarkall gmarkall mentioned this pull request Jul 18, 2025
gmarkall added a commit that referenced this pull request Jul 18, 2025
- Add deadlock warnings to Stream.add_callback and Stream.async_done docstrings (#321)
- `MemoryPointer`: ensure `CUdeviceptr` used with NVIDIA binding (#328)
- Fix indexing GPUs with CUdevice object (#319)
- Fix bindings: consistency of contexts, streams, and events, similar to #295 (#296)
- Fix nvrtc resolution when CUDA_HOME env is set (#314)
atmnp pushed a commit to atmnp/numba-cuda that referenced this pull request Jul 21, 2025
- Add deadlock warnings to Stream.add_callback and Stream.async_done docstrings (NVIDIA#321)
- `MemoryPointer`: ensure `CUdeviceptr` used with NVIDIA binding (NVIDIA#328)
- Fix indexing GPUs with CUdevice object (NVIDIA#319)
- Fix bindings: consistency of contexts, streams, and events, similar to NVIDIA#295 (NVIDIA#296)
- Fix nvrtc resolution when CUDA_HOME env is set (NVIDIA#314)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 - Waiting on reviewer Waiting for reviewer to respond to author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants