Skip to content

Keep NVIDIA userspace off Intel and AMD machines - #16058

Open
Azonnali wants to merge 1 commit into
omacom:quattrofrom
Azonnali:fix/vulkan-lib32-providers
Open

Azonnali wants to merge 1 commit into
omacom:quattrofrom
Azonnali:fix/vulkan-lib32-providers

Conversation

@Azonnali

@Azonnali Azonnali commented Oct 20, 2026 •

Copy link
Copy Markdown

Fixes #12392.

Cleanup-only follow-up. Prevention is #16055's half (older, claims the virtuals on demand in omarchy-pkg-add, so it also covers omarchy pkg add steam on machines that are already installed), and #16046 fixes the gaming installers' ordering. This PR now carries only the one-time repair for machines that already have the stale userspace.

Migration: remove the stale userspace from existing machines

migrations/1792478700.sh repairs machines that already carry NVIDIA's userspace as a dependency-installed provider:

  • Acts only when there is no visible NVIDIA display device and no NVIDIA kernel-driver package (nvidia, nvidia-open, nvidia-lts, nvidia-open-lts, and the dkms variants).
  • Only removes packages pacman recorded as dependencies; explicit installs stay.
  • Installs the matching Intel/AMD 64-bit (mandatory) and 32-bit (best-effort) drivers first, then removes both generations as one transaction, because lib32-nvidia-utils depends on the exact nvidia-utils version.
  • pacman -Rs --print decides whether the removal is safe; opencl-nvidia and its 580xx twins go in a second transaction so an OpenCL consumer cannot veto the Vulkan cleanup.
  • A blocked removal exits 0 and leaves the packages; a query, install, or removal failure exits non-zero so the migration stays pending.
  • Review fix: when the 32-bit replacement install fails, the excluded 32-bit package keeps the 64-bit one alive through its exact-version dependency, so the 64-bit dry run reports a dependency block and the migration used to record success. It now exits non-zero while that 32-bit package remains, so a transient mirror or multilib failure is retried on the next update. A 64-bit package blocked without the 32-bit one is a genuine dependency block and still exits 0.

No installer changes remain in the diff: install/hardware/vulkan.sh, install/omarchy-other.packages, and test/shell.d/vulkan-install-packages-test.sh are gone, leaving prevention to #16055.

Validation

  • bash test/shell.d/nvidia-userspace-cleanup-migration-test.sh — 27 checks, all pass: official and 580xx names, both OpenCL generations, a blocked OpenCL transaction, combined Vulkan removal, mixed explicit/dependency installs, NVIDIA GPU and all seven kernel-driver names, a blocked removal, install/removal/query/preflight failures, a failed 32-bit install that now stays pending, a failed 32-bit install with a blocked 64-bit removal that is still left alone, another-provider, and aarch64.
  • ./test/cli — passes.
  • ./test/all is not re-run here: test/shell drives the live compositor/desktop, and the only suite file this PR touches is the migration test above.

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Adds a one-time migration to remove dependency-installed NVIDIA userspace from machines without an NVIDIA GPU or kernel driver.

  • The update removes unused NVIDIA graphics packages from non-NVIDIA machines.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Start cleanup] --> B{NVIDIA GPU or kernel driver?}
  B -->|Yes| C[Leave packages alone]
  B -->|No| D[Find dependency-installed NVIDIA userspace]
  D --> E[Install matching Vulkan drivers]
  E --> F[Check and attempt Vulkan removal]
  F --> G{Failed lib32 install left targets installed?}
  G -->|Yes| H[Keep migration pending]
  G -->|No| I[Check and attempt OpenCL removal]
  I --> J[Finish or keep pending on error]
Loading

Reviews (2) · Last reviewed commit: "Remove stale NVIDIA userspace on non-NVI..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for the careful write-up. Reviewed by Claude Opus 5.5 and, separately, by Codex Medium; the diff was read against quattro, and no tests were run, because this one waits on a decision before it is worth verifying.

