From b3de19218e118b18dd1139bcd83e965733d701f4 Mon Sep 17 00:00:00 2001 From: Tim Dettmers Date: Tue, 3 Jan 2023 06:57:07 -0800 Subject: [PATCH] Added error message for unexpected CUDA exception. --- bitsandbytes/cuda_setup/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bitsandbytes/cuda_setup/main.py b/bitsandbytes/cuda_setup/main.py index b0eb405..ce44d97 100644 --- a/bitsandbytes/cuda_setup/main.py +++ b/bitsandbytes/cuda_setup/main.py @@ -268,7 +268,10 @@ def check_cuda_result(cuda, result_val): if result_val != 0: error_str = ct.c_char_p() cuda.cuGetErrorString(result_val, ct.byref(error_str)) - CUDASetup.get_instance().add_log_entry(f"CUDA exception! Error code: {error_str.value.decode()}") + if error_str.value is not None: + CUDASetup.get_instance().add_log_entry(f"CUDA exception! Error code: {error_str.value.decode()}") + else: + 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.") # https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART____VERSION.html#group__CUDART____VERSION