Repository navigation
Switch dictation to Vulkan when a GPU is present - #13508
shawnyeager wants to merge 3 commits into
Conversation
The package links the CPU binary, and the installer dropped the GPU switch when it could not rewrite that root-owned link.
Automated AI review
Outcome: With Haswell iGPUs get a crashing Vulkan build
Suggested change: Keep Haswell on the CPU build, as #11481 does. DetailsHaswell sequence (source-traced, Voxtype 1.1.0, whisper-rs-sys 0.15.0, Mesa 26.2.3): aarch64 installs stop halfwayaarch64 Suggested change: Also require Reproducer (fails at 9e6f383)Reproducer: aarch64 install stops after the Vulkan switch failsStub-based test in the style of It is a model of the package, not a run on aarch64 hardware. #!/bin/bash
set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
test_home=$(mktemp -d)
test_bin=$(mktemp -d)
omarchy_path=$(mktemp -d)
voxtype_lib=$(mktemp -d)
log_file=$(mktemp)
cleanup() {
rm -rf "$test_home" "$test_bin" "$omarchy_path" "$voxtype_lib"
rm -f "$log_file"
}
trap cleanup EXIT
mkdir -p "$omarchy_path/default/voxtype"
printf 'engine = "whisper"\n' >"$omarchy_path/default/voxtype/config.toml"
write_stub() {
local name="$1"
local body="$2"
printf '%s\n' '#!/bin/bash' "$body" >"$test_bin/$name"
chmod +x "$test_bin/$name"
}
write_stub gum '[[ $1 == confirm ]] && exit 0
exit 1'
write_stub omarchy-pkg-add 'exit 0'
write_stub hyprctl 'echo "hyprctl:$*" >>"$TEST_LOG"'
write_stub omarchy-restart-shell 'exit 0'
write_stub omarchy-notification-send 'echo "notify:$*" >>"$TEST_LOG"'
write_stub systemctl 'echo "systemctl:$*" >>"$TEST_LOG"'
# omarchy-hw-vulkan only looks for an ICD JSON, which Mesa's vulkan-* packages
# install on aarch64 too.
write_stub omarchy-hw-vulkan 'exit 0'
write_stub sudo 'echo "sudo:$*" >>"$TEST_LOG"
"$@"'
# Mirrors voxtype 1.1.0 src/setup/gpu.rs enable(): on the Whisper engine it
# bails before touching /usr/bin/voxtype when no voxtype-vulkan binary exists.
write_stub voxtype 'echo "voxtype:$*" >>"$TEST_LOG"
if [[ $* == "setup gpu --enable" && ! -e $VOXTYPE_LIB/voxtype-vulkan ]]; then
printf "Error: Vulkan backend not installed.\nThe voxtype-vulkan binary was not found in /usr/lib/voxtype\n" >&2
exit 1
fi
exit 0'
run_install() {
: >"$log_file"
local status=0
HOME="$test_home" \
OMARCHY_PATH="$omarchy_path" \
PATH="$test_bin:$PATH" \
TEST_LOG="$log_file" \
VOXTYPE_LIB="$voxtype_lib" \
bash "$ROOT/bin/omarchy-voxtype-install" || status=$?
echo "--- installer exit $status, calls:"
cat "$log_file"
return "$status"
}
# x86_64 voxtype-bin ships a Vulkan build next to the CPU builds.
touch "$voxtype_lib/voxtype-avx2" "$voxtype_lib/voxtype-avx512" "$voxtype_lib/voxtype-vulkan"
run_install || fail "an x86_64 install with a Vulkan driver finishes"
grep -qx 'voxtype:setup systemd' "$log_file" || fail "an x86_64 install sets up the dictation service"
grep -q '^notify:.*Voxtype Dictation Ready' "$log_file" || fail "an x86_64 install reports dictation ready"
pass "an x86_64 install with a Vulkan driver finishes"
# aarch64 voxtype-bin 1.1.0 ships only voxtype-cpu and voxtype-onnx.
rm -f "$voxtype_lib"/*
touch "$voxtype_lib/voxtype-cpu" "$voxtype_lib/voxtype-onnx"
run_install || fail "an aarch64 install with a Vulkan driver finishes on the CPU build"
grep -qx 'voxtype:setup systemd' "$log_file" || fail "an aarch64 install sets up the dictation service"
grep -q '^notify:.*Voxtype Dictation Ready' "$log_file" || fail "an aarch64 install reports dictation ready"
pass "an aarch64 install with a Vulkan driver finishes on the CPU build"Output at the PR head (9e6f383)Exit status: 1 Output at the merge-base (3faafba), for comparisonExit status: 0 stdout and stderr are shown one after the other (stdout first), as captured. DetailsRelated open PRs: #7129 makes the same one-line change and adds a migration for existing installs (it merges cleanly with this PR). #12901 makes the same change but warns and continues on the CPU build when the switch fails. #11481 conflicts on the same block. #7890 and #8316 each add a different Verified:
Optional test improvement: the failure case only checks for a non-zero exit, so any unrelated failure passes it. Asserting the More findingsRe-running the installer overrides a chosen backend
Suggested change: Switch only when Review informationTest scope: Source review and sandboxed stub runs at AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Haswell stays on the CPU build, and a reinstall disables Vulkan there. Enable Vulkan only when voxtype-vulkan exists and the current link is voxtype-avx2 or voxtype-avx512, so aarch64 and a re-run still reach systemd and do not undo a chosen backend.
|
Addressed in c1ce50b: Haswell stays on the CPU build.
|
|
Thanks for adding the Haswell guard. One gap: Haswell isn't the only GPU that Widening the ID match would cover them (maybe under a name like case "$(<"$device/device")" in
0x0[4acd][012][26abe]) exit 0 ;; # Haswell
0x015[2567a] | 0x016[26a] | 0x0f3[0-3]) exit 0 ;; # Ivy Bridge, Bay Trail
esacA small one: the Haswell branch runs |
`voxtype setup gpu --disable` relinks voxtype-avx2 or voxtype-avx512, which is exactly what the switch matches, so a re-run does re-enable Vulkan after a manual disable. The comment claimed otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, @shawnyeager. The fix works. I tested it on a disposable Omarchy VM with the real
Pushed: 9ffa91d corrects the installer comment. It said a re-run leaves a manual On @jandrusk's two points, checked against the
Against #12901: both PRs fix the same bug, and #12901 is older. I'd still bring this one to the maintainer: #12901 on its own would enable Vulkan on Haswell too and send those machines into the #11370 crash loop, which this PR prevents. Two differences are the maintainer's call. If Classification is unsettled. I classify this as a bug fix. At this head, Codex Medium, asked separately, classified it as an enhancement, so it carries no Reviewed by Claude Opus 5.5. The second opinion, Codex Medium, reviewed this head and found no defects. It also picked this PR over #12901 when asked without my answer. Independence isn't guaranteed, since it can read my working notes. This is waiting on the maintainer: to settle the classification, to choose between this and #12901, and to decide how it lands alongside #11481. CI (Greptile) was still running when I wrote this. |
|
| if omarchy-hw-intel-haswell-gpu; then | ||
| echo "Using CPU dictation: Intel Haswell Vulkan lacks the required 16-bit storage." | ||
| sudo voxtype setup gpu --disable |
There was a problem hiding this comment.
Usable discrete GPUs get disabled
If a machine has Haswell integrated graphics and a usable discrete Vulkan GPU, this branch still runs voxtype setup gpu --disable. The helper matches any Haswell display device, so the installer never checks the other GPU. Users get slower CPU dictation, and reinstalling can disable an already working Vulkan setup. Check for a usable GPU before forcing CPU dictation.
|
Fair point, thanks for checking. Ivy Bridge and Bay Trail CPUs have no AVX2, so |
|
Thanks for this, @shawnyeager! #14552 moved the installer to |
Cheers, @peteonrails. Please do. |
A machine with a Vulkan GPU now gets the Vulkan Voxtype build when dictation is installed. The package's own install links the CPU binary, and the installer called
voxtype setup gpu --enableas the user and ignored the failure, so the root-owned link stayed on the CPU build.On a Dell XPS 14 with an Intel Arc B390, a 2-second clip took 0.90s on that CPU build and 0.19s on Vulkan after the backend was warm.