Skip to content

Commit 2f0f0e5

Browse files
committed
get_cuda_lib_handle brought back so import works
1 parent 6ec4f0c commit 2f0f0e5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bitsandbytes/cuda_setup/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,13 @@ def evaluate_cuda_setup():
360360
binary_name = f"libbitsandbytes_cuda{cuda_version_string}_nocublaslt.so"
361361

362362
return binary_name, cudart_path, cc, cuda_version_string
363+
364+
def get_cuda_lib_handle():
365+
# 1. find libcuda.so library (GPU driver) (/usr/lib)
366+
try:
367+
cuda = ct.CDLL("libcuda.so")
368+
except OSError:
369+
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!')
370+
return None
371+
372+
return cuda

0 commit comments

Comments
 (0)