Skip to content

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

Open
ggml-org/llama.cpp
#31416

Description

@jtpauline

Repro (CachyOS Linux, gcc 16.2, CMake 4.4.4, Vulkan 1.4 headers + glslc installed, no system spirv-headers package; SPIRV-Headers installed to a local prefix passed via CMAKE_PREFIX_PATH):

Configure succeeds — find_package(SPIRV-Headers) resolves from the prefix and the Vulkan backend is enabled — but the build then fails:

ggml/src/ggml-vulkan/ggml-vulkan.cpp:48:14: fatal error: spirv/unified1/spirv.hpp: No such file or directory

The found package include directory is not propagated onto the ggml-vulkan target compile line (no -I<prefix>/include present).

Workaround: export CPATH=<prefix>/include before cmake --build.

This reproduces identically in skin-tokens.cpp (its patched-ggml FetchContent build hits the same error at the same line). On distros that ship spirv-headers system-wide it is invisible, which is probably why CI never sees it.

Suggested fix: link the imported SPIRV-Headers::SPIRV-Headers target (or forward its INTERFACE_INCLUDE_DIRECTORIES) to ggml-vulkan where the superbuild wires up the submodule — or document spirv-headers as a required system dependency next to the Vulkan loader in the README.

Verified 2026-10-18 on both repos, ggml submodule 8c63e70.

Activity

  1. richiejp commented on Oct 30, 2026

    @richiejp
    Contributor

    This is actually an upstream problem in GGML/llama.cpp, so I'll try to fix it there

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions