Install Rust (stable):
winget install --id Rustlang.Rustup -eInstall Visual Studio Build Tools (C++ workload):
winget install --id Microsoft.VisualStudio.2022.BuildTools -eInstall Git:
winget install --id Git.Git -egit clone --recursive https://github.com/eugenehp/llama-cpp-rs
cd llama-cpp-rsIf already cloned without submodules:
git submodule update --init --recursiveInstall Vulkan SDK (includes headers, loader, and glslc):
choco install vulkan-sdk -yThe build script automatically detects the Vulkan SDK by checking:
- The
VULKAN_SDKenvironment variable (if set). - The Windows registry (
HKLM\SOFTWARE\LunarG\VulkanSDK). - The default install directory
C:\VulkanSDK\<latest version>.
If automatic detection fails, set the SDK path manually for the current session (PowerShell):
$latest = Get-ChildItem 'C:\VulkanSDK' -Directory | Sort-Object Name -Descending | Select-Object -First 1
$env:VULKAN_SDK = $latest.FullName
$env:Path = "$($latest.FullName)\Bin;$env:Path"Verify tools:
glslc --version
vulkaninfo --summarycargo build
cargo build --features vulkanIf you see:
Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR glslc)
then the Vulkan SDK is not installed correctly. The build script tries to find it automatically, but if that fails, ensure VULKAN_SDK is set and glslc is on your PATH.
If CMake fails with Could NOT find SPIRV-Headers, the LunarG SDK install is incomplete or stale. Reinstall the SDK, then set (PowerShell):
$env:VULKAN_SDK = 'C:\VulkanSDK\<version>'
$env:CMAKE_PREFIX_PATH = $env:VULKAN_SDK
$env:SPIRV-Headers_DIR = Join-Path $env:VULKAN_SDK 'SPIRV-Headers'The build script passes SPIRV-Headers_DIR and CMAKE_PREFIX_PATH to CMake automatically when it detects the SDK; the variables above are only needed when overriding detection.
On each v* tag, CI builds and uploads Windows Vulkan prebuilts (static and dynamic) to the GitHub release:
llama-prebuilt-windows-x86_64-pc-windows-msvc-vulkan-static.tar.gzllama-prebuilt-windows-x86_64-pc-windows-msvc-vulkan-dynamic.tar.gz
Extract and point LLAMA_PREBUILT_DIR at the unpacked directory:
tar -xzf llama-prebuilt-windows-x86_64-pc-windows-msvc-vulkan-static.tar.gz -C .\prebuilt
$env:LLAMA_PREBUILT_DIR = (Resolve-Path .\prebuilt).Path
cargo build --features vulkanTo rebuild only Windows Vulkan prebuilts manually, run Build prebuilt llama artifacts (workflow_dispatch) with platform=windows, variant=vulkan, and library_type=static or dynamic.
The repository CI includes a Windows Vulkan build check in:
.github/workflows/llama-cpp-rs-check.yml