Skip to content

Create /dev/nvidia-modeset at boot on NVIDIA machines - #16379

Open
omarchybot wants to merge 3 commits into
quattrofrom
fix/issue-15975
Open

omarchybot wants to merge 3 commits into
quattrofrom
fix/issue-15975

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

On hybrid NVIDIA laptops /dev/nvidia-modeset does not exist after boot, even though nvidia_modeset is loaded early through /etc/mkinitcpio.conf.d/nvidia.conf. Games under umu's Steam Runtime container (omarchy-install-gaming-battlenet) and Flatpak apps then fail Vulkan presentation (VK_ERROR_UNKNOWN, DXVK's Failed to query present modes: -13) and show a black screen until something on the host happens to open the NVIDIA driver.

The node is never created at boot because nothing asks for it. The 60-nvidia.rules shipped by nvidia-utils 615.78.08 runs only nvidia-modprobe -c0 -u, and the one in nvidia-580xx-utils 580.196.07 runs bare nvidia-modprobe and -c0 -u. Neither passes -m, which is what loads nvidia-modeset and makes its device file. On a machine where NVIDIA drives the panel, something on the host evidently creates it at login; where the panel hangs off the iGPU, nothing does. The container cannot repair that itself, because the setuid helper does not work inside it, and Flatpak only binds the node into a sandbox if it existed when the sandbox was built.

This installs /etc/udev/rules.d/61-nvidia-modeset.rules, the rule the reporter proved on their machine. It matches exactly what the packaged rule matches (an NVIDIA display controller bound to the nvidia driver), so a GPU handed to vfio-pci by supergfxctl is left alone, and TEST!="/dev/nvidia-modeset" makes it a no-op once the node exists, including if Arch packaging ever adds -m itself.

  • install/hardware/nvidia.sh installs it for new installs. It then replays the GPU's bind event, because an image build defers this leaf to the machine's first boot, which runs after coldplug; in the ISO chroot the replay fails quietly, as install/post-install/udev.sh already does.
  • The migration installs it on existing NVIDIA machines with the driver (N1x keeps its own setup) and replays the bind on every run, so a retry after a failed udevadm still creates the node.

The real fix belongs in Arch's nvidia-utils rule; until it does, this rule is the narrow way to carry it. Whether it makes a game present has to be confirmed on the reporter's hardware, since workers have no NVIDIA GPU.

Fixes #15975

nvidia-utils' 60-nvidia.rules runs only `nvidia-modprobe -c0 -u`, so nothing creates the modeset node until something on the host opens the NVIDIA driver for display. On a hybrid laptop whose panel hangs off the iGPU that may never happen, and games under umu's Steam Runtime container or Flatpak then fail Vulkan presentation: the container cannot run the setuid helper, and Flatpak only binds the node if it existed when the sandbox was built.

Install the rule the reporter proved on their machine, gated like the packaged one so a GPU bound to vfio-pci is left alone. The setup leaf replays the bind because an image's first boot runs it after coldplug; the migration replays it on every run so a retry after a failed udevadm still creates the node.

Fixes #15975

Co-Authored-By: Maciej Szostak <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change is limited to NVIDIA display setup and apps that need its device node.

Restore the migration's required test coverage before merging.

Findings

  1. P2 Required migration test removed ▶

Summary

Creates /dev/nvidia-modeset on NVIDIA machines so containerized games can use it.

  • NVIDIA display GPUs get a modeset device node when their driver binds.

Reviews (3) · Last reviewed commit: "Drop the migration's test, per the rule ..." · Reviewed by Greptile

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Oct 23, 2026
The migration replayed udev on every run, so each further user on a machine re-triggered every NVIDIA display controller and waited on udevadm settle for a repair that had already landed. agents/skills/migrations.md asks a machine-wide repair to detect that it is done and no-op, as 1791134093.sh does. The node existing is that state; while it is missing, a retry still replays the bind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Reviewed as a pull request at its new head, dcdd06b8cda55f1a6a390b85cf98434935c65a42. One change was pushed. The rule and the install path are unchanged.

