-
-
Notifications
You must be signed in to change notification settings - Fork 776
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
libnvrtc not found, v13 #8317
Comments
NVRTC is now dlopen'd cupy/cupy_backends/cuda/libs/_cnvrtc.pxi Line 143 in a384b1a
it was part of v13 efforts (#7620) to help CuPy packages stay minimal. This means you need to make it searchable by the dynamic linker (say, set LD_LIBRARY_PATH ). Could you give it a shot?
|
Setting ctypes find_library has a bug since forever where it does not return the full path of the library, hence not founding said library when they are installed in non standard location, such as on HPC systems. https://bugs.python.org/issue21042
I'll dig a bit more into why it did not work with our custom-ctypes, but since I could also patch cupy to add needed libs, but I'd prefer to avoid doing that systematically for every release now on. |
Thanks for the feedback @ccoulombe, this is a thing I overlooked when moving to ctypes-based loading. I think we can fix it on our side as follows:
If |
I am still confused, though. @ccoulombe I agree no one wants users to set To make RPATH work, we still need the DSOs to be locatable by the linker, so I don't know what problem it'd solve? |
@ccoulombe gentle ping, could you help us understand better? |
@leofang Sorry for the delay, thanks for the ping! :) |
Description
When trying to show config or running the example below, Cupy fails to find
libnvrtc
:On our HPC systems, cuda libraries are installed on non-standard location.
This was never an issue until v13 (worked in previous versions).
To Reproduce
Installation
Built from GitHub source
Environment
Linux, Centos, HPC system, python 3.11, cuda 12.2.
Cupy v13.0.0
Cuda libraries are not installed in standard location.
Additional Information
The rpaths are present and correct :
$ patchelf --print-rpath $VIRTUAL_ENV/lib/python3.11/site-packages/cupy_backends/cuda/libs/nvrtc.cpython-311-x86_64-linux-gnu.so /cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/cudacore/12.2.2/lib64:/cvmfs/soft.computecanada.ca/easybuild/software/2023/x86-64-v3/Core/cudacore/12.2.2/lib
and librairies are found.
But nvrtc library is not needed :
A quick fix: add libnvrtc as needed :
$ patchelf --add-needed libnvrtc.so.12 $VIRTUAL_ENV/lib/python3.11/site-packages/cupy_backends/cuda/libs/nvrtc.cpython-311-x86_64-linux-gnu.so
The text was updated successfully, but these errors were encountered: