8000 Check for CUDA_PATH before adding · chabotsi/llama-cpp-python@61d58e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 61d58e7

Browse files
committed
Check for CUDA_PATH before adding
1 parent 7c95895 commit 61d58e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llama_cpp/llama_cpp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def _load_shared_library(lib_base_name: str):
4848
# Add the library directory to the DLL search path on Windows (if needed)
4949
if sys.platform == "win32" and sys.version_info >= (3, 8):
5050
os.add_dll_directory(str(_base_path))
51-
os.add_dll_directory(os.path.join(os.environ["CUDA_PATH"],"bin"))
51+
if "CUDA_PATH" in os.environ:
52+
os.add_dll_directory(os.path.join(os.environ["CUDA_PATH"],"bin"))
53+< 4811 div class="diff-text-inner"> os.add_dll_directory(os.path.join(os.environ["CUDA_PATH"],"lib"))
5254
cdll_args["winmode"] = 0
5355

5456
# Try to load the shared library, handling potential errors

0 commit comments

Comments
 (0)
0