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

Unable to find cuda lib under the names ["cuda", "nvcuda"] in WSL2 #296

Open
Anivie opened this issue Nov 4, 2024 · 2 comments
Open

Unable to find cuda lib under the names ["cuda", "nvcuda"] in WSL2 #296

Anivie opened this issue Nov 4, 2024 · 2 comments

Comments

@Anivie
Copy link

Anivie commented Nov 4, 2024

There are some errors when using cudarc in WSL2, and this is because the CUDA environment in WSL is quite special; its default CUDA files are stored in usr/lib/wsl/lib.

Currently, adding /usr/lib/wsl/lib to the LD_LIBRARY_PATH can fix this error.

However, this error shouldn't exist because WSL actually provides this path by default, located in /etc/ld.so.conf.d/ld.wsl.conf, and cudarc does not scan the paths in the files within this directory, which seems to be against convention.
Therefore, please add the paths from the files in this directory to the library search directories to avoid dependency on LD_LIBRARY_PATH.

@RobertoMaurizzi
Copy link

RobertoMaurizzi commented Nov 19, 2024

Now (after the last nvidia package updates from the beginning of November) I have the same on a "regular" Debian 12.
My libcuda is in /usr/lib/x86_64-linux-gnu, where there's a symlink from libcuda.so.1 to libcuda.so.565.57.01.
Adding a symlink from a libcuda.so to libcuda.so.1 fixes the error...

@maulberto3
Copy link

There are some errors when using cudarc in WSL2, and this is because the CUDA environment in WSL is quite special; its default CUDA files are stored in usr/lib/wsl/lib.

Currently, adding /usr/lib/wsl/lib to the LD_LIBRARY_PATH can fix this error.

However, this error shouldn't exist because WSL actually provides this path by default, located in /etc/ld.so.conf.d/ld.wsl.conf, and cudarc does not scan the paths in the files within this directory, which seems to be against convention. Therefore, please add the paths from the files in this directory to the library search directories to avoid dependency on LD_LIBRARY_PATH.

Once I gave up trying to make it work. Your approach works. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants