Compile bug: Nix flake fails to build llama-server
Git commit
834a243664114487f99520370a7a7b00fc7a486f
Operating systems
Linux
GGML backends
Vulkan
Problem description & steps to reproduce
The Nix flake fails to build llama-server with the Vulkan backend on Linux, likely related to https://github.com/ggml-org/llama.cpp/issues/23055.
First Bad Commit
253ba110bcd372207ca7b0bb56f1ea10d60d53fd
Compile command
llama-cpp = {
url = "github:ggml-org/llama.cpp";
inputs.nixpkgs.follows = "nixpkgs";
};
Relevant log output
llama-cpp-vulkan> [733/821] Building/provisioning WebUI assets (npm build -> HF Bucket fallback)
llama-cpp-vulkan> -- WebUI: npm not found, skipping npm build and trying HF Bucket download
llama-cpp-vulkan> -- WebUI: downloading assets from version: https://huggingface.co/buckets/ggml-org/llama-ui/resolve/b0
llama-cpp-vulkan> -- WebUI: failed to download index.html from version: "Could not resolve hostname"
llama-cpp-vulkan> -- WebUI: downloading assets from latest: https://huggingface.co/buckets/ggml-org/llama-ui/resolve/latest
llama-cpp-vulkan> -- WebUI: failed to download index.html from latest: "Could not resolve hostname"
llama-cpp-vulkan> CMake Warning at /build/source/scripts/webui-download.cmake:208 (message):
llama-cpp-vulkan> WebUI: failed to download assets from HF Bucket (llama-ui)
llama-cpp-vulkan>
llama-cpp-vulkan>
llama-cpp-vulkan> CMake Warning at /build/source/scripts/webui-download.cmake:220 (message):
llama-cpp-vulkan> WebUI: no source available. Neither local build
llama-cpp-vulkan> (/build/source/tools/server/webui) nor HF Bucket download succeeded.
llama-cpp-vulkan>
llama-cpp-vulkan>
llama-cpp-vulkan> CMake Warning at /build/source/scripts/webui-download.cmake:221 (message):
llama-cpp-vulkan> WebUI: building server without embedded WebUI. Set LLAMA_BUILD_WEBUI=OFF
llama-cpp-vulkan> to suppress this warning.
llama-cpp-vulkan>
llama-cpp-vulkan>
llama-cpp-vulkan> [734/821] Generating index.html.hpp
llama-cpp-vulkan> FAILED: [code=1] tools/server/index.html.hpp /build/source/build/tools/server/index.html.hpp
llama-cpp-vulkan> cd /build/source/build/tools/server && /nix/store/q800b7nrqa8csf2gcds2i83w1icsda5w-cmake-4.1.2/bin/cmake -DINPUT=/build/source/tools/server/public/index.html -DOUTPUT=/build/source/build/
tools/server/index.html.hpp -P /build/source/scripts/xxd.cmake
llama-cpp-vulkan> CMake Error at /build/source/scripts/xxd.cmake:13 (string):
llama-cpp-vulkan> string sub-command LENGTH requires two arguments.
Getting the exact same error but on Gentoo Linux.
I went to build today and my firewall killed the process for trying to download something. ack!
I had the same issue with my Nix flake. I found a horrible workaround by just disabling the WebUI:
llama-upstream.packages.${system}.vulkan.override { useWebUi = false; }
Obviously this is not a real solution, it's just dodging the problem and won't work for anyone who needs the WebUI.
#23156
either disable web UI or download Web UI files to another computer and copy them to the target computer.
"copy them to the target computer" does not work for the Nix builders because this is not an air-gap. It's a unique sandbox. Only files in the git tree or included derivations are allowed in the build sandbox.
I do think a proper fix for this is possible. It will probably consist of creating a nix derivation that does the download instead.
You can take a look at my changes here as inspiration for a clean Nix build: https://github.com/choener/llama.cpp/tree/choener/23067-fix-webui (Since I am a random person on the internet, please check the diff and don't just use it blindly)