Skip to content

Enable Voxtype GPU backend through sudo - #12901

Open
chessing234 wants to merge 8 commits into
omacom:quattrofrom
chessing234:fix/11110-voxtype-gpu-sudo
Open

chessing234 wants to merge 8 commits into
omacom:quattrofrom
chessing234:fix/11110-voxtype-gpu-sudo

Conversation

@chessing234

@chessing234 chessing234 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Voxtype’s GPU setup rewrites /usr/bin/voxtype. Running it without sudo failed and silently left the CPU backend selected. Run that step through sudo and warn when it fails.

GPU setup now runs outside the config-copy guard as well: an earlier failed attempt may already have created config.toml, and rerunning the installer must repair the backend while preserving custom settings. The Vulkan-runtime and executable-backend checks still gate the GPU step, including packages that do not ship a usable Vulkan binary.

Closes #11110.

Validation:

  • The new existing-config regression fails before moving GPU setup outside the guard.
  • All seven cases in voxtype-install-test.sh pass: elevated GPU setup, missing/unusable backends, no Vulkan runtime, existing config retry, and visible failure for both fresh and existing configs while model/service setup completes.
  • Consolidated sudo/warning coverage into the existing installer suite and removed the redundant voxtype-gpu-sudo-test.sh file.
  • Bash syntax and git diff --check pass.

These tests exercise the real installer with command-boundary stubs. They do not attest physical GPU acceleration.

Prepared with AI assistance (Cursor/Codex).

Latest Linux validation after merging quattro (6194f46): all seven Voxtype installer cases pass in the VM. CI run and downloadable logs. Review and i18n checks pass. The full VM check is not green: its only failing file is the unchanged background-intro-lifecycle-test.sh (app retints also wait through the opening crossfade), also observed on the config-only PR. No background/animation code is changed here.

Fixes #7099

Without elevation the symlink rewrite fails and the old || true left a
silent CPU backend while the installer still reported success.
@llstrk

llstrk commented Sep 22, 2026

Copy link
Copy Markdown

Verified: No production defect found in the tested scope at 9bc8d56f. With synthetic dependencies, the installer elevates only the GPU switch, skips it without Vulkan, and warns on GPU setup or sudo failure while continuing user-level service setup.

Installer branch Baseline This PR
Vulkan available Unelevated voxtype setup gpu --enable sudo voxtype setup gpu --enable
GPU step fails Failure status ignored Explicit installer warning on stderr; setup continues
Vulkan unavailable GPU step skipped Unchanged

The new regression test passes on this head and fails against the baseline installer at the expected sudo assertion.

Optional test improvement: In test/shell.d/voxtype-gpu-sudo-test.sh, assert that the successful Vulkan case's captured output contains no GPU-failure warning. A diagnostic mutation that prints the warning even after success still passes all three checks. This is test-only coverage; the current installer does not emit that spurious warning.


Review information

Test scope: Source inspection and isolated baseline/head tests with mocked dependencies. Actual privilege escalation, GPU switching and Vulkan dictation were not tested; recovery from a partially completed real switch is unverified.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra initial inspection, independent Opus 5 and Astra technical reviews, followed by verification of the reported claims against targeted evidence.

@chessing234

Copy link
Copy Markdown
Contributor Author

thanks — nothing further on my side

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks, @chessing234. This fix works as described. I tested it at 9bc8d56f on a disposable Omarchy VM with the real voxtype-bin 1.1.0 and a Vulkan driver installed, stubbing only the confirmation prompt and the desktop reload:

  • On quattro, voxtype setup gpu --enable fails with Permission denied (os error 13), /usr/bin/voxtype stays on voxtype-avx512, and the install still reports success.
  • On this branch, the same install switches it to voxtype-vulkan, and a second run leaves it there.
  • When the GPU step fails (the voxtype-vulkan binary removed, as on aarch64), voxtype exits 1. The installer prints the new warning, finishes setting up the service on CPU, and still sends the ready notification.
  • test/shell.d/voxtype-gpu-sudo-test.sh passes here and fails against the quattro installer. ./test/cli is green.

