summaryrefslogtreecommitdiff
path: root/bitsandbytes/cuda_setup
diff options
context:
space:
mode:
authorTim Dettmers <TimDettmers@users.noreply.github.com>2022-09-05 16:29:25 -0700
committerGitHub <noreply@github.com>2022-09-05 16:29:25 -0700
commitaca55881b9815a462142f42f3ff0dc917830d85c (patch)
tree75477acfbce2da2a753ee21d4cf0da64f3f50ea5 /bitsandbytes/cuda_setup
parent92a3363096e10ad6a5c4e944af898bd1186d806a (diff)
parenteab4d8232d558f2e6bd7f7cc3d00e2e6e94f4e80 (diff)
Merge branch 'main' into remove_unused_code
Diffstat (limited to 'bitsandbytes/cuda_setup')
-rw-r--r--bitsandbytes/cuda_setup/main.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bitsandbytes/cuda_setup/main.py b/bitsandbytes/cuda_setup/main.py
index ba7e04c..78a2844 100644
--- a/bitsandbytes/cuda_setup/main.py
+++ b/bitsandbytes/cuda_setup/main.py
@@ -26,7 +26,7 @@ def check_cuda_result(cuda, result_val):
if result_val != 0:
error_str = ctypes.c_char_p()
cuda.cuGetErrorString(result_val, ctypes.byref(error_str))
- raise Exception(f"CUDA exception! Error code: {error_str.value.decode()}")
+ print(f"CUDA exception! Error code: {error_str.value.decode()}")
def get_cuda_version(cuda, cudart_path):
# https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART____VERSION.html#group__CUDART____VERSION
@@ -55,7 +55,7 @@ def get_cuda_lib_handle():
cuda = ctypes.CDLL("libcuda.so")
except OSError:
# TODO: shouldn't we error or at least warn here?
- raise Exception('CUDA SETUP: ERROR! 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!')
return None
check_cuda_result(cuda, cuda.cuInit(0))
@@ -116,6 +116,10 @@ def evaluate_cuda_setup():
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('='*80)
binary_name = "libbitsandbytes_cpu.so"
+ #if not torch.cuda.is_available():
+ #print('No GPU detected. Loading CPU library...')
+ #return binary_name
+
cudart_path = determine_cuda_runtime_lib_path()
if cudart_path is None:
print(