Skip to content

Commit 66c7d75

Browse files
committed
Enhanced text-based bootstrapping for Vulkan compilation and improved recognition of Win32 Vulkan libraries.
Signed-off-by: JamePeng <jame_peng@sina.com>
1 parent c278dd4 commit 66c7d75

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ CMAKE_ARGS="-DGGML_HIPBLAS=on" pip install llama-cpp-python
172172
<details>
173173
<summary>Vulkan</summary>
174174

175-
To install with Vulkan support, set the `GGML_VULKAN=on` environment variable before installing:
175+
- For Windows User: Download and install the [`Vulkan SDK`](https://vulkan.lunarg.com/sdk/home#windows) with the default settings.
176+
177+
- For Linux User: Follow the official LunarG instructions for the installation and setup of the Vulkan SDK in the [Getting Started with the Linux Tarball Vulkan SDK](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html) guide.
178+
179+
Then install with Vulkan support by set the `GGML_VULKAN=on` environment variable before installing:
176180

177181
```bash
178182
CMAKE_ARGS="-DGGML_VULKAN=on" pip install llama-cpp-python

llama_cpp/_ctypes_extensions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ def load_shared_library(lib_base_name: str, base_path: pathlib.Path):
6767
if "HIP_PATH" in os.environ:
6868
os.add_dll_directory(os.path.join(os.environ["HIP_PATH"], "bin"))
6969
os.add_dll_directory(os.path.join(os.environ["HIP_PATH"], "lib"))
70+
71+
if "VULKAN_SDK" in os.environ:
72+
os.add_dll_directory(os.path.join(os.environ["VULKAN_SDK"], "Bin"))
73+
os.add_dll_directory(os.path.join(os.environ["VULKAN_SDK"], "Lib"))
74+
7075
cdll_args["winmode"] = ctypes.RTLD_GLOBAL
7176

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

0 commit comments

Comments
 (0)