bitsandbytes: GPU not detected

(textgen) lol@DESKTOP-QGQVC64:~/ttextgen/bitsandbytes$ python -m bitsandbytes

===================================BUG REPORT=================================== Welcome to bitsandbytes. For bug reports, please run

python -m bitsandbytes

and submit this information together with your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

bin /home/lol/ttextgen/bitsandbytes/bitsandbytes/libbitsandbytes_cpu.so /home/lol/ttextgen/bitsandbytes/bitsandbytes/cuda_setup/main.py:145: UserWarning: /home/lol/miniconda3_new/envs/textgen did not contain [‘libcudart.so’, ‘libcudart.so.11.0’, ‘libcudart.so.12.0’] as expected! Searching further paths… warn(msg) CUDA exception! Error code: no CUDA-capable device is detected CUDA exception! Error code: initialization error CUDA SETUP: CUDA runtime path found: /home/lol/miniconda3_new/envs/textgen/lib/python3.10/site-packages/nvidia/cuda_runtime/lib/libcudart.so.11.0 /home/lol/ttextgen/bitsandbytes/bitsandbytes/cuda_setup/main.py:145: UserWarning: WARNING: No GPU detected! Check your CUDA paths. Proceeding to load CPU-only library… warn(msg) CUDA SETUP: Detected CUDA version 117 CUDA SETUP: Required library version not found: libbitsandbytes_cpu.so. Maybe you need to compile it from source? CUDA SETUP: Defaulting to libbitsandbytes_cpu.so…

================================================ERROR===================================== CUDA SETUP: CUDA detection failed! Possible reasons:

  1. CUDA driver not installed
  2. CUDA not installed
  3. You have multiple conflicting CUDA libraries
  4. Required library not pre-compiled for this bitsandbytes release! CUDA SETUP: If you compiled from source, try again with make CUDA_VERSION=DETECTED_CUDA_VERSION for example, make CUDA_VERSION=113. CUDA SETUP: The CUDA version for the compile might depend on your conda install. Inspect CUDA version via conda list | grep cuda. ================================================================================

CUDA SETUP: Something unexpected happened. Please compile from source: git clone git@github.com:TimDettmers/bitsandbytes.git cd bitsandbytes CUDA_VERSION=117 make cuda11x_nomatmul python setup.py install CUDA SETUP: Setup Failed! CUDA SETUP: Something unexpected happened. Please compile from source: git clone git@github.com:TimDettmers/bitsandbytes.git cd bitsandbytes CUDA_VERSION=117 make cuda11x_nomatmul python setup.py install Traceback (most recent call last): File “/home/lol/miniconda3_new/envs/textgen/lib/python3.10/runpy.py”, line 187, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File “/home/lol/miniconda3_new/envs/textgen/lib/python3.10/runpy.py”, line 146, in _get_module_details return _get_module_details(pkg_main_name, error) File “/home/lol/miniconda3_new/envs/textgen/lib/python3.10/runpy.py”, line 110, in _get_module_details import(pkg_name) File “/home/lol/ttextgen/bitsandbytes/bitsandbytes/init.py”, line 6, in <module> from . import cuda_setup, utils, research File “/home/lol/ttextgen/bitsandbytes/bitsandbytes/research/init.py”, line 1, in <module> from . import nn File “/home/lol/ttextgen/bitsandbytes/bitsandbytes/research/nn/init.py”, line 1, in <module> from .modules import LinearFP8Mixed, LinearFP8Global File “/home/lol/ttextgen/bitsandbytes/bitsandbytes/research/nn/modules.py”, line 8, in <module> from bitsandbytes.optim import GlobalOptimManager File “/home/lol/ttextgen/bitsandbytes/bitsandbytes/optim/init.py”, line 6, in <module> from bitsandbytes.cextension import COMPILED_WITH_CUDA File “/home/lol/ttextgen/bitsandbytes/bitsandbytes/cextension.py”, line 20, in <module> raise RuntimeError(‘’’ RuntimeError: CUDA Setup failed despite GPU 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

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17

Most upvoted comments

@IronDingo @LLLYF I just submitted a PR (documentation only) for this.

In your WSL Ubuntu, add the following two lines to your ~/.bashrc and then quit that shell and restart it, and it will work.

export PATH="$PATH:/usr/local/cuda/bin"
export LD_LIBRARY_PATH="/usr/lib/wsl/lib:/usr/local/cuda/lib64"

Bitsandbytes was not supported windows before, but my method can support windows.(yuhuang) 1 open folder J:\StableDiffusion\sdwebui,Click the address bar of the folder and enter CMD or WIN+R, CMD 。enter,cd /d J:\StableDiffusion\sdwebui 2 J:\StableDiffusion\sdwebui\py310\python.exe -m pip uninstall bitsandbytes

3 J:\StableDiffusion\sdwebui\py310\python.exe -m pip uninstall bitsandbytes-windows

4 J:\StableDiffusion\sdwebui\py310\python.exe -m pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.1-py3-none-win_amd64.whl

Replace your SD venv directory file(python.exe Folder) here(J:\StableDiffusion\sdwebui\py310)