Skip to content

Fix Vulkan builds with SPIRV-Headers outside system include paths - #14

Open
richiejp wants to merge 1 commit into
mainfrom
fix/spirv-header-includes
Open

richiejp wants to merge 1 commit into
mainfrom
fix/spirv-header-includes

Conversation

@richiejp

@richiejp richiejp commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #12.

Link ggml-vulkan privately to the header-only SPIRV-Headers::SPIRV-Headers target so headers found through CMAKE_PREFIX_PATH also reach the compiler. Import the already-discovered package in the parent scope before linking: GGML's imported target is scoped to its subdirectory.

System-installed headers continue to work through the same package target. No runtime library is added, no global include path is changed, and Vulkan-disabled builds do not discover or depend on SPIRV-Headers. The GGML submodule remains unchanged.

Add an Ubuntu CI matrix for system headers, headers relocated to a custom prefix, and Vulkan disabled. The custom-prefix job verifies the header is absent from the compiler's default search path and checks the actual ggml-vulkan.cpp compile command before building. No model weights or GPU are required.

Local validation passed: reproduced the missing-header failure by removing only the propagated include from the Vulkan compile command; built the project with a custom-prefix package and inherited SPIRV include paths removed from the Nix environment; built the main library/executable with Vulkan and SPIRV package discovery disabled. Three fixture-independent tests and a 30-frame Vulkan generation smoke test passed.

Companion PR: localai-org/skin-tokens.cpp#6.

CI validation: all three Ubuntu jobs passed (system headers, custom-prefix headers, and Vulkan disabled).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build: ggml-vulkan.cpp fails with "spirv/unified1/spirv.hpp: No such file" although find_package(SPIRV-Headers) succeeded

1 participant