bitsandbytes-foundation / bitsandbytes

Accessible large language models via k-bit quantization for PyTorch.
https://huggingface.co/docs/bitsandbytes/main/en/index
MIT License
6.28k stars 631 forks source link

AttributeError: 'NoneType' object has no attribute 'split' CUDA Setup failed despite CUDA being available. #1202

Open GoDJr opened 6 months ago

GoDJr commented 6 months ago

System Info

Ubuntu 22.04.3 LTS, python 3.10.13, cuda 11.8 toolkit, latest bitsandbytes, conda 23.10.0

Reproduction

python -m bitsandbytes, and when loading comfyui

Expected behavior

Could not load bitsandbytes native library: 'NoneType' object has no attribute 'split' Traceback (most recent call last): File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/cextension.py", line 109, in lib = get_native_library() ^^^^^^^^^^^^^^^^^^^^ File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/cextension.py", line 88, in get_native_library cuda_specs = get_cuda_specs() ^^^^^^^^^^^^^^^^ File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/cuda_specs.py", line 39, in get_cuda_specs cuda_version_string=(get_cuda_version_string()), ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/cuda_specs.py", line 29, in get_cuda_version_string major, minor = get_cuda_version_tuple() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/cuda_specs.py", line 24, in get_cuda_version_tuple major, minor = map(int, torch.version.cuda.split(".")) ^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'split'

CUDA Setup failed despite CUDA 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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++ BUG REPORT INFORMATION ++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++ OTHER +++++++++++++++++++++++++++ Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/main.py", line 4, in main() File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/diagnostics/main.py", line 51, in main cuda_specs = get_cuda_specs() ^^^^^^^^^^^^^^^^ File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/cuda_specs.py", line 39, in get_cuda_specs cuda_version_string=(get_cuda_version_string()), ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/cuda_specs.py", line 29, in get_cuda_version_string major, minor = get_cuda_version_tuple() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sagar/miniconda3/lib/python3.11/site-packages/bitsandbytes/cuda_specs.py", line 24, in get_cuda_version_tuple major, minor = map(int, torch.version.cuda.split(".")) ^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'split''

In my conda environment when i use comfy if i run -m command i get a slightly different error

zzk2021 commented 4 months ago

same question, have you solved ?

etemiz commented 4 months ago

any news on this? my setup:

>>> torch.cuda.is_available()
True

>>> torch.version.cuda
>>> torch.cuda.device_count()
3
>>> torch.__version__
'2.3.1+rocm6.0'