jllllll / bitsandbytes-windows-webui

Windows compile of bitsandbytes for use in text-generation-webui.
MIT License
344 stars 35 forks source link

CUDA Setup failed despite GPU being available #27

Closed Entretoize closed 10 months ago

Entretoize commented 10 months ago

After several tries, and uninstalling completely and reinstalling through python -m pip install bitsandbytes --prefer-binary --extra-index-url=https://jllllll.github.io/bitsandbytes-windows-webui I'm still getting that error :


False

===================================BUG REPORT===================================
C:\Users\Greg\.conda\envs\py310\lib\site-packages\bitsandbytes\cuda_setup\main.py:167: UserWarning: Welcome to bitsandbytes. For bug reports, please run

python -m bitsandbytes

  warn(msg)
================================================================================
The following directories listed in your path were found to be non-existent: {WindowsPath('C')}
C:\Users\Greg\.conda\envs\py310\lib\site-packages\bitsandbytes\cuda_setup\main.py:167: UserWarning: C:\Users\Greg\.conda\envs\py310 did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths...
  warn(msg)
The following directories listed in your path were found to be non-existent: {WindowsPath('mistralai/Mistral-7B-Instruct-v0.2')}
The following directories listed in your path were found to be non-existent: {WindowsPath('file'), WindowsPath('/C'), WindowsPath('/Users/Greg/.conda/envs/py310/etc/xml/catalog')}
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: {WindowsPath('/usr/local/cuda/lib64')}
DEBUG: Possible options found for libcudart.so: set()
CUDA SETUP: PyTorch settings found: CUDA_VERSION=121, Highest Compute Capability: 8.6.
CUDA SETUP: To manually override the PyTorch CUDA version please see:https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md
CUDA SETUP: Loading binary C:\Users\Greg\.conda\envs\py310\lib\site-packages\bitsandbytes\libbitsandbytes_cuda121.so...
argument of type 'WindowsPath' is not iterable
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 "C:\Users\Greg\.conda\envs\py310\lib\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Users\Greg\.conda\envs\py310\lib\runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\Users\Greg\.conda\envs\py310\lib\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "C:\Users\Greg\.conda\envs\py310\lib\site-packages\bitsandbytes\__init__.py", line 6, in <module>
    from . import cuda_setup, utils, research
  File "C:\Users\Greg\.conda\envs\py310\lib\site-packages\bitsandbytes\research\__init__.py", line 1, in <module>
    from . import nn
  File "C:\Users\Greg\.conda\envs\py310\lib\site-packages\bitsandbytes\research\nn\__init__.py", line 1, in <module>
    from .modules import LinearFP8Mixed, LinearFP8Global
  File "C:\Users\Greg\.conda\envs\py310\lib\site-packages\bitsandbytes\research\nn\modules.py", line 8, in <module>
    from bitsandbytes.optim import GlobalOptimManager
  File "C:\Users\Greg\.conda\envs\py310\lib\site-packages\bitsandbytes\optim\__init__.py", line 6, in <module>
    from bitsandbytes.cextension import COMPILED_WITH_CUDA
  File "C:\Users\Greg\.conda\envs\py310\lib\site-packages\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```

And idea ?
OnionKiller commented 9 months ago

Hey, @Entretoize can I may ask, what the fix was? I encoutered the same issue.

Entretoize commented 9 months ago

I installed the prebuilt WHL from here : https://github.com/jllllll/bitsandbytes-windows-webui/releases with pip install path/to/bitsandbytes.whl

OnionKiller commented 9 months ago

Thanks fo the help. I realized, that I installed the wrong version of bitsandbytes, because I used the install command provided in the reademe:

python -m pip install bitsandbytes --prefer-binary --extra-index-url=https://jllllll.github.io/bitsandbytes-windows-webui

but the version was not matched yet, so pip wasn't installing from the extra-index. So (AS it is stated in the reademe as well) I had to use the following command instead:

python -m pip install scipy
python -m pip install bitsandbytes --index-url=https://jllllll.github.io/bitsandbytes-windows-webui