Skip to content

Commit 9836b0b

Browse files
committed
fix: Use raw int
1 parent eb54c55 commit 9836b0b

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

bitsandbytes/cuda_setup/main.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -275,23 +275,22 @@ def determine_cuda_runtime_lib_path() -> Union[Path, None]:
275275
return next(iter(cuda_runtime_libs)) if cuda_runtime_libs else None
276276

277277

278-
def check_cuda_result(cuda, result_val):
279-
# 3. Check for CUDA errors
280-
if result_val != 0:
281-
error_str = ct.c_char_p()
282-
cuda.cuGetErrorString(result_val, ct.byref(error_str))
283-
if error_str.value is not None:
284-
CUDASetup.get_instance().add_log_entry(f"CUDA exception! Error code: {error_str.value.decode()}")
285-
else:
286-
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.")
278+
# def check_cuda_result(cuda, result_val):
279+
# # 3. Check for CUDA errors
280+
# if result_val != 0:
281+
# error_str = ct.c_char_p()
282+
# cuda.cuGetErrorString(result_val, ct.byref(error_str))
283+
# if error_str.value is not None:
284+
# CUDASetup.get_instance().add_log_entry(f"CUDA exception! Error code: {error_str.value.decode()}")
285+
# else:
286+
# 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.")
287287

288288

289289
# https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART____VERSION.html#group__CUDART____VERSION
290290
def get_cuda_version(cuda, cudart_path):
291291
if cuda is None: return None
292292

293293
version = torch._C._cuda_getCompiledVersion()
294-
version = int(version.value)
295294
major = version//1000
296295
minor = (version-(major*1000))//10
297296

@@ -308,7 +307,7 @@ def get_cuda_lib_handle():
308307
except OSError:
309308
CUDASetup.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!')
310309
return None
311-
check_cuda_result(cuda, cuda.cuInit(0))
310+
# check_cuda_result(cuda, cuda.cuInit(0))
312311

313312
return cuda
314313

0 commit comments

Comments
 (0)