bitsandbytes icon indicating copy to clipboard operation
bitsandbytes copied to clipboard

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

Open GoDJr opened this issue 1 year ago • 2 comments

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

GoDJr avatar May 07 '24 19:05 GoDJr

same question, have you solved ?

zzk2021 avatar Jun 27 '24 12:06 zzk2021

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'

etemiz avatar Jul 06 '24 17:07 etemiz

This worked for me:

pip install --no-deps --force-reinstall 'https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_multi-backend-refactor/bitsandbytes-0.44.1.dev0-py3-none-manylinux_2_24_x86_64.whl'

then test with python -m bitsandbytes

yhavinga avatar Feb 07 '25 15:02 yhavinga