Fix Linux CPU build: add spirv-headers dependency#872
Conversation
llama.cpp commit 1f30ac0 (PR #21572) added #include <spirv/unified1/spirv.hpp> to ggml-vulkan.cpp, which requires the spirv-headers package to be installed. This fixes the build_native_linux_cpu CI job failure.
There was a problem hiding this comment.
Code Review
This pull request updates the Vulkan installation script to include the spirv-headers package. The review feedback recommends improving the reliability and efficiency of the installation process by adding a package index update and cleaning up the apt cache, which ensures consistent builds and reduces the final image size.
| set -eux -o pipefail | ||
|
|
||
| apt-get install -y glslc libvulkan-dev | ||
| apt-get install -y glslc libvulkan-dev spirv-headers |
There was a problem hiding this comment.
Running apt-get install without a preceding apt-get update in the same execution block can lead to build failures in Docker environments if the package index is stale. Additionally, cleaning up /var/lib/apt/lists/* is best practice to maintain consistency with other scripts in the repository (such as scripts/apt-install.sh) and to minimize the footprint of the build layer.
| apt-get install -y glslc libvulkan-dev spirv-headers | |
| apt-get update | |
| apt-get install -y glslc libvulkan-dev spirv-headers | |
| rm -rf /var/lib/apt/lists/* |
References
- The repository style guide prioritizes correctness and maintainability. Ensuring a reliable build process by updating package indexes and cleaning up is essential for these goals. (link)
The
build_native_linux_cpujob is failing with:This is caused by llama.cpp PR #21572 which added a dependency on
spirv-headersfor the Vulkan backend. The llama.cpp CI was already updated in PR #22109 to install this package.This PR adds
spirv-headerstoinstall-vulkan.shto fix the build.Fixes: https://github.com/docker/inference-engine-llama.cpp/actions/runs/24664691885/job/72119213249