llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Compile bug: Nix flake fails to build llama-server

Open mbednarek360 opened this issue 6 months ago • 6 comments

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.

mbednarek360 avatar May 14 '26 17:05 mbednarek360

Getting the exact same error but on Gentoo Linux.

MiniatureEge2006 avatar May 14 '26 18:05 MiniatureEge2006

I went to build today and my firewall killed the process for trying to download something. ack!

jamcinnes2 avatar May 17 '26 23:05 jamcinnes2

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.

IamTheCarl avatar May 18 '26 15:05 IamTheCarl

#23156

either disable web UI or download Web UI files to another computer and copy them to the target computer.

vbooka1 avatar May 19 '26 19:05 vbooka1

"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.

IamTheCarl avatar May 19 '26 20:05 IamTheCarl

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)

choener avatar May 20 '26 00:05 choener