What was checked, on a disposable worker VM (no NVIDIA GPU). ./test/cli passes. nvidia-modeset-udev-test.sh and nvidia-kms-hook-test.sh pass. udevadm verify (systemd 262) accepts the rule. The udevadm trigger filter selects only the display controller among the VM's four virtio PCI devices. With the vendor and driver swapped to the VM's virtio GPU, udevadm test --action=bind queues nvidia-modprobe -m while /dev/nvidia-modeset is missing and does nothing once it exists. The migration is a no-op on a machine without NVIDIA. Whether the node appears and a game presents on real hybrid hardware can only be confirmed on one.

Pushed: dcdd06b8c. The migration replayed the GPU's bind and waited on udevadm settle on every run. On a machine with several users, each later user's run re-triggered the GPU for a repair that had already landed. agents/skills/migrations.md asks a machine-wide repair to detect that it is done and no-op, as migrations/1791134093.sh does. The replay now runs only while /dev/nvidia-modeset is missing, so a retry after a failed udevadm still creates the node. The test now covers the no-op path: it fails with the guard removed and passes with it.

Second opinion. Codex Medium and muse-spark-1.3-contributor (via pi, thinking high) reviewed it in two rounds. muse-spark raised the replay-on-every-run problem fixed above. Codex suggested matching the rule on PCI add|bind could reintroduce a vfio-passthrough handoff problem. That does not apply here: the rule requires DRIVER=="nvidia", so a GPU bound to vfio-pci never matches it, and Omarchy already loads nvidia_modeset from the initramfs, so nvidia-modprobe -m only creates the node. Other first-round points were checked and left alone. The install leaf's || true matches install/post-install/udev.sh, since udev is not running in the ISO chroot. N1x is set up by install/hardware/n1x.sh. In the second round, on this head, both found nothing open. Their agreement may not be independent of this review.

Separately, #16302 proposes removing migration tests and telling contributors not to add new ones. If it lands first, this PR's test will go against that rule.

What it waits on: @szoniu. The head moved after you were asked on #15975 to test efd6483. Please test dcdd06b8cda55f1a6a390b85cf98434935c65a42 instead. The steps are the same as in that comment, with git -C ~/omarchy-15975 checkout dcdd06b8cda55f1a6a390b85cf98434935c65a42 as the checkout line. Then reply with whether /dev/nvidia-modeset exists after a fresh boot and whether the first launch has a picture. After that it goes to the maintainer.

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good

@szoniu

szoniu commented Oct 31, 2026

Copy link
Copy Markdown

Tested dcdd06b8 on the G16 GU605MI (Core Ultra 9 185H + RTX 4070 Laptop), nvidia-open-dkms 615.78.08, Omarchy 4.0.6. It works.

Method. I didn't use omarchy dev link: the branch is 1165 commits and 87 migrations ahead of v4.0.6, and dev unlink doesn't revert migrations. Instead I ran the PR's migrations/1792737693.sh from a checkout at dcdd06b8 on packaged 4.0.6, the way omarchy-migrate runs it (OMARCHY_PATH set to the checkout, bash -euo pipefail), with the checkout's bin/ on PATH, because 4.0.6 has no omarchy-hw-aarch64-n1x. So this covers the rule and the migration, not the install/hardware/nvidia.sh path for new installs.

Results:

  1. Removed my own copy of the rule and rebooted: /dev/nvidia-modeset missing, while nvidia0, nvidiactl and nvidia-uvm were there. So the bug still reproduces on 615.78.08.
  2. Ran the migration: rc 0. It installed the rule (identical to default/udev/nvidia-modeset.rules), and the node appeared right away, without a reboot.
  3. Ran the migration again: no udevadm calls, so the guard added in dcdd06b8 works.
  4. Rebooted again: the node existed from boot, created in the same second the nvidia-modeset module loaded, before anything used Vulkan. The first Overwatch launch (umu + GE-Proton11-11), about 2 minutes after boot, had a picture, and Overwatch.log has no BeginSwap ... E_FAIL.

docs/testing.md and agents/skills/migrations.md on quattro now say a migration gets no suite test: it runs once per machine and is frozen once it ships. The test file only exercised the migration, and OMARCHY_NVIDIA_MODESET_NODE existed only so it could, so the migration checks /dev/nvidia-modeset directly again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Thanks for testing this on the G16, @szoniu. Your result covers the rule, the migration, its retry guard and boot timing on real hardware, which no worker here can do.

