bitsandbytes包找不到cuda

bitsandbytes包找不到cuda
1. 报错如下: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,
  1. 已有环境:win11-cuda12.6-torch2.6.0+cu126

  2. 参考:https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/docs/source/installation.mdx在自己电脑上编译安装bitsandbytes

  3. cmake -DCOMPUTE_BACKEND=cuda -S . 遇到问题:
    – Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
    – The CXX compiler identification is MSVC 19.29.30139.0
    CMake Error at C:/Program Files/CMake/share/cmake-3.24/Modules/CMakeDetermineCompilerId.cmake:491 (message):
    No CUDA toolset found.
    * 参考:https://github.com/NVlabs/tiny-cuda-nn/issues/164
    * 但是我的vs安装版本有好几个,路径也乱七八糟,需要确定cmake用的是哪个目录下的VC,复制过去之后上面的问题解决了,但是有新的问题:
    - Compiling the CUDA compiler identification source file
    “CMakeCUDACompilerId.cu” failed.
    - 参考:https://blog.youkuaiyun.com/qq_26157437/article/details/129834852
    - 如果保存时提示没有权限保存,记得记事本用管理员身份打开再编辑,就可以保存了
    - cmake成功,输出如下:
    - bitsandbytes>cmake -DCOMPUTE_BACKEND=cuda -S .
    – Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22631.
    – Configuring bitsandbytes (Backend: cuda)
    – The CUDA compiler identification is NVIDIA 12.6.77
    – Detecting CUDA compiler ABI info
    – Detecting CUDA compiler ABI info - done
    – Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin/nvcc.exe - skipped
    – Detecting CUDA compile features
    – Detecting CUDA compile features - done
    – Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include (found version “12.6.77”)
    – CUDA Version: 126 (12.6.77)
    – CUDA Compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin/nvcc.exe
    – CUDA Capabilities Available: 50;52;53;60;61;62;70;72;75;80;86;87;89;90
    – CUDA Capabilities Selected: 50;52;53;60;61;62;70;72;75;80;86;87;89;90
    – CUDA Targets: 50-real;52-real;53-real;60-real;61-real;62-real;70-real;72-real;75-real;80-real;86-real;87-real;89-real;90
    – CUDA NVCC Flags: -D_WINDOWS -Xcompiler=" /EHsc" --use_fast_math
    – Configuring done (7.9s)
    – Generating done (0.0s)

  4. 按步骤3成功安装bitsandbytes,再次测试成功未报错

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值