I've linked #7099 as well as #11110, since both report this bug.

There's one consequence for the maintainer to weigh. Because the GPU step can now succeed, it also succeeds on Intel Haswell GPUs. #11370 reports that voxtype-vulkan aborts on every model load there, so voxtype.service restarts into a crash loop every five seconds. omarchy-hw-vulkan only checks that an ICD file exists, and vulkan-intel installs one for Haswell too. Today those machines are protected only by this bug. I traced this from the source and the report; a VM can't reproduce it. I don't think this branch should take on the Haswell check, because #11481 already adds it. But it would be safest to merge after #11481 or together with it.

#13508 is a competing fix for the same bug. It also runs the switch under sudo, and it adds its own Haswell check, skips machines with no voxtype-vulkan, and only switches away from a CPU build. Unlike this one, a failed sudo voxtype setup gpu --enable there stops the install under set -e before voxtype setup systemd. Choosing between them is the maintainer's decision, so this isn't marked ready.

Reviewed by Claude Opus 5.5. The second opinion, Codex Medium, did not run: today's review quota was spent. So nobody else has checked this yet.

This is waiting on the maintainer to choose between this and #13508, and to decide whether #11481 lands first.

…aller

omacom#14552 replaced bin/omarchy-voxtype-install with bin/omarchy-install-dictation-voxtype, which still runs `voxtype setup gpu --enable || true` as the user. The fix moves to the new installer unchanged, and the test now drives that script with a fresh config directory each run, since the GPU step only runs when no Voxtype config exists yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 8, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

#14552 replaced bin/omarchy-voxtype-install with bin/omarchy-install-dictation-voxtype, so this branch stopped merging. The new installer still runs voxtype setup gpu --enable || true as the user, so the bug is still there on quattro. I merged quattro into this branch as 1c65793 and moved your change into the new installer unchanged. The test now runs that script, with a fresh config directory each time, because the new installer only runs the GPU step when no Voxtype config exists yet. Nothing else in the change differs.

I tested 1c65793 on a disposable Omarchy VM with the real voxtype-bin package and a Vulkan driver:

  • On quattro, voxtype setup gpu --enable fails with Permission denied (os error 13), /usr/bin/voxtype stays on voxtype-avx512, and the install finishes as if it had worked.
  • On this branch, the same install switches it to voxtype-vulkan, and a second run leaves it there.
  • With only the installer reverted to quattro's, it stays on voxtype-avx512 again.
  • When the GPU step fails (with the voxtype-vulkan binary removed), the installer prints the warning, enables the service on CPU and finishes.
  • test/shell.d/voxtype-gpu-sudo-test.sh passes here and fails against quattro's installer. ./test/cli and test/shell.d/dictation-test.sh pass.

Codex Medium reviewed the ported change as a second opinion. It found the merge faithful and the change proportionate. It raised one point I had already raised on the previous head, so its agreement there is not fully independent: once the switch can succeed, Intel Haswell machines get voxtype-vulkan too. #11370 reports that it aborts on every model load there, so voxtype.service would crash-loop. #11481 adds the Haswell check, so this should land after it or together with it, and #11481 needs the same port to the new installer. Codex also found that #12901 should win over the competing #13508. Both elevate the switch, but if sudo voxtype setup gpu --enable fails in #13508, set -e stops the install before the service is set up. Here it warns and carries on.

One thing for the maintainer: the GPU step now runs only on a first install. Anyone who installed dictation while this bug was live keeps the CPU build when they rerun the installer, because their config already exists. Fixing those machines would need a migration, which is beyond this pull request.

This is waiting on the maintainer to decide the order with #11481.

@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

The installer now runs GPU setup through sudo and retries it when config.toml already exists.

  • Voxtype retries GPU setup with elevated access.

Reviews (6) · Last reviewed commit: "Merge upstream quattro" · Reviewed by Greptile

