feat(voicestudio): force the GGUF TTS runtime onto Vulkan
CI / check (push) Waiting to run

PyTorch in the Nix env is CPU-only, so the bundled omnivoice.cpp
runtime (ggml Vulkan) is the only GPU path.

Put vulkan-tools on the backend PATH: the app finds the adapter by
running `vulkaninfo` and otherwise reports none, since NixOS has no
FHS library directories for its fallback probe.

Default OMNIVOICE_GGUF_BACKEND=vulkan so the runtime opens the GPU or
fails loudly instead of falling back to the CPU. Overridable.

Refs: nix-overlay-ltr
This commit is contained in:
2026-11-20 21:20:37 +03:00
parent fc657f4d55
commit 66c64572d2
3 changed files with 13 additions and 3 deletions
+11 -2
View File
@@ -37,12 +37,21 @@ else
backend = upstream.writeShellApplication {
name = "voicestudio-backend";
# Opt-in engines build their own venvs with `uv venv --python 3.11`; ffmpeg and uv
# are already on PATH from upstream's launcher.
runtimeInputs = [ upstream.python311 ];
# are already on PATH from upstream's launcher. The app finds the GPU by running
# `vulkaninfo`; without it on PATH it reports no adapter and offers no GPU engine.
runtimeInputs = [
upstream.python311
upstream.vulkan-tools
];
text = ''
export LD_LIBRARY_PATH="${libraryPath}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
# Never fetch an interpreter: uv's own CPython cannot run here.
export UV_PYTHON_DOWNLOADS=never UV_PYTHON_PREFERENCE=only-system
# Torch is CPU-only here, so the bundled omnivoice.cpp runtime (GGUF engine) is the
# only GPU path. Pin it to Vulkan rather than let ggml fall back to the CPU quietly;
# a missing driver then fails loudly. Override: OMNIVOICE_GGUF_BACKEND=auto|cpu, and
# OMNIVOICE_GGUF_DEVICE=<n> to pick another adapter.
export OMNIVOICE_GGUF_BACKEND="''${OMNIVOICE_GGUF_BACKEND:-vulkan}"
cd ${resources}
# -s -B: no user site, and the sources live in the read-only store.