From 2f0f0e5dbad568d720c2f395af5ffe6d045cd6de Mon Sep 17 00:00:00 2001 From: ihsanturk <132655771+ihsanturk@users.noreply.github.com> Date: Sat, 15 Jul 2023 02:24:46 -0700 Subject: [PATCH] get_cuda_lib_handle brought back so import works --- bitsandbytes/cuda_setup/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bitsandbytes/cuda_setup/main.py b/bitsandbytes/cuda_setup/main.py index 1aaf9a0..0d59b37 100644 --- a/bitsandbytes/cuda_setup/main.py +++ b/bitsandbytes/cuda_setup/main.py @@ -360,3 +360,13 @@ def evaluate_cuda_setup(): binary_name = f"libbitsandbytes_cuda{cuda_version_string}_nocublaslt.so" return binary_name, cudart_path, cc, cuda_version_string + +def get_cuda_lib_handle(): + # 1. find libcuda.so library (GPU driver) (/usr/lib) + try: + cuda = ct.CDLL("libcuda.so") + except OSError: + 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!') + return None + + return cuda \ No newline at end of file