One change pushed, 1768b566d8ca279ba060e052c4709e4f4c78e599. #16302 has since merged to quattro and says a migration gets no suite test (docs/testing.md, agents/skills/migrations.md). So this deletes test/shell.d/nvidia-modeset-udev-test.sh and the OMARCHY_NVIDIA_MODESET_NODE override that existed only for it; the migration now checks /dev/nvidia-modeset directly. With that variable unset, which it always is outside the test, the migration runs exactly as it did at dcdd06b8. The rule and install/hardware/nvidia.sh are unchanged.

What was checked, on a disposable worker VM (no NVIDIA GPU). ./test/cli, nvidia-kms-hook-test.sh and hw-nvidia-test.sh pass. udevadm verify accepts the rule. The migration does nothing on a non-NVIDIA machine. With the hardware checks stubbed to report NVIDIA, it installs the rule with mode 644 and replays the bind, and a second run with the node present calls no udevadm. The branch still merges cleanly into quattro.

Second opinion. Codex Medium and muse-wonder (pi, thinking high) reviewed this commit and the whole pull request against current quattro and found nothing open. Both agreed the test removal follows the new rule and that runtime behaviour is unchanged. Their independence from this review is not guaranteed.

Waiting on @szoniu. A hardware fix is marked verified only against the head commit named in full, and the head has moved. Steps 2 and 3 of your method, run from a checkout at 1768b566d8ca279ba060e052c4709e4f4c78e599, are enough: nothing that runs on your machine changed. A reply naming that full SHA lets this go to the maintainer. @sergihrs's report on the GU605CP in #15975 points to the same cause.

Comment thread migrations/1792737693.sh
Comment on lines +11 to +14
if [[ ! -e /dev/nvidia-modeset ]]; then
sudo udevadm control --reload
sudo udevadm trigger --action=bind --subsystem-match=pci --attr-match=vendor=0x10de --attr-match='class=0x03*'
sudo udevadm settle

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Required migration test removed

The PR removes the dedicated test while this migration is still being changed. The migration guide requires keeping that test for an unfinished privileged udev repair. Restore coverage for the hardware guards, retry path, and no-op when /dev/nvidia-modeset already exists before merging.

File Used: agents/skills/migrations.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@szoniu

szoniu commented Nov 7, 2026

Copy link
Copy Markdown

Tested 1768b566d8ca279ba060e052c4709e4f4c78e599 on the same G16 GU605MI (Core Ultra 9 185H + RTX 4070 Laptop), nvidia-open-dkms 615.78.08, kernel 7.2.15, this time on packaged Omarchy 4.5.0. Same method as before: the PR's migrations/1792737693.sh run from a checkout at that commit under bash -euo pipefail, with OMARCHY_PATH set to the checkout and its bin/ on PATH.

Starting point: I removed the rule and rebooted. /dev/nvidia-modeset was missing, while nvidia0, nvidiactl and nvidia-uvm were there.

  1. Ran the migration: rc 0. It installed the rule (identical to default/udev/nvidia-modeset.rules, mode 644), ran udevadm control --reload, trigger and settle, and the node appeared right away, without a reboot.
  2. Ran it again: rc 0, no install and no udevadm calls (traced with bash -x), so the guard still works.

@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 Author

@szoniu’s confirmation names the full current head, 1768b566d8ca279ba060e052c4709e4f4c78e599, and covers the missing-node reproduction, rule installation, immediate node creation and second-run no-op on the G16 GU605MI. That hardware confirmation is now recorded against this revision.

On a disposable worker without an NVIDIA GPU, ./test/cli, nvidia-kms-hook-test.sh, hw-nvidia-test.sh and nvidia-install-packages-test.sh passed. udevadm verify accepted the rule, and the migration left the non-NVIDIA machine unchanged. I also checked the install and first-boot paths against current quattro; the branch merges cleanly and CI is green. The hardware result comes from your machine, since the worker cannot reproduce it.

Greptile’s request to restore the migration test cites the guide from the old branch. Current quattro explicitly forbids migration tests in agents/skills/migrations.md and docs/testing.md, so removing it follows the current rules.

GPT-6 High in Codex reviewed this, with second opinions from Opus 5.5 High and muse-wonder via pi, thinking high. Both found nothing outstanding and agreed that the hardware confirmation covers this head; independence from this review is not guaranteed. No code changes were needed in this run. The hardware confirmation is recorded as verified; the separate readiness check withheld ready, so this remains with the maintainer for assessment.

