Repository navigation
Fix SPIRV-Headers target to ggml-vulkan - #28951
Closed
uilianries wants to merge 1 commit into
Closed
uilianries wants to merge 1 commit into
uilianries wants to merge 1 commit into
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
4 tasks done
Contributor
|
The gpu-vulkan-apple CI failure is real, this change does not yet work on MacOS, at least on the runner. |
Contributor
|
Resolved by #31416 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Greetings! As we are updating llama-cpp in Conan Center, during a build with Vulkan support enabled on Linux, the following error was noted:
You can see the full build log here: llama-cpp-0.4.1-linux-amd64-gcc13-release-shared-error.log
Investigating a little, the
find_package(SPIRV-Headers CONFIG REQUIRED)(added in #22009, refined in #23215) only guarantees that the SPIRV-Headers config package is found. It does not propagateSPIRV-Headers::SPIRV-Headers's include directories anywhere, since nothing inggml/src/ggml-vulkan/CMakeLists.txtlinks that target. OnlyVulkan::Vulkanis linked intoggml-vulkan.When using sysroot/SDK-based setups (system packages), the SPIR-V headers happen to live
in the same globally-visible include tree as Vulkan itself, so
ggml-vulkan.cppresolves regardless of what's actually linked.That assumption breaks for package managers that install SPIRV-Headers into an isolated, non-shared prefix, like Conan. For every
__has_includebranch that fails, the unconditional fallback include also fails to resolve the header, and thespv::namespace ends up undeclared.The upstream, SPIRV-Headers, offers an official CMake target for its module:
SPIRV-Headers::SPIRV-Headers. See: https://github.com/KhronosGroup/SPIRV-Headers/blob/04fd3caa1e8267e4d95c806cad901181728e1006/CMakeLists.txt#L41This PR links
SPIRV-Headers::SPIRV-Headersexplicitly into ggml-vulkan so its include directories are always propagated, independent of how SPIRV-Headers was installed. The same pattern is already used for ggml-cpu a few lines below (#24444).After applying this patch, I can build without errors: llama-cpp-0.4.1-linux-amd64-gcc13-release-shared-patched.log
Requirements