Skip to content

Commit b3de192

Browse files
committed
Added error message for unexpected CUDA exception.
1 parent 8199049 commit b3de192

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bitsandbytes/cuda_setup/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,10 @@ def check_cuda_result(cuda, result_val):
268268
if result_val != 0:
269269
error_str = ct.c_char_p()
270270
cuda.cuGetErrorString(result_val, ct.byref(error_str))
271-
CUDASetup.get_instance().add_log_entry(f"CUDA exception! Error code: {error_str.value.decode()}")
271+
if error_str.value is not None:
272+
CUDASetup.get_instance().add_log_entry(f"CUDA exception! Error code: {error_str.value.decode()}")
273+
else:
274+
CUDASetup.get_instance().add_log_entry(f"Unknown CUDA exception! Please check your CUDA install. It might also be that your GPU is too old.")
272275

273276

274277
# https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART____VERSION.html#group__CUDART____VERSION

0 commit comments

Comments
 (0)