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

CUDA setup issue #971

Closed
MarkDeng1 opened this issue Jan 17, 2024 · 11 comments
Closed

CUDA setup issue #971

MarkDeng1 opened this issue Jan 17, 2024 · 11 comments

Comments

@MarkDeng1
Copy link

MarkDeng1 commented Jan 17, 2024

System Info

cuda version = 12.2
Python version = 3.9
I'm sure cuda is available, but I cannot run bitsandbytes

Reproduction

The error report is that :

(qlora) D:\working\Swinburne_work\LLMs\LLM Quantization\qlora-main\qlora-main>python -m bitsandbytes
False

===================================BUG REPORT===================================
D:\Anaconda\envs\qlora\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('D')}
D:\Anaconda\envs\qlora\lib\site-packages\bitsandbytes\cuda_setup\main.py:167: UserWarning: D:\Anaconda\envs\qlora did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths...
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: {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.9.
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 D:\Anaconda\envs\qlora\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 "D:\Anaconda\envs\qlora\lib\runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, Error)
File "D:\Anaconda\envs\qlora\lib\runpy.py", line 147, in get_module_details
return get_module_details(pkg_main_name, error)
File "D:\Anaconda\envs\qlora\lib\runpy.py", line 111, in get_module_details
import(pkg_name)
File "D:\Anaconda\envs\qlora\lib\site-packages\bitsandbytes_init
.py", line 6, in
from . import cuda_setup, utils, research
File "D:\Anaconda\envs\qlora\lib\site-packages\bitsandbytes\research_init
.py", line 1, in
from . import nn
File "D:\Anaconda\envs\qlora\lib\site-packages\bitsandbytes\research\nn_init.py", line 1, in
from .modules import LinearFP8Mixed, LinearFP8Global
File "D:\Anaconda\envs\qlora\lib\site-packages\bitsandbytes\research\nn\modules.py", line 8, in
from bitsandbytes.optim import GlobalOptimManager
File "D:\Anaconda\envs\qlora\lib\site-packages\bitsandbytes\optim_init.py", line 6, in
from bitsandbytes.cextension import COMPILED_WITH_CUDA
File "D:\Anaconda\envs\qlora\lib\site-packages\bitsandbytes\cextension.py", line 20, 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

Expected behavior

using bitsandbytes with cuda

@mwzkhalil
Copy link

having same issue...
`RuntimeError: Failed to import transformers.integrations.bitsandbytes because of the following error (look up to see its traceback):

    CUDA Setup failed despite GPU being available. Inspect the CUDA SETUP outputs above to fix your environment!
    If you cannot find any issues and suspect a bug, please open an issue with detals about your environment:
    https://github.com/TimDettmers/bitsandbytes/issues`

@virtualpeer
Copy link

having same issue...

1 similar comment
@moyuii
Copy link

moyuii commented Jan 18, 2024

having same issue...

@mwzkhalil
Copy link

If the issue occurred while you were preparing the model, please utilize the prepare_model_for_kbit_training function.

@moyuii
Copy link

moyuii commented Jan 18, 2024

having same issue...

System Info

cuda version = 12.2
Python version = 3.9

compile from source:

mkdir -p build
mkdir -p dependencies
ENVIRONMENT

CUDA_VERSION: 122

NVCC path: /usr/bin/nvcc
GPP path: /usr/bin/g++ VERSION: g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
CUDA_HOME: /usr
CONDA_PREFIX:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
LD_LIBRARY_PATH:

/usr/bin/nvcc -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 -Xcompiler '-fPIC' --use_fast_math -Xptxas=-v -dc /home/user/tests/bitsandbytes-main/csrc/ops.cu /home/user/tests/bitsandbytes-main/csrc/kernels.cu -I /usr/include -I /home/user/tests/bitsandbytes-main/csrc -I /include -I /home/user/tests/bitsandbytes-main/include -L /usr/lib64 -lcudart -lcublas -lcublasLt -lcusparse -L /lib --output-directory /home/user/tests/bitsandbytes-main/build
nvcc fatal : Unsupported gpu architecture 'compute_89'
make: *** [Makefile:111: cuda12x] Error 1

@Sturmkater
Copy link

Have the same issue, but on Linux:-(

@motoko33
Copy link

Having the same issue on windows......

@MatthiasKohl
Copy link

MatthiasKohl commented Feb 6, 2024

Please take a look at whether you can work with the instructions described here: #1042

specifically:

cmake -B . -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=[your compute capability] -S .
cmake --build .

since you're likely running into an issue with some of the compute capabilities not supported for your version of nvcc

@Nethramudhiraj
Copy link

If the issue occurred while you were preparing the model, please utilize the prepare_model_for_kbit_training function.

Hi @MatthiasKohl can u elaborate more about 'prepare_model_for_kbit_training` '

@TonyLv
Copy link

TonyLv commented Mar 13, 2024

Have the same issue on Ubutu

image

@Titus-von-Koeller
Copy link
Collaborator

Dear all,

Since the current release (last week, 8th of March) we now have official support for Windows 🎉 (which we did not have before) via

pip install bitsandbytes>=0.43.0

We're closing all old Windows issues and are asking everyone to try installing with this new version as outlined above and validate the install with python -m bitsandbytes which should spit out a bunch of stuff and then SUCCESS. Please let us know if everything worked correctly in this new umbrella / catch-all issue. Thanks 🤗

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

10 participants