This competes with #16055 on prevention, and #16055 is the one to keep for that half. Both stop lib32-vulkan-driver resolving to NVIDIA's userspace. #16055 is older and does it on demand in omarchy-pkg-add, so it also covers omarchy pkg add steam on machines that are already installed, which this PR's Scope section leaves open. The change to install/hardware/vulkan.sh and install/omarchy-other.packages instead puts the 32-bit Vulkan stack (with lib32-llvm-libs, a couple of hundred MiB) on every x86 Intel and AMD install, including ones that never install a game, for a case the on-demand check already handles.

The cleanup migration is the part neither PR has, and it stands on its own. migrations/1792478700.sh installs its own replacement drivers before removing anything, so it does not depend on the installer change. As you offered, reducing this PR to the cleanup commit would make it a separate decision for the maintainer: whether to remove packages from existing machines.

One defect in the migration, found by Codex and confirmed by reading: if installing the 32-bit replacement fails (line 132), lib32_ready=0 keeps lib32-*nvidia*-utils out of the removal, the dry run of removing nvidia-utils alone then fails because lib32-nvidia-utils depends on it, and remove_packages treats that as "something still depends on it" and returns 0. The migration exits 0, omarchy-migrate writes its marker, and a transient mirror failure leaves both packages installed for good. Exiting non-zero when the 32-bit install failed and NVIDIA packages remain would keep it pending for the next run.

Codex also checked the hybrid case: omarchy-hw-nvidia reads the cached sysfs class and vendor, so a runtime-suspended NVIDIA dGPU is still seen and the migration exits early. Its agreement on the rest was given with my conclusion already written down, so it is not guaranteed independent.

Waiting on the maintainer to choose between the two approaches and decide on the cleanup.

Exit non-zero when the 32-bit replacement install fails and the excluded 32-bit package is still installed, so a transient mirror or multilib failure stays pending instead of recording the cleanup as done.
@Azonnali
Azonnali force-pushed the fix/vulkan-lib32-providers branch from f4f1ad5 to fc9f99a Compare October 22, 2026 05:36
@Azonnali

Copy link
Copy Markdown
Author

Reduced to the cleanup migration, as suggested: install/hardware/vulkan.sh, install/omarchy-other.packages, and their test are gone from the diff, so prevention stays with #16055, and #16046 still covers the gaming installer ordering. The branch is now a single commit on current quattro.

Fixed the 32-bit install defect: when the 32-bit replacement install fails, the migration now exits non-zero while the excluded 32-bit package is still installed, instead of letting remove_packages read the pair's exact-version dependency as "something still depends on it" and recording the run as complete. A transient mirror or multilib failure therefore stays pending for the next run. A 64-bit package blocked without a 32-bit one remaining is a genuine dependency block and still exits 0, matching the existing blocked-removal behavior.

The migration test asserts the new pending exit and adds that blocked-64-bit-without-32-bit case: 27 checks, all pass. ./test/cli passes. I did not run the full ./test/all suite because its shell suite includes tests that drive the live compositor and desktop, and the only file this PR touches is the migration test, which I ran directly.

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

Copy link
Copy Markdown
Collaborator

Reviewed again at fc9f99a, now that it is the cleanup migration only. Reviewed by Claude Opus 5.5, with second opinions from Codex Medium and muse-spark-1.3 (thinking high). Both read it after the earlier review was on record, so their agreement is not guaranteed independent.

It does what it says, on a disposable Omarchy ISO worker:

  • On a VM with no NVIDIA GPU, a plain pacman -S steam installed nvidia-580xx-utils and lib32-nvidia-580xx-utils as dependencies, so the bug reproduces on current packages. On quattro nothing is pending for omarchy-migrate to run, and both packages stay.
  • With this branch, and the PCI tree stubbed to show an Intel GPU (the package transactions were real pacman), omarchy-migrate installed vulkan-intel and lib32-vulkan-intel, removed both NVIDIA packages, left Steam's lib32-vulkan-driver satisfied and wrote the marker. A second run did nothing.
  • With [multilib] switched off, the run exited 1 and wrote no marker, for both the 580xx pair and Arch's nvidia-utils/lib32-nvidia-utils. Once multilib was back, the next run finished. That fixes the defect from the last review.
  • On the VM's real virtio GPU there is no driver to swap in. Pacman's dry run blocked the removal and the migration exited 0, leaving the packages installed.
  • ./test/cli passes, and so does the new test (27 of 27). ./test/shell fails 10 graphical test files, which also fail on quattro when run on their own, so the shell suite is not green for reasons outside this PR.

