Skip to content

QVAC-23767 cmake: skip x86 cpu-feats helper in hybrid GGML_BACKEND_DL + GGML_CPU_STATIC builds - #61

Merged
DmitryMalishev merged 1 commit into
2026-08-11from
qvac-23767-x86-hybrid-cpu-feats
Aug 24, 2026
Merged

QVAC-23767 cmake: skip x86 cpu-feats helper in hybrid GGML_BACKEND_DL + GGML_CPU_STATIC builds#61
DmitryMalishev merged 1 commit into
2026-08-11from
qvac-23767-x86-hybrid-cpu-feats

Conversation

@DmitryMalishev

@DmitryMalishev DmitryMalishev commented Aug 20, 2026

Copy link
Copy Markdown

One cmake-only commit on top of the 2026-08-11 head (f31dab0): gate the x86 cpu-feats OBJECT helper on GGML_BACKEND_DL AND NOT GGML_CPU_STATIC.

Retargeted from 2026-07-03 per team policy — all new engine changes land on the current dev branch 2026-08-11; previous branches are frozen. Same one-line diff, rebased (ee3492494cb08a).

Why. The cpu-feats object implements the DL loader's CPU-variant score; it only means anything when the CPU backend itself is a dlopen'd module. In hybrid mode (GGML_BACKEND_DL=ON + GGML_CPU_STATIC=ON — the configuration the qvac ggml diffusion registry port uses) the CPU backend is a static library registered directly in-process and the score is never consulted. But the x86 path created the helper on GGML_BACKEND_DL alone and PRIVATE-linked it into the now-exported static ggml-cpu, so configure dies at:

CMake Error in CMakeLists.txt:
  install(EXPORT "ggml-targets" ...) includes target "ggml-cpu" which
  requires target "ggml-cpu-feats" that is not in any export set.

ARM never hit this because its ggml_add_cpu_backend_features call is gated on GGML_CPU_ALL_VARIANTS — which is why the Android hybrid (the only hybrid consumer until now) built fine. PowerPC/riscv/s390 sit under the same all-variants-style gating; x86 was the one arch with the bare GGML_BACKEND_DL guard.

Where it's needed. QVAC-23767 / tetherto/qvac#3853: the linux @qvac/diffusion-cpp prebuilds hard-link libvulkan.so.1 (statically linked Vulkan backend), so the SDK worker aborts on any CPU-only server. The fix extends the Android hybrid DL mode to desktop Linux; hybrid on x86 is exactly where this configure error fires. This commit makes the 2026-08-11 line hybrid-capable for the diffusion registry port family going forward.

Behavioral scope. Static, non-DL, and full-DL (GGML_CPU_ALL_VARIANTS) builds are untouched — the condition only removes the helper from a configuration that could never configure successfully in the first place. No compiled-code change.

Validation.

  • On this exact base, x86 configure with hybrid flags (-DGGML_BACKEND_DL=ON -DGGML_CPU_STATIC=ON -DGGML_NATIVE=OFF):
    • f31dab0 (branch head, without this commit) → fails with the export-set error above;
    • 94cb08a (this PR) → configure + generate clean.
  • Full-stack proof of the identical change (same one-line guard, same unguarded x86 call site) applied to the 2026-07-03-line pin, built via overlay port across the whole diffusion matrix — three green-or-running rounds: 32388143581 (green, commit form), 32511668376 (green, as the registry port patch — the exact backport of this commit), 32714613203 (green; adds x64/arm64 CPU-only no-graphics-stack legs). 9/9 prebuilds, 3/3 C++ suites, integration legs 74/74, Vulkan loading via the dlopen'd module on the GPU leg. The failure-before reference on that line: job link.
  • The bug is configure/generate-stage only (it removes an unused helper from the build graph); runtime behavior of the produced libraries is unchanged by construction.

Downstream: qvac-registry-vcpkg#325 and tetherto/qvac#3978 deliver the desktop-Linux hybrid to @qvac/diffusion-cpp. Since the port family still consumes the frozen 2026-07-03 engine pair, ggml-org#325 carries this exact one-liner as a port patch (hybrid-cpu-static-feats.patch) — neither downstream PR depends on this PR's merge timing. This PR makes the fix canonical on the current dev line so the patch retires automatically when the port family migrates to the 2026-08-11 pair.

…_STATIC builds

The cpu-feats OBJECT library implements the DL loader's variant score; it
is meaningful only when the CPU backend itself is a dlopen'd module. In
hybrid mode (GGML_BACKEND_DL=ON + GGML_CPU_STATIC=ON - the qvac diffusion
port configuration) the CPU backend is a static library registered
directly in-process, and PRIVATE-linking the un-exported OBJECT helper
into it makes configure fail at install(EXPORT ggml-targets):
  includes target "ggml-cpu" which requires target "ggml-cpu-feats"
  that is not in any export set.
ARM never hit this because its feats call is gated on
GGML_CPU_ALL_VARIANTS; x86 gated it on GGML_BACKEND_DL alone. Needed to
extend the Android hybrid mode to desktop Linux (QVAC-23767 / qvac#3853).
@DmitryMalishev
DmitryMalishev force-pushed the qvac-23767-x86-hybrid-cpu-feats branch from ee34924 to 94cb08a Compare August 21, 2026 17:47
@DmitryMalishev
DmitryMalishev changed the base branch from 2026-07-03 to 2026-08-11 August 21, 2026 17:48
@DmitryMalishev
DmitryMalishev merged commit 0de1c77 into 2026-08-11 Aug 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants