bitsandbytes: "CUDA Setup failed despite GPU being available" - when running python -m bitsandbytes
False
===================================BUG REPORT=================================== /anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/cuda_setup/main.py:166: UserWarning: Welcome to bitsandbytes. For bug reports, please run
python -m bitsandbytes
warn(msg)
/anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/cuda_setup/main.py:166: UserWarning: /anaconda/envs/azureml_py38 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: {PosixPath(‘/opt/intel/compilers_and_libraries_2018.3.222/linux/mpi/mic/lib’), PosixPath(‘/usr/local/cuda/extras/CUPTI/lib64’)} /anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/cuda_setup/main.py:166: UserWarning: Found duplicate [‘libcudart.so’, ‘libcudart.so.11.0’, ‘libcudart.so.12.0’] files: {PosixPath(‘/usr/local/cuda/lib64/libcudart.so’), PosixPath(‘/usr/local/cuda/lib64/libcudart.so.11.0’), PosixPath(‘/anaconda/envs/azureml_py38/lib/libcudart.so’)}… We select the PyTorch default libcudart.so, which is {torch.version.cuda},but this might missmatch with the CUDA version that is needed for bitsandbytes.To override this behavior set the BNB_CUDA_VERSION=<version string, e.g. 122> environmental variableFor example, if you want to use the CUDA version 122BNB_CUDA_VERSION=122 python …OR set the environmental variable in your .bashrc: export BNB_CUDA_VERSION=122In the case of a manual override, make sure you set the LD_LIBRARY_PATH, e.g.export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.2 warn(msg) /anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/cuda_setup/main.py:166: UserWarning: /opt/intel/compilers_and_libraries_2018.3.222/linux/mpi/intel64/lib:/opt/intel/compilers_and_libraries_2018.3.222/linux/mpi/mic/lib:/opt/intel/compilers_and_libraries_2018.3.222/linux/mpi/intel64/lib:/opt/intel/compilers_and_libraries_2018.3.222/linux/mpi/mic/lib::/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64/:/anaconda/envs/azureml_py38/lib/:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64/:/anaconda/envs/azureml_py38/lib/ 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: {PosixPath(‘-DCMAKE_AR=/anaconda/envs/azureml_py38/bin/x86_64-conda-linux-gnu-ar -DCMAKE_CXX_COMPILER_AR=/anaconda/envs/azureml_py38/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_C_COMPILER_AR=/anaconda/envs/azureml_py38/bin/x86_64-conda-linux-gnu-gcc-ar -DCMAKE_RANLIB=/anaconda/envs/azureml_py38/bin/x86_64-conda-linux-gnu-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/anaconda/envs/azureml_py38/bin/x86_64-conda-linux-gnu-gcc-ranlib -DCMAKE_C_COMPILER_RANLIB=/anaconda/envs/azureml_py38/bin/x86_64-conda-linux-gnu-gcc-ranlib -DCMAKE_LINKER=/anaconda/envs/azureml_py38/bin/x86_64-conda-linux-gnu-ld -DCMAKE_STRIP=/anaconda/envs/azureml_py38/bin/x86_64-conda-linux-gnu-strip’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘8888’), PosixPath(‘http’), PosixPath(‘//localhost’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /anaconda/envs/azureml_py38/include’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -ffunction-sections -pipe -isystem /anaconda/envs/azureml_py38/include’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘-Wl,-O2 -Wl,–sort-common -Wl,–as-needed -Wl,-z,relro -Wl,-z,now -Wl,–disable-new-dtags -Wl,–gc-sections -Wl,-rpath,/anaconda/envs/azureml_py38/lib -Wl,-rpath-link,/anaconda/envs/azureml_py38/lib -L/anaconda/envs/azureml_py38/lib’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘//eastus.api.azureml.ms/mlflow/v1.0/subscriptions/d0e6d200-b258-43fc-b02e-46e3b60eadda/resourceGroups/lama_2_expt/providers/Microsoft.MachineLearningServices/workspaces/lama2’), PosixPath(‘azureml’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -ffunction-sections -pipe -isystem /anaconda/envs/azureml_py38/include’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /anaconda/envs/azureml_py38/include’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘//127.0.0.1’), PosixPath(‘46808/OBO/token’), PosixPath(‘http’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘/usr/local/cuda/extras/CUPTI/lib64’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘-D_DEBUG -D_FORTIFY_SOURCE=2 -Og -isystem /anaconda/envs/azureml_py38/include’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘/usr/local/cuda/extras/CUPTI/lib64’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘/usr/lib/node_modules’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘//127.0.0.1’), PosixPath(‘46808/MSI/auth’), PosixPath(‘http’)} The following directories listed in your path were found to be non-existent: {PosixPath(‘-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /anaconda/envs/azureml_py38/include’)} /anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/cuda_setup/main.py:166: UserWarning: Found duplicate [‘libcudart.so’, ‘libcudart.so.11.0’, ‘libcudart.so.12.0’] files: {PosixPath(‘/usr/local/cuda/lib64/libcudart.so’), PosixPath(‘/usr/local/cuda/lib64/libcudart.so.11.0’)}… We select the PyTorch default libcudart.so, which is {torch.version.cuda},but this might missmatch with the CUDA version that is needed for bitsandbytes.To override this behavior set the BNB_CUDA_VERSION=<version string, e.g. 122> environmental variableFor example, if you want to use the CUDA version 122BNB_CUDA_VERSION=122 python …OR set the environmental variable in your .bashrc: export BNB_CUDA_VERSION=122In the case of a manual override, make sure you set the LD_LIBRARY_PATH, e.g.export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.2 warn(msg) DEBUG: Possible options found for libcudart.so: {PosixPath(‘/usr/local/cuda/lib64/libcudart.so’), PosixPath(‘/usr/local/cuda/lib64/libcudart.so.11.0’)} CUDA SETUP: CUDA version lower than 11 are currently not supported for LLM.int8(). You will be only to use 8-bit optimizers and quantization routines!! CUDA SETUP: PyTorch settings found: CUDA_VERSION=102, Highest Compute Capability: 3.7. CUDA SETUP: To manually override the PyTorch CUDA version please see:https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md /anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/cuda_setup/main.py:166: 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: Required library version not found: libbitsandbytes_cuda102_nocublaslt.so. Maybe you need to compile it from source? CUDA SETUP: Defaulting to libbitsandbytes_cpu.so…
================================================ERROR===================================== CUDA SETUP: CUDA detection failed! Possible reasons:
- You need to manually override the PyTorch CUDA version. Please see: "https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md
- CUDA driver not installed
- CUDA not installed
- You have multiple conflicting CUDA libraries
- Required library not pre-compiled for this bitsandbytes release!
CUDA SETUP: If you compiled from source, try again with
make CUDA_VERSION=DETECTED_CUDA_VERSIONfor example,make CUDA_VERSION=113. CUDA SETUP: The CUDA version for the compile might depend on your conda install. Inspect CUDA version viaconda list | grep cuda. ================================================================================
CUDA SETUP: Something unexpected happened. Please compile from source: git clone https://github.com/TimDettmers/bitsandbytes.git cd bitsandbytes CUDA_VERSION=102_nomatmul python setup.py install CUDA SETUP: Setup Failed! Traceback (most recent call last): File “/anaconda/envs/azureml_py38/lib/python3.8/runpy.py”, line 185, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File “/anaconda/envs/azureml_py38/lib/python3.8/runpy.py”, line 144, in _get_module_details return _get_module_details(pkg_main_name, error) File “/anaconda/envs/azureml_py38/lib/python3.8/runpy.py”, line 111, in _get_module_details import(pkg_name) File “/anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/init.py”, line 6, in <module> from . import cuda_setup, utils, research File “/anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/research/init.py”, line 1, in <module> from . import nn File “/anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/research/nn/init.py”, line 1, in <module> from .modules import LinearFP8Mixed, LinearFP8Global File “/anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/research/nn/modules.py”, line 8, in <module> from bitsandbytes.optim import GlobalOptimManager File “/anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/bitsandbytes/optim/init.py”, line 6, in <module> from bitsandbytes.cextension import COMPILED_WITH_CUDA File “/anaconda/envs/azureml_py38/lib/python3.8/site-packages/bitsandbytes-0.41.1-py3.8.egg/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
- Reactions: 8
- Comments: 18
re-install bitsandbytes with these,make sure to set cuda version to your cuda: `pip uninstall bitsandbytes git clone https://github.com/TimDettmers/bitsandbytes.git cd bitsandbytes make CUDA_VERSION=117 #your CUDA_VERSION python setup.py install```
I solved it by updating torch from 1.13.1 to 2.0.1 and torchvison from 0.14.1 to 0.15.2.
This issue wasn’t solved