跳至主要內容

AttributeError: ‘NoneType’ object has no attribute ‘cuDeviceGetCount’ error when using CUDA on WSL2

I was working on one of the projects from my work. That project is a CLI tool to run LoRA training and generation.

If you have read the post below, then you can take this post as a follow up.

The error happened when I run with bitsandbytes library.

You may also see a warning ahead

CUDA SETUP: WARNING! libcuda.so not found! Do you have a CUDA driver installed? If you are on a cluster, make sure you are on a CUDA machine!

The solution is came from this github issue.

https://github.com/TimDettmers/bitsandbytes/issues/52

In simple words, since you’re using WSL, so you also need to add the following path to ~/.bashrc, then save it and run source ~/.bashrc

export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH

分類:Issues

搶先發佈留言

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

由 Compete Themes 設計的 Author 佈景主題