Skip to content

Latest commit

 

History

History
111 lines (73 loc) · 2.96 KB

File metadata and controls

111 lines (73 loc) · 2.96 KB

Windows setup notes

Prerequisites

Install Rust (stable):

winget install --id Rustlang.Rustup -e

Install Visual Studio Build Tools (C++ workload):

winget install --id Microsoft.VisualStudio.2022.BuildTools -e

Install Git:

winget install --id Git.Git -e

Clone with submodules

git clone --recursive https://github.com/eugenehp/llama-cpp-rs
cd llama-cpp-rs

If already cloned without submodules:

git submodule update --init --recursive

Vulkan build prerequisites

Install Vulkan SDK (includes headers, loader, and glslc):

choco install vulkan-sdk -y

The build script automatically detects the Vulkan SDK by checking:

  1. The VULKAN_SDK environment variable (if set).
  2. The Windows registry (HKLM\SOFTWARE\LunarG\VulkanSDK).
  3. 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 --summary

Build

cargo build
cargo build --features vulkan

Common Vulkan errors

If 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.

Prebuilt release artifacts (Vulkan)

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.gz
  • llama-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 vulkan

To rebuild only Windows Vulkan prebuilts manually, run Build prebuilt llama artifacts (workflow_dispatch) with platform=windows, variant=vulkan, and library_type=static or dynamic.

CI check

The repository CI includes a Windows Vulkan build check in:

  • .github/workflows/llama-cpp-rs-check.yml