Skip to content

[Bug Report] bitsandbytes/ cuda_specs.py #1577

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
Squ-123 opened this issue Mar 27, 2025 · 1 comment
Closed

[Bug Report] bitsandbytes/ cuda_specs.py #1577

Squ-123 opened this issue Mar 27, 2025 · 1 comment
Milestone

Comments

@Squ-123
Copy link

Squ-123 commented Mar 27, 2025

System Info

CentOS7, Tesla A100

Reproduction

When I run "python -m bitsandbytes" on my own server, it returns:
Traceback (most recent call last):
File "/mnt/data/miniconda/envs/unsloth_env/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/mnt/data/miniconda/envs/unsloth_env/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/mnt/data/conda/bitsandbytes/bitsandbytes/main.py", line 4, in
main()
File "/mnt/data/conda/bitsandbytes/bitsandbytes/diagnostics/main.py", line 51, in main
cuda_specs = get_cuda_specs()
File "/mnt/data/conda/bitsandbytes/bitsandbytes/cuda_specs.py", line 44, in get_cuda_specs
cuda_version_string=(get_cuda_version_string()),
File "/mnt/data/conda/bitsandbytes/bitsandbytes/cuda_specs.py", line 34, in get_cuda_version_string
major, minor = get_cuda_version_tuple()
ValueError: not enough values to unpack (expected 2, got 0)

Expected behavior

I check the source code and find the function:
@lru_cache(None)
def get_cuda_version_tuple() -> Tuple[int, int]:
if torch.version.cuda:
return map(int, torch.version.cuda.split(".")[0:2])
elif torch.version.hip:
return map(int, torch.version.hip.split(".")[0:2])
return None
def get_cuda_version_string() -> str:
major, minor = get_cuda_version_tuple()
return f"{major * 10 + minor}"

get_cuda_version_tuple() returns an Map Object, and I cannot get correct version number in get_cuda_version_string()
Does it supposed to be:
@lru_cache(None)
def get_cuda_version_tuple() -> Tuple[int, int]:
if torch.version.cuda:
return tuple(map(int, torch.version.cuda.split(".")[0:2]))
elif torch.version.hip:
return tuple(map(int, torch.version.hip.split(".")[0:2]))
return (0,0)

@matthewdouglas
Copy link
Member

Fixed in #1580

@matthewdouglas matthewdouglas added this to the v0.46.0 milestone Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants