Skip to content

torch.version.cuda.split error #1513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Lier0 opened this issue Feb 13, 2025 · 0 comments · Fixed by #1599
Closed

torch.version.cuda.split error #1513

Lier0 opened this issue Feb 13, 2025 · 0 comments · Fixed by #1599
Labels
Bug Something isn't working High Priority (first issues that will be worked on) ROCm
Milestone

Comments

@Lier0
Copy link

Lier0 commented Feb 13, 2025

System Info

python3.12
rocm6.3
amdgpu : gfx1030

Reproduction

$ python -m bitsandbytes

Could not load bitsandbytes native library: 'NoneType' object has no attribute 'split'
Traceback (most recent call last):
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/site-packages/bitsandbytes/cextension.py", line 85, in <module>
    lib = get_native_library()
          ^^^^^^^^^^^^^^^^^^^^
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/site-packages/bitsandbytes/cextension.py", line 64, in get_native_library
    cuda_specs = get_cuda_specs()
                 ^^^^^^^^^^^^^^^^
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/site-packages/bitsandbytes/cuda_specs.py", line 39, in get_cuda_specs
    cuda_version_string=(get_cuda_version_string()),
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/site-packages/bitsandbytes/cuda_specs.py", line 29, in get_cuda_version_string
    major, minor = get_cuda_version_tuple()
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/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/bitsandbytes-foundation/bitsandbytes/issues

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++ BUG REPORT INFORMATION ++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++ OTHER +++++++++++++++++++++++++++
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/site-packages/bitsandbytes/__main__.py", line 4, in <module> 
    main()
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/site-packages/bitsandbytes/diagnostics/main.py", line 51, in main
    cuda_specs = get_cuda_specs()
                 ^^^^^^^^^^^^^^^^
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/site-packages/bitsandbytes/cuda_specs.py", line 39, in get_cuda_specs
    cuda_version_string=(get_cuda_version_string()),
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/site-packages/bitsandbytes/cuda_specs.py", line 29, in get_cuda_version_string
    major, minor = get_cuda_version_tuple()
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lier0/ia/ComfyUI/comfyui_env/lib64/python3.12/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'

Expected behavior

>>> if torch.cuda.is_available() and torch.version.hip:
...     major, minor = map(int, list(torch.version.hip.split('.')[:2]))
...     print(major, minor)
... 
6 2
@matthewdouglas matthewdouglas added Bug Something isn't working ROCm labels Feb 13, 2025
@TimDettmers TimDettmers added the High Priority (first issues that will be worked on) label Feb 28, 2025
@matthewdouglas matthewdouglas added this to the v0.46.0 milestone Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working High Priority (first issues that will be worked on) ROCm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants