CUDA Setup failed despite GPU being available. Required library version not found:问题踩坑

文章描述了在安装CUDA122时遇到bitsandbytes库缺失的问题,解决方案是手动从源代码编译。作者提供了卸载现有库、克隆GitHub仓库及编译安装的步骤,并吐槽了寻找解决方案的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

详细报错如下,下载了最新的cuda122,bitsandbyts的release版本没有对应的so。
解决办法:自己编译一个

CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so
CUDA SETUP: Highest compute capability among GPUs detected: 8.6
CUDA SETUP: Detected CUDA version 122
CUDA SETUP: Required library version not found: libbitsandbytes_cuda122.so. Maybe you need to compile it from source?
CUDA SETUP: Defaulting to libbitsandbytes_cpu.so...
#如果使用了conda一定注意先卸载掉bitsandbytes
pip uninstall bitsandbytes
#明明科学上网了,但我这边没有git成功,可以下包到本地再解压
git clone https://github.com/TimDettmers/bitsandbytes.git 
cd bitsandbytes
make CUDA_VERSION=122 #注意替换为当前的CUDA_VERSION
python setup.py install

吐槽:看了一晚上,都说是换干净cuda版本或者环境的,费时费力。自己编译丰衣足食。

python -m bitsandbytes False ===================================BUG REPORT=================================== /home/anaconda3/envs/unsloth/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:167: UserWarning: Welcome to bitsandbytes. For bug reports, please run python -m bitsandbytes warn(msg) ================================================================================ /home/anaconda3/envs/unsloth/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:167: UserWarning: /home/anaconda3/envs/unsloth did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths... warn(msg) /home/anaconda3/envs/unsloth/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:167: UserWarning: :/usr/local/cuda-12.4/lib64 did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths... warn(msg) CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching in backup paths... DEBUG: Possible options found for libcudart.so: {PosixPath('/usr/local/cuda/lib64/libcudart.so')} CUDA SETUP: PyTorch settings found: CUDA_VERSION=124, Highest Compute Capability: 8.9. CUDA SETUP: To manually override the PyTorch CUDA version please see:https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md CUDA SETUP: Required library version not found: libbitsandbytes_cuda124.so. Maybe you need to compile it from source? CUDA SETUP: Defaulting to libbitsandbytes_cpu.so... ================================================ERROR===================================== CUDA SETUP: CUDA detection failed! Possible reasons: 1. You need to manually override the PyTorch CUDA version. Please see: "https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md 2. CUDA driver not installed 3. CUDA not installed 4. You have multiple conflicting CUDA libraries 5. Required library not pre-compiled for this bitsandbytes release! CUDA S
最新发布
03-25
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值