From 1b25b2165537696ed1d64f8b8c49a59f7f9741ed Mon Sep 17 00:00:00 2001 From: YellowRoseCx <80486540+YellowRoseCx@users.noreply.github.com> Date: Tue, 10 Oct 2023 04:16:33 -0500 Subject: [PATCH] Merge pull request #27 from one-lithe-rune/allow-sdk-dll-loading - Allow use of hip SDK (if installed) dlls on windows (#470) * If the rocm/hip sdk is installed on windows, then include the sdk as a potential location to load the hipBlas/rocBlas .dlls from. This allows running koboldcpp.py directly with python after building work on windows without having to build the .exe and run that or copy .dlls around. Co-authored-by: one-lithe-rune --- koboldcpp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/koboldcpp.py b/koboldcpp.py index 27ca74bd2..099bcdbd0 100755 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -184,6 +184,10 @@ def init_library(): os.add_dll_directory(dir_path) os.add_dll_directory(abs_path) os.add_dll_directory(os.getcwd()) + if libname == lib_hipblas and "HIP_PATH" in os.environ: + os.add_dll_directory(os.path.join(os.environ["HIP_PATH"], "bin")) + if args.debugmode == 1: + print(f"HIP/ROCm SDK at {os.environ['HIP_PATH']} included in .DLL load path") handle = ctypes.CDLL(os.path.join(dir_path, libname)) handle.load_model.argtypes = [load_model_inputs]