Python Bitsandbytes模块报错解析及解决方案指南
RuntimeError: CUDA Setup failed despite GPU being available. Please run the following command to get more information: python -m bitsandbytes Inspect the output of the command and see if you can locate CUDA libraries. You might need to add them to your LD_LIBRARY_PATH. If you suspect a bug, please take the information from python -m bitsandbytes and open an issue at: https://github.com/TimDettmers/bitsandbytes/issues
bitsandbytes报错基本上都有这么一句,CUDA SETUP: Required library version not found: libbitsandbytes_cuda124.so. Maybe you need to compile it from source?
这句是告诉你,你env下面的bitsandbyte包里面没有对应的CUDA版本的so文件,在我这里就是没有libbitsandbytes_cuda124.so
所以需要去找libbitsandbytes_cuda124.so。有的时候你的cuda版本低一些,可能pip upgrade下就好了,但是像我cuda12.4版本,我的bitsandbytes0.42最新都无法支持cuda==12.4
这时候就要去bitsandbytes的release库碰运气了。我试了几个版本的,最后在bitsandbytes0.43版本下发现可以
因此下载0.43版本,pip install whl即可。
(有可能报错说,该版本不是这个platform支持的,你可以把你下的这个whl改成之前的版本名,比如我的不支持0.43,那么我就改成XXXX0.41.whl)
作者:MityKif