Skip to content
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

[v0.33.0] Colab CPU installation gives list index out of range #34

Closed
justheuristic opened this issue Sep 13, 2022 · 1 comment · Fixed by #37
Closed

[v0.33.0] Colab CPU installation gives list index out of range #34

justheuristic opened this issue Sep 13, 2022 · 1 comment · Fixed by #37

Comments

@justheuristic
Copy link
Contributor

justheuristic commented Sep 13, 2022

In a blank colab CPU noteboook, you can install like this,

!pip install bitsandbytes==0.33.0
import bitsandbytes

but the import fails

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/main.py](https://localhost:8080/#) in get_compute_capability(cuda)
    106     if ccs is not None:
    107         # TODO: handle different compute capabilities; for now, take the max
--> 108         return ccs[-1]
    109     return None
    110 

IndexError: list index out of range

Here's the example colab notebook

Full traceback
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting bitsandbytes==0.33.0
  Downloading bitsandbytes-0.33.0-py3-none-any.whl (55.9 MB)
     |████████████████████████████████| 55.9 MB 214 kB/s 
Installing collected packages: bitsandbytes
Successfully installed bitsandbytes-0.33.0

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues
For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link
================================================================================
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
CUDA SETUP: CUDA runtime path found: /usr/local/cuda/lib64/libcudart.so
CUDA exception! Error code: no CUDA-capable device is detected
CUDA exception! Error code: initialization error

/usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:21: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/usr/local/nvidia/lib64'), PosixPath('/usr/local/nvidia/lib')}
  "WARNING: The following directories listed in your path were found to "
/usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:99: UserWarning: /usr/local/nvidia/lib:/usr/local/nvidia/lib64 did not contain libcudart.so as expected! Searching further paths...
  f'{candidate_env_vars["LD_LIBRARY_PATH"]} did not contain '
/usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:21: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('"172.28.0.3","jupyterArgs"'), PosixPath('true}'), PosixPath('6000,"kernelManagerProxyHost"'), PosixPath('["--ip=172.28.0.2"],"debugAdapterMultiplexerPath"'), PosixPath('{"kernelManagerProxyPort"'), PosixPath('"/usr/local/bin/dap_multiplexer","enableLsp"')}
  "WARNING: The following directories listed in your path were found to "
/usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:21: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('/env/python')}
  "WARNING: The following directories listed in your path were found to "
/usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/paths.py:21: UserWarning: WARNING: The following directories listed in your path were found to be non-existent: {PosixPath('module'), PosixPath('//ipykernel.pylab.backend_inline')}
  "WARNING: The following directories listed in your path were found to "

---------------------------------------------------------------------------

IndexError                                Traceback (most recent call last)

[<ipython-input-1-e9a23814d8e9>](https://localhost:8080/#) in <module>
      1 get_ipython().system('pip install bitsandbytes==0.33.0')
----> 2 import bitsandbytes

7 frames

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/__init__.py](https://localhost:8080/#) in <module>
      4 # LICENSE file in the root directory of this source tree.
      5 
----> 6 from .autograd._functions import (
      7     MatmulLtState,
      8     bmm_cublas,

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/autograd/_functions.py](https://localhost:8080/#) in <module>
      1 import operator
      2 import torch
----> 3 import bitsandbytes.functional as F
      4 
      5 from dataclasses import dataclass

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/functional.py](https://localhost:8080/#) in <module>
     11 from torch import Tensor
     12 
---> 13 from .cextension import COMPILED_WITH_CUDA, lib
     14 from functools import reduce  # Required in Python 3
     15 

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/cextension.py](https://localhost:8080/#) in <module>
     39 
     40 
---> 41 lib = CUDALibrary_Singleton.get_instance().lib
     42 try:
     43     lib.cadam32bit_g32

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/cextension.py](https://localhost:8080/#) in get_instance(cls)
     35         if cls._instance is None:
     36             cls._instance = cls.__new__(cls)
---> 37             cls._instance.initialize()
     38         return cls._instance
     39 

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/cextension.py](https://localhost:8080/#) in initialize(self)
     13 
     14     def initialize(self):
---> 15         binary_name = evaluate_cuda_setup()
     16         package_dir = Path(__file__).parent
     17         binary_path = package_dir / binary_name

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/main.py](https://localhost:8080/#) in evaluate_cuda_setup()
    130     print(f"CUDA SETUP: CUDA runtime path found: {cudart_path}")
    131     cuda = get_cuda_lib_handle()
--> 132     cc = get_compute_capability(cuda)
    133     print(f"CUDA SETUP: Highest compute capability among GPUs detected: {cc}")
    134     cuda_version_string = get_cuda_version(cuda, cudart_path)

[/usr/local/lib/python3.7/dist-packages/bitsandbytes/cuda_setup/main.py](https://localhost:8080/#) in get_compute_capability(cuda)
    106     if ccs is not None:
    107         # TODO: handle different compute capabilities; for now, take the max
--> 108         return ccs[-1]
    109     return None
    110 

IndexError: list index out of range
@t170815518
Copy link

I got the same error, and the reason is there is no available cuda device detected.

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

Successfully merging a pull request may close this issue.

2 participants