Comment thread bin/omarchy-install-dictation-voxtype Resolved
Comment thread test/shell.d/voxtype-gpu-sudo-test.sh Resolved
The success case only checked that the elevated call ran and the install finished, so an installer that warned even after the switch worked would still pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Greptile left two review comments on 1c65793. Here is what I found for each.

The success test didn't check that the switch worked (test/shell.d/voxtype-gpu-sudo-test.sh:105). This is correct. An installer that printed the warning even after a successful switch would still have passed. I pushed 46d3441, which asserts that the successful Vulkan run prints no warning. That is the only change. The installer is the same as in 1c65793. On a disposable Omarchy VM, the test passes at 46d3441 and fails against an installer altered to always warn. test/shell.d/dictation-test.sh and ./test/cli pass.

Existing users miss the fix (bin/omarchy-install-dictation-voxtype:23). The problem is real. I raised it in my previous comment. Moving the GPU step outside the config guard is not the right fix for this pull request, though. quattro (#14552) deliberately skips choosing a backend when a Voxtype config already exists. Moving the step would switch to Vulkan on every rerun, which would override anyone who chose the CPU build on purpose. It would also put rerunning Haswell machines into the #11370 crash loop. Fixing machines installed while this bug was live means deciding which ones to touch, so it belongs in a migration. That decision is the maintainer's.

Codex Medium reviewed the new commit and both points as a second opinion. It agreed on both, and since my reasoning was already written down, that agreement is not fully independent. It found nothing new beyond the Haswell point that is already open.

This is still waiting on the maintainer to decide the order with #11481, which adds the Haswell check and, like #13508, no longer merges cleanly.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 10, 2026
quattro now enables the GPU backend only when voxtype-vulkan is installed, since aarch64 voxtype-bin ships none. The switch keeps that check and still runs under sudo with a warning on failure. Both Voxtype install tests stub sudo and point the installer at a stub backend binary, so neither reaches the real one.
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 11, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging again because quattro changed the same lines in bin/omarchy-install-dictation-voxtype. #14431 now runs the GPU switch only when /usr/lib/voxtype/voxtype-vulkan is installed, because aarch64 voxtype-bin doesn't ship it. It still runs the switch as the user with || true. I merged quattro into this branch as 04a7836 and kept both changes: the new check decides whether to switch, and the switch runs under sudo with your warning if it fails. I also made two test changes. test/shell.d/voxtype-gpu-sudo-test.sh now provides a stub voxtype-vulkan so its Vulkan case reaches the switch. quattro's new test/shell.d/voxtype-install-test.sh gets a sudo stub so the elevated call reaches its fake voxtype and not the real sudo.

I tested 04a7836 on a disposable Omarchy VM with the real voxtype-bin 1.0.1 and the lavapipe Vulkan driver, stubbing only the confirmation prompt and hyprctl:

  • With quattro's installer, voxtype setup gpu --enable fails with Permission denied (os error 13), /usr/bin/voxtype stays on voxtype-avx512, and the install exits 0.
  • On this branch, the install switches it to voxtype-vulkan, and a second run leaves it there.
  • With voxtype-vulkan moved away, the step is skipped and nothing is printed, as quattro intends.
  • When the elevated switch fails, the installer prints the warning, enables voxtype.service on CPU and finishes.
  • voxtype-gpu-sudo-test.sh passes here and fails with quattro's installer. voxtype-install-test.sh, dictation-test.sh and ./test/cli pass.

Claude Opus 5.5 did the merge and the testing. Codex Medium reviewed the merge as a second opinion. It found no problems: both sides survive, the test changes keep every assertion, and the change is proportionate. It was agreeing with reasoning I had already written down, so that agreement isn't fully independent.

The open points from before still stand. Once the switch can succeed, Intel Haswell machines get voxtype-vulkan too, and #11370 reports it crash-loops there. #11481 adds the Haswell check, but it doesn't merge cleanly either. Existing installs also keep the CPU build when they rerun the installer.

This is waiting on the maintainer to decide the order with #11481 and to choose between this and #13508.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 11, 2026
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 17, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

I reviewed 298af23, which adds the retry for existing configs and moves the sudo coverage into voxtype-install-test.sh. I tested it on a disposable Omarchy VM with the real voxtype-bin 1.2.2 and the lavapipe Vulkan driver.

The fix works.

  • With quattro's installer, voxtype setup gpu --enable fails with Permission denied (os error 13) and /usr/bin/voxtype stays on voxtype-avx512.
  • With this branch, a fresh install switches to voxtype-vulkan. A rerun with an existing config.toml switches too, where quattro doesn't try.
  • Running it under sudo left nothing behind in /root.
  • voxtype-install-test.sh passes all seven cases. It fails with quattro's installer, with sudo removed, and with the GPU step moved back inside the config check.
  • ./test/cli and dictation-test.sh pass.
  • CI's test job fails in one file, i18n-startup-test.sh. This branch doesn't touch it, and I didn't check whether it also fails on quattro.

I've linked #7099, which reports the same Permission denied and is fixed by this too.

Moving the switch out of the config check has side effects. The switch now runs on every run of the installer, and omarchy default dictation voxtype runs the installer whenever someone picks Voxtype again. I reproduced each of these on the VM:

  • It undoes a deliberate CPU choice. After sudo voxtype setup gpu --disable, a rerun switches back to Vulkan. On Intel Haswell, Voxtype install enables Vulkan on Haswell (hasvk) GPUs, causing an endless SIGABRT crash loop #11370 reports that Vulkan crash-loops and that disabling GPU is the workaround, so a rerun would bring the crash loop back. Keep Voxtype on CPU for Intel Haswell GPUs #11481, which keeps Haswell on CPU, is still open.
  • It changes the backend for ONNX users. With the ONNX build active, a rerun ran voxtype's GPU detection for ONNX. That selected the MIGraphX backend, which voxtype itself reported could not load because the ROCm libraries were missing. ONNX Runtime falls back to CPU, so dictation still worked, but the user's choice was replaced.
  • The switch doesn't take effect on a rerun. systemctl --user enable --now doesn't restart a service that's already running. After the rerun, the same daemon process was still running voxtype-avx512 while voxtype-vulkan waited on disk. That leaves the people the retry is meant for on CPU until they restart the service or log in again.
  • The warning can be wrong. It says "dictation will use the CPU build", but if GPU was already enabled and the password prompt is cancelled, nothing switches back to CPU. It's also hard-coded English, while the installer's other messages go through omarchy-i18n.

Repairing installs that ran into this bug can't currently be told apart from overriding someone's own choice. #13508 switches only when the active binary is an AVX2 or AVX-512 build. That would leave ONNX users alone, but not someone who ran gpu --disable, since that also goes back to an AVX build. Without the retry, only fresh installs change, which fixes #11110 and #7099 going forward but leaves earlier installs on CPU.

Claude Opus 5.5 did the review and testing. Codex Medium and muse-wonder (via pi, thinking high) gave second opinions. Both agreed the sudo switch and the warning are right. Both raised the rerun side effects above, and muse-wonder first spotted the missing service restart, which I then confirmed on the VM. They also noted that the test's sudo check relies on its own stub: the fake voxtype fails unless the fake sudo sets VOXTYPE_AS_ROOT. They also noted that the bare voxtype setup gpu --enable assertion repeats the sudo one. They read the code without running it, and they may have seen my earlier notes on this pull request, so their agreement isn't fully independent.

I didn't push anything, because what should happen on a rerun is a decision about behaviour. Earlier I raised that existing installs stay on CPU, and the retry answers that point. This is waiting on the maintainer to decide whether rerunning the installer should switch to GPU again, and in which order to land this and #11481. I compared this with #13508, which makes the same sudo fix and was opened later. This one came first and fixes the same cause, so it is the one to take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

3 participants