Left for the maintainer, nothing for you to change unless they ask:

  • If multilib is permanently unavailable (only possible with a hand-edited /etc/pacman.conf, since Omarchy's x86 config enables it), the migration stays pending on every update, and omarchy-migrate stops before any later migration. Both reviewers raised this. Staying pending only when pacman-conf --repo-list lists multilib would avoid it.
  • The kernel-driver guard names the packages Omarchy installs. A third-party module package, such as a CachyOS kernel's nvidia-open, is not covered while its eGPU is unplugged (raised by Codex).
  • The comment above the pending check says the 32-bit package pins nvidia-utils at its exact version. That holds for Arch's pair, but Omarchy's lib32-nvidia-580xx-utils has no dependency on nvidia-580xx-utils. In that case the 64-bit package is removed first and the 32-bit one on the next run. The outcome is right; only the comment is wrong.
  • Both reviewers thought it larger than the repair needs, pointing at the OpenCL half and the lib32 retry handling. I think the guards are warranted for a migration that removes packages from people's machines unattended.
  • It closes nvidia-utils + lib32-nvidia-utils get pulled in as the default OpenGL/Vulkan provider on AMD-only systems #12392. A plain pacman -S steam can still pull in NVIDIA's userspace on new machines, and that half of the issue is what Install the GPU's lib32 Vulkan driver before packages that need one #16055 was closed over.

Waiting on the maintainer.

@TechLuddite

Copy link
Copy Markdown
Contributor

Confirming this on another AMD-only machine. Removing the same packages by hand fixed it there, and from reading the diff, this migration would have covered the case.

Machine: HP OmniBook 5 16-cg0xxx, AMD Krackan2 iGPU (1002:1902, amdgpu), no NVIDIA device in lspci, no NVIDIA kernel driver package, stable channel, now on Omarchy 4.0.6-1.

From /var/log/pacman.log:

[2026-08-28T23:52:29-0700] [PACMAN] Running 'pacman -S --noconfirm --needed steam'
[2026-08-28T23:53:38-0700] [ALPM] installed nvidia-utils (610.57.04-1)
[2026-08-28T23:53:42-0700] [ALPM] installed lib32-nvidia-utils (610.57.04-1)
[2026-08-28T23:53:53-0700] [ALPM] installed lib32-vulkan-radeon (1:26.2.1-1)

Omarchy was 4.0.1-1 at the time, so this is the Steam ordering from before #12569. Updates through 4.0.6 left both packages installed as dependencies (Required By: aquamarine hyprland libglvnd steam), with nvidia_icd.json next to radeon_icd.json in /usr/share/vulkan/icd.d/. The only visible symptom was nvidia-smi failing to reach a driver.

Manual repair on 2026-11-05:

pacman -Rs lib32-nvidia-utils nvidia-utils

That removed lib32-nvidia-utils, nvidia-utils, egl-x11, egl-wayland, egl-wayland2, egl-gbm and eglexternalplatform. The --print dry run resolved cleanly because mesa and vulkan-radeon already provide the drivers. The machine rebooted normally and Steam worked afterwards. linux-firmware-nvidia stays because linux-firmware depends on it.

Based on the diff, this machine passes the migration's guards: no NVIDIA display device, no NVIDIA kernel driver package, both utils packages recorded as dependencies, and lib32-vulkan-radeon already present. I have not run the migration itself, since the machine is already clean.

Can we get a maintainer review on this? Machines that installed Steam before #12569 still carry the stack after updating.

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

Development

Successfully merging this pull request may close these issues.

nvidia-utils + lib32-nvidia-utils get pulled in as the default OpenGL/Vulkan provider on AMD-only systems

3 participants