Skip to content

Commit eb54c55

Browse files
committed
fix: Get CUDA compiled version through pytorch
1 parent 97b2567 commit eb54c55

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

bitsandbytes/cuda_setup/main.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -290,19 +290,7 @@ def check_cuda_result(cuda, result_val):
290290
def get_cuda_version(cuda, cudart_path):
291291
if cuda is None: return None
292292

293-
try:
294-
cudart = ct.CDLL(cudart_path)
295-
except OSError:
296-
CUDASetup.get_instance().add_log_entry(f'ERROR: libcudart.so could not be read from path: {cudart_path}!')
297-
return None
298-
299-
version = ct.c_int()
300-
try:
301-
check_cuda_result(cuda, cudart.cudaRuntimeGetVersion(ct.byref(version)))
302-
except AttributeError as e:
303-
CUDASetup.get_instance().add_log_entry(f'ERROR: {str(e)}')
304-
CUDASetup.get_instance().add_log_entry(f'CUDA SETUP: libcudart.so path is {cudart_path}')
305-
CUDASetup.get_instance().add_log_entry(f'CUDA SETUP: Is seems that your cuda installation is not in your path. See https://github.com/TimDettmers/bitsandbytes/issues/85 for more information.')
293+
version = torch._C._cuda_getCompiledVersion()
306294
version = int(version.value)
307295
major = version//1000
308296
minor = (version-(major*1000))//10

0 commit comments

Comments
 (0)