diff options
author | Tim Dettmers <tim.dettmers@gmail.com> | 2022-08-05 08:57:52 -0700 |
---|---|---|
committer | Tim Dettmers <tim.dettmers@gmail.com> | 2022-08-05 08:57:52 -0700 |
commit | c472bd56f0929573cd1b8bb2f5e0646b641923e7 (patch) | |
tree | 5da4185d6ae3ae4e6504a24e99fb9663c742272f /bitsandbytes | |
parent | 6ad8796cfcbf6da6f7aa33b7863721510582952e (diff) |
Added the case that all env variables are empty (CUDA docker).
Diffstat (limited to 'bitsandbytes')
-rw-r--r-- | bitsandbytes/cuda_setup/paths.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bitsandbytes/cuda_setup/paths.py b/bitsandbytes/cuda_setup/paths.py index b5e04f8..9c565c7 100644 --- a/bitsandbytes/cuda_setup/paths.py +++ b/bitsandbytes/cuda_setup/paths.py @@ -117,10 +117,16 @@ def determine_cuda_runtime_lib_path() -> Union[Path, None]: if env_var not in {"CONDA_PREFIX", "LD_LIBRARY_PATH"} } + + cuda_runtime_libs = set() - for env_var, value in remaining_candidate_env_vars: + for env_var, value in remaining_candidate_env_vars.items(): cuda_runtime_libs.update(find_cuda_lib_in(value)) + if len(cuda_runtime_libs) == 0: + print('CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...') + cuda_runtime_libs.update(find_cuda_lib_in('/usr/local/cuda/lib64')) + warn_in_case_of_duplicates(cuda_runtime_libs) return next(iter(cuda_runtime_libs)) if cuda_runtime_libs else None |