Skip to content

"CUDA Setup failed despite GPU being available" - when running python -m bitsandbytes #679

Description

@Asrith-Dasari-AuxoAI

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:

  1. You need to manually override the PyTorch CUDA version. Please see: "https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md
  2. CUDA driver not installed
  3. CUDA not installed
  4. You have multiple conflicting CUDA libraries
  5. 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 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
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
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
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
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
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
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions