Skip to content

Commit

Permalink
Merge pull request #27 from one-lithe-rune/allow-sdk-dll-loading - Al…
Browse files Browse the repository at this point in the history
…low use of hip SDK (if installed) dlls on windows

* 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.
  • Loading branch information
one-lithe-rune authored and YellowRoseCx committed Oct 9, 2023
1 parent f288c6b commit 6f3c1f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions koboldcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 6f3c1f7

Please sign in to comment.