TimDettmers / bitsandbytes

Accessible large language models via k-bit quantization for PyTorch.

Home Page:https://huggingface.co/docs/bitsandbytes/main/en/index

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Path is broken in Stable Diffusion after installing extension.

vicbanta opened this issue · comments

System Info

Ubuntu 20.04 Dell r720xd, nVidia Tesla P40 GPU.

Reproduction

stable@wolf:$ source /mnt/storage/stable-diffusion-webui/venv/bin/activate
(venv) stable@wolf:
$ python -m bitsandbytes
False

===================================BUG REPORT===================================
/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:183: UserWarning: Welcome to bitsandbytes. For bug reports, please run

python -m bitsandbytes

warn(msg)

CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching in backup paths...
The following directories listed in your path were found to be non-existent: {PosixPath('/usr/local/cuda/lib64')}
DEBUG: Possible options found for libcudart.so: set()
CUDA SETUP: PyTorch settings found: CUDA_VERSION=118, Highest Compute Capability: 6.1.
CUDA SETUP: To manually override the PyTorch CUDA version please see:https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md
/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/cuda_setup/main.py:183: UserWarning: WARNING: Compute capability < 7.5 detected! Only slow 8-bit matmul is supported for your GPU! If you run into issues with 8-bit matmul, you can try 4-bit quantization: https://huggingface.co/blog/4bit-transformers-bitsandbytes
warn(msg)
CUDA SETUP: Loading binary /mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cuda118_nocublaslt.so...
libcusparse.so.11: cannot open shared object file: No such file or directory
CUDA SETUP: Problem: The main issue seems to be that the main CUDA runtime library was not detected.
CUDA SETUP: Solution 1: To solve the issue the libcudart.so location needs to be added to the LD_LIBRARY_PATH variable
CUDA SETUP: Solution 1a): Find the cuda runtime library via: find / -name libcudart.so 2>/dev/null
CUDA SETUP: Solution 1b): Once the library is found add it to the LD_LIBRARY_PATH: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:FOUND_PATH_FROM_1a
CUDA SETUP: Solution 1c): For a permanent solution add the export from 1b into your .bashrc file, located at ~/.bashrc
CUDA SETUP: Solution 2: If no library was found in step 1a) you need to install CUDA.
CUDA SETUP: Solution 2a): Download CUDA install script: wget https://raw.githubusercontent.com/TimDettmers/bitsandbytes/main/cuda_install.sh
CUDA SETUP: Solution 2b): Install desired CUDA version to desired location. The syntax is bash cuda_install.sh CUDA_VERSION PATH_TO_INSTALL_INTO.
CUDA SETUP: Solution 2b): For example, "bash cuda_install.sh 113 ~/local/" will download CUDA 11.3 and install into the folder ~/local
Traceback (most recent call last):
File "/usr/local/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/lib/python3.10/runpy.py", line 146, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/local/lib/python3.10/runpy.py", line 110, in _get_module_details
import(pkg_name)
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/init.py", line 6, in
from . import cuda_setup, research, utils
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/research/init.py", line 2, in
from .autograd._functions import (
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/research/autograd/_functions.py", line 8, in
from bitsandbytes.autograd._functions import GlobalOutlierPooler, MatmulLtState
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/autograd/init.py", line 1, in
from ._functions import get_inverse_transform_indices, undo_layout
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/autograd/_functions.py", line 10, in
import bitsandbytes.functional as F
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/functional.py", line 17, in
from .cextension import COMPILED_WITH_CUDA, lib
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/cextension.py", line 17, in
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

(venv) stable@wolf:~$ vim start_webui.sh

File "/mnt/storage/stable-diffusion-webui/repositories/generative-models/sgm/modules/init.py", line 1, in
from .encoders.modules import GeneralConditioner
File "/mnt/storage/stable-diffusion-webui/repositories/generative-models/sgm/modules/encoders/modules.py", line 5, in
import kornia
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/kornia/init.py", line 11, in
from . import augmentation, color, contrib, core, enhance, feature, io, losses, metrics, morphology, tracking, utils, x
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/kornia/x/init.py", line 2, in
from .trainer import Trainer
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/kornia/x/trainer.py", line 11, in
from accelerate import Accelerator
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/accelerate/init.py", line 3, in
from .accelerator import Accelerator
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/accelerate/accelerator.py", line 35, in
from .checkpointing import load_accelerator_state, load_custom_state, save_accelerator_state, save_custom_state
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/accelerate/checkpointing.py", line 24, in
from .utils import (
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/accelerate/utils/init.py", line 131, in
from .bnb import has_4bit_bnb_layers, load_and_quantize_model
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/accelerate/utils/bnb.py", line 42, in
import bitsandbytes as bnb
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/init.py", line 6, in
from . import cuda_setup, research, utils
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/research/init.py", line 2, in
from .autograd._functions import (
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/research/autograd/_functions.py", line 8, in
from bitsandbytes.autograd._functions import GlobalOutlierPooler, MatmulLtState
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/autograd/init.py", line 1, in
from ._functions import get_inverse_transform_indices, undo_layout
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/autograd/_functions.py", line 10, in
import bitsandbytes.functional as F
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/functional.py", line 17, in
from .cextension import COMPILED_WITH_CUDA, lib
File "/mnt/storage/stable-diffusion-webui/venv/lib/python3.10/site-packages/bitsandbytes/cextension.py", line 17, in
raise RuntimeError('''
RuntimeError:
CUDA Setup failed despite GPU being available. Please run the following command to get more information:

    python -m bitsandbytes

Expected behavior

Expect to install the extension sd_dreambooth_extension and be able to start Stable Diffusion WebUI with this error.