Skip to content

Vulkan prebuilt binary has undefined symbol ggml_build_forward_select #579

@Novite5

Description

@Novite5

Issue: Vulkan prebuilt binary has undefined symbol ggml_build_forward_select

Environment

  • OS: Linux (Arch Linux)
  • Node.js: v22.22.1
  • node-llama-cpp: 3.15.0, 3.16.2, 3.17.1 (tested all)
  • qmd: 2.0.1 (depends on node-llama-cpp)

Description

When running qmd embed command (which uses node-llama-cpp), the Vulkan prebuilt binary fails to load with:

node: symbol lookup error: .../libllama.vulkan.b8179.so: undefined symbol: ggml_build_forward_select

This happens on all tested versions (3.15.0, 3.16.2, 3.17.1) on Linux with AMD Vulkan (RADV KAVERI).

Root Cause Analysis

The Vulkan .so files have a broken dependency chain:

  1. libllama.vulkan.b8179.so requires symbol ggml_build_forward_select
  2. It depends on libggml.vulkan.b8179.so (54KB shim)
  3. libggml.vulkan.b8179.so only links to libggml-base.so (742KB)
  4. The 57MB libggml-vulkan.so is NOT linked - this is the actual Vulkan implementation that contains the required symbols

Symbol check:

$ nm -D libggml-base.so | grep ggml_build_forward_select
00000000000289f0 T ggml_build_forward_select  # Exists in base

$ nm -D libggml.vulkan.b8179.so | grep ggml_build_forward
(nothing - it's an UNDEF)

$ ldd libggml.vulkan.b8179.so
libggml-base.so => found
# Missing: libggml-vulkan.so is NOT linked!

Expected Behavior

Vulkan binary should either:

  1. Link to libggml-vulkan.so at runtime, OR
  2. Include the required symbols in libggml.vulkan.b8179.so

Current Workaround

Set gpu: false in getLlama() options to use CPU backend.

Steps to Reproduce

  1. Install @tobilu/qmd with node-llama-cpp
  2. Run qmd embed on Linux with AMD GPU (Vulkan support)
  3. Observe the symbol lookup error

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