rdoupe pushed a commit to omarchy-asus/omarchy that referenced this pull request Nov 20, 2026
nvidia-utils' 60-nvidia.rules runs only `nvidia-modprobe -c0 -u`, so nothing creates the modeset node until something on the host opens the NVIDIA driver for display. On a hybrid laptop whose panel hangs off the iGPU that may never happen, and games under umu's Steam Runtime container or Flatpak then fail Vulkan presentation: the container cannot run the setuid helper, and Flatpak only binds the node if it existed when the sandbox was built.

Install the rule the reporter proved on their machine, gated like the packaged one so a GPU bound to vfio-pci is left alone. The setup leaf replays the bind because an image's first boot runs it after coldplug; the migration replays it only while the node is missing, so a retry after a failed udevadm still creates it and another user's run is a no-op.

Fixes omacom#15975

Upstream: omacom#16379 (open), its three commits efd6483,
dcdd06b and 1768b56 squashed, taken as is.

Backport to v4.5.0-rc2: install/hardware/nvidia.sh ends in our patch
0012's hybrid branch (no early load on hybrids), so the rule's install and
the bind replay go after that if/else instead of after the heredoc; the
lines are upstream's.

Co-Authored-By: Maciej Szostak <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rdoupe added a commit to omarchy-asus/omarchy-asus that referenced this pull request Nov 20, 2026
… boot (omacom/omarchy#16379)

On a hybrid whose panel is on the iGPU (the G16), nothing ever runs
`nvidia-modprobe -m`, so /dev/nvidia-modeset is missing after boot and games
in umu's Steam Runtime container or Flatpak can't present: WoW under
GE-Proton drew only a black window (vkCreateSwapchainKHR -13), and every
Play click left another invisible Wow.exe holding about 1.3 GB of VRAM.

Patch 0029 carries upstream's open fix as is: a udev rule that runs
`nvidia-modprobe -m` when an NVIDIA display controller binds to nvidia and
the node is missing, installed by install/hardware/nvidia.sh and by its
migration on existing NVIDIA machines. On our tree the install lines sit
after 0012's hybrid branch in nvidia.sh. docs/deltas.md, NOTES.md and
UPSTREAM_PRS record it; it drops once an Omarchy release ships #16379.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
rdoupe added a commit to omarchy-asus/omarchy-asus that referenced this pull request Nov 20, 2026
… boot (omacom/omarchy#16379) (#428)

* omarchy + omarchy-settings 4.5.0-3.102: create /dev/nvidia-modeset at boot (omacom/omarchy#16379)

On a hybrid whose panel is on the iGPU (the G16), nothing ever runs
`nvidia-modprobe -m`, so /dev/nvidia-modeset is missing after boot and games
in umu's Steam Runtime container or Flatpak can't present: WoW under
GE-Proton drew only a black window (vkCreateSwapchainKHR -13), and every
Play click left another invisible Wow.exe holding about 1.3 GB of VRAM.

Patch 0029 carries upstream's open fix as is: a udev rule that runs
`nvidia-modprobe -m` when an NVIDIA display controller binds to nvidia and
the node is missing, installed by install/hardware/nvidia.sh and by its
migration on existing NVIDIA machines. On our tree the install lines sit
after 0012's hybrid branch in nvidia.sh. docs/deltas.md, NOTES.md and
UPSTREAM_PRS record it; it drops once an Omarchy release ships #16379.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: why /dev/nvidia-modeset comes and goes on the G16, and the manual confirmation (0029)

HDMI-A-1 is on the RTX, so a boot that uses HDMI gets the node from NVIDIA's
KMS path; undocked or docked on DP alone nothing creates it, and 0026's
desktop pins keep even a host vulkaninfo off NVIDIA's ICD. Record vkd3d-proton's
swapchain error, and that the next WoW launch drew its window ten seconds after
nvidia-modprobe -m (docked, no HDMI). The test now runs in that failing setup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: rdoupe <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything! 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.

Hybrid NVIDIA laptops: /dev/nvidia-modeset is missing after boot, so Proton/Flatpak games fail with VK_ERROR_UNKNOWN (black screen)

3 participants