self.add_log_entry('CUDA SETUP: CUDA detection failed. Either CUDA driver not installed, CUDA not installed, or you have multiple conflicting CUDA libraries!')
self.lib=ct.cdll.LoadLibrary(binary_path)
self.add_log_entry('CUDA SETUP: If you compiled from source, try again with `make CUDA_VERSION=DETECTED_CUDA_VERSION` for example, `make CUDA_VERSION=113`.')
print('CUDA SETUP: CUDA version lower than 11 are currenlty not supported for LLM.int8(). You will be only to use 8-bit optimizers and quantization routines!!')
CUDASetup.get_instance().add_log_entry('CUDA SETUP: CUDA version lower than 11 are currenlty not supported for LLM.int8(). You will be only to use 8-bit optimizers and quantization routines!!')
returnf'{major}{minor}'
returnf'{major}{minor}'
...
@@ -54,8 +54,7 @@ def get_cuda_lib_handle():
...
@@ -54,8 +54,7 @@ def get_cuda_lib_handle():
try:
try:
cuda=ctypes.CDLL("libcuda.so")
cuda=ctypes.CDLL("libcuda.so")
exceptOSError:
exceptOSError:
# TODO: shouldn't we error or at least warn here?
CUDA_RUNTIME_LIB.get_instance().add_log_entry('CUDA SETUP: WARNING! libcuda.so not found! Do you have a CUDA driver installed? If you are on a cluster, make sure you are on a CUDA machine!')
print('CUDA SETUP: WARNING! libcuda.so not found! Do you have a CUDA driver installed? If you are on a cluster, make sure you are on a CUDA machine!')
print('Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues')
#print('='*35 + 'BUG REPORT' + '='*35)
print('For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link')
#print('Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues')
print('='*80)
#print('For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link')
binary_name="libbitsandbytes_cpu.so"
#print('='*80)
#if not torch.cuda.is_available():
#if not torch.cuda.is_available():
#print('No GPU detected. Loading CPU library...')
#print('No GPU detected. Loading CPU library...')
#return binary_name
#return binary_name
binary_name="libbitsandbytes_cpu.so"
cuda_setup=CUDASetup.get_instance()
cudart_path=determine_cuda_runtime_lib_path()
cudart_path=determine_cuda_runtime_lib_path()
ifcudart_pathisNone:
ifcudart_pathisNone:
print(
cuda_setup.add_log_entry("WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)!",is_warning=True)
"WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)!"
)
returnbinary_name
returnbinary_name
print(f"CUDA SETUP: CUDA runtime path found: {cudart_path}")
cuda_setup.add_log_entry((f"CUDA SETUP: CUDA runtime path found: {cudart_path}"))
cuda=get_cuda_lib_handle()
cuda=get_cuda_lib_handle()
cc=get_compute_capability(cuda)
cc=get_compute_capability(cuda)
print(f"CUDA SETUP: Highest compute capability among GPUs detected: {cc}")
cuda_setup.add_log_entry(f"CUDA SETUP: Highest compute capability among GPUs detected: {cc}")