diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a4090bb7..1b9f1854b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,7 +136,7 @@ elseif(BUILD_MPS) VERBATIM) add_custom_target(metallib DEPENDS "bitsandbytes/bitsandbytes.metallib") else() - set(LIBSUFFIX "cpu") + string(APPEND BNB_OUTPUT_NAME "_cpu") set(GPU_SOURCES) endif() diff --git a/bitsandbytes/cuda_setup/main.py b/bitsandbytes/cuda_setup/main.py index 4245a2842..14c7abbd8 100644 --- a/bitsandbytes/cuda_setup/main.py +++ b/bitsandbytes/cuda_setup/main.py @@ -28,16 +28,15 @@ from .env_vars import get_potentially_lib_path_containing_env_vars -if platform.system() == 'Windows': # Windows +DYNAMIC_LIBRARY_SUFFIX = { "Darwin": ".dylib", "Windows": ".dll", "Linux": ".so"}.get(platform.system(), ".so") +if platform.system() == "Windows": # Windows CUDA_RUNTIME_LIBS = ["nvcuda.dll"] - DYNAMIC_LIBRARY_SUFFIX = ".dll" else: # Linux or other # these are the most common libs names # libcudart.so is missing by default for a conda install with PyTorch 2.0 and instead # we have libcudart.so.11.0 which causes a lot of errors before # not sure if libcudart.so.12.0 exists in pytorch installs, but it does not hurt CUDA_RUNTIME_LIBS = ["libcudart.so", "libcudart.so.11.0", "libcudart.so.12.0", "libcudart.so.12.1", "libcudart.so.12.2"] - DYNAMIC_LIBRARY_SUFFIX = ".so" class CUDASetup: