Repository navigation
Conversation
install/hardware/nvidia.sh wrote MODULES+=(nvidia ...) into the initramfs on every NVIDIA machine. On a hybrid laptop that breaks resume from hibernation: the kernel freezes devices to restore the image while the driver is already loaded but its procfs suspend interface was never called (nvidia-hibernate .service only runs from the real root), so nv_pmops_freeze returns -5 and the machine boots fresh. The iGPU already provides early KMS there, and udev loads nvidia once root is mounted, so the early load buys nothing. Add omarchy-hw-nvidia-only-display (the sysfs scan omarchy_hooks.conf already does inline), early-load only when it says NVIDIA owns every display controller, and migrate existing hybrid installs with a one-time rebuild.
There was a problem hiding this comment.
Pull request overview
Prevents hybrid NVIDIA systems from early-loading NVIDIA drivers, enabling hibernation resume while preserving NVIDIA-only boot behavior.
Changes:
- Adds sysfs-based GPU detection.
- Conditionally configures NVIDIA initramfs modules.
- Migrates existing hybrid installations.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
bin/omarchy-hw-nvidia-only-display |
Detects NVIDIA-only display configurations. |
install/hardware/nvidia.sh |
Limits early driver loading to NVIDIA-only systems. |
migrations/1787683023.sh |
Removes stale hybrid configuration and rebuilds initramfs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| sudo rm -f "$nvidia_conf" | ||
| sudo limine-mkinitcpio |
There was a problem hiding this comment.
The migration now copies nvidia.conf to a temp file before removing it; if limine-mkinitcpio fails it reinstalls the drop-in, prints why, and exits 1, so the next run hits the -f check with the file present and rebuilds again. Covered by "restores the drop-in when the rebuild fails" and "retries after a failed rebuild" in the new test (0cdb9d6).
| omarchy-hw-nvidia-only-display && exit 0 | ||
|
|
||
| echo "This is a hybrid GPU machine; removing nvidia from the initramfs and rebuilding it" | ||
| sudo rm -f "$nvidia_conf" | ||
| sudo limine-mkinitcpio |
There was a problem hiding this comment.
Added test/shell.d/nvidia-hybrid-initramfs-migration-test.sh, modelled on nvidia-kms-migration-test.sh: hybrid removal + rebuild + marker, machine idempotence, rebuild failure → drop-in restored and no marker → retry rebuilds, NVIDIA-only skip, and the no-limine / no-drop-in skips. Also hw-nvidia-only-display-test.sh for the helper (NVIDIA-only, NVIDIA + audio function, Intel/AMD hybrids, no NVIDIA, empty tree, unreadable device stays conservative).
If limine-mkinitcpio fails after nvidia.conf is removed, a rerun would exit at the file check and the machine would keep its stale image for good. Back the drop-in up and put it back on failure so the migration retries. Test the migration (hybrid rebuild + marker, idempotence, failure restore and retry, NVIDIA-only and not-applicable skips) and the new helper.
|
Following up on omarchybot's analysis in #8215, which points out that this PR's Agreed. Happy to rebase onto whichever helper lands first — if #7851's merges, I'll switch One point on the predicate itself, since the bot suggests "the dGPU drives no connected output" as a better discriminator for the VA-API case. For the initramfs question the two predicates give different answers on real hardware, and the vendor scan is the one hibernation needs:
The one shape the vendor scan misjudges is a muxed laptop switched to discrete mode: it has an idle iGPU, so this PR drops the early load and the LUKS prompt would rely on the iGPU's KMS for a panel that's routed to NVIDIA. If that case matters, the narrowest fix is to keep the early load when NVIDIA has a connected output and no other display controller has one — I'm glad to add that as a follow-up if maintainers want it, but I'd rather not widen this PR before there's a decision on the shared helper. |
|
Confirming this on a second, quite different machine — same failure, same fix. System: ThinkPad T480 (20L6S5JT00), i7-8650U, Intel UHD 620 Worth noting the spread from your Strix G16: different driver branch (580xx proprietary vs nvidia-open 610.x), different GPU generation (Pascal vs Ada), different platform generation. The signature is identical, so this isn't specific to Before — resume aborted at 90% of the image load: with the NVRM line you quote appearing in the preceding boot: After dropping and hibernate/resume completes. Verified it was a true resume and not a fallback boot by comparing On "does this just hand the dGPU to nouveau instead?" — reasonable worry, and no: On the predicate: the MX150 here is class Caveat on attribution: I applied the #8471 resume-hook reorder (PR #8888) in the same initramfs rebuild, so this doesn't isolate the NVIDIA change. The |
|
same issuse on AMD iGPU + NVIDIA DGPU |
|
Reviewed at 0cdb9d6 against current What was run. On a disposable Omarchy worker,
Both new test files pass on the worker (7 and 6 checks). The full What was not run. A real hibernate and resume. The worker has no NVIDIA hardware, so the table above shows the initramfs configuration changing as intended, not resume working. Findings. Nothing blocking in the diff. Three notes for the maintainer:
#10065 covers hibernation on NVIDIA-only desktops too, and on non-NVIDIA GPUs, by stripping GPU drivers from the initramfs whenever hibernation is configured. The two overlap on hybrid NVIDIA laptops. Which to take, or whether to take both, is the maintainer's call. What this needs next. A resume test of this exact commit on a hybrid machine that still has Please reply with whether it resumed, the two |
|
Second review at the same head, 0cdb9d6, this time with a second opinion: Claude Opus 5.5 and Codex Medium both read the diff. It still merges cleanly into current The diff. Neither model found a defect in the configuration path. On hybrid machines The skipped-rebuild case from edbron#1. @vfrolov is right that The competing fix, #10065. The two models disagree on this one:
The two PRs overlap in What this waits on. The maintainer, for the choice above. The hardware resume test asked for in the comment above is still the only thing that would show resume working on this commit. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every fix now has its own topic branch, rebased on upstream quattro, with its pull request draft in fork/prs/. New: asus/audio (ALC285 Master), asus/hdmi-cursor (software cursor while a monitor hangs off the NVIDIA card), asus/rtkit, and omacom#8263 carried as carry/initramfs-8263. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Another confirmation, on an AMD iGPU + NVIDIA dGPU laptop (the AMD side hasn't been covered yet in detail above). System: AMD Renoir iGPU Before (hibernate writes the image, resume boots fresh). The image is found and loads completely, then the freeze callback aborts it: After that the machine continues into a normal boot and the session is lost. On the predicate: both GPUs here are I'm applying the same change locally (removing |
|
Follow-up to my comment above: the change fixes resume on this machine (AMD Renoir + GTX 1650 Mobile, Removed A data point for the dGPU-wired-output caveat you raised in your earlier comment: on this laptop the external DisplayPort is wired to the NVIDIA GPU ( So on this hardware the trade is "resume works, LUKS prompt is internal-only." That's fine for a laptop with its lid open. Docked with the lid closed you'd have to type the passphrase blind. It might be worth a line in the PR description or the migration's echo so docked users aren't surprised. |
|
Third review at the same head, 0cdb9d6. It was prompted by @RajdeepVerma's results above and by the related pull requests opened since the last review. It still merges cleanly into current New hardware evidence. @RajdeepVerma tested an AMD Renoir laptop with a GTX 1650 Mobile. Removing Choosing between the competing fixes. Both reviewers were given this PR, #10065 and #16848 without our own answer, and both picked #10065. The reason is a case this PR leaves out: on a machine where NVIDIA is the only GPU, the PR keeps loading nvidia early ( A collision with #18600. #18600 adds Things to change in this PR if it goes ahead. Both checked by reading
Both reviewers also noted that the migration takes any "no" from What this waits on. The maintainer, to choose between this approach and #10065's. |
|
This change causes #18599 again on desktops. I found this during the review of #18600.
The iGPU gives early KMS for the LUKS prompt. But when the monitor is on the NVIDIA GPU, Hyprland also needs A condition such as "the NVIDIA GPU drives no display", like the connector check in #16848, keeps the hibernation fix for laptops and does not change these desktops. In #18600 I proposed one policy for #8263, #16848 and #18600: #18600 (comment) |
|
Rechecked @danbunnell's new comment against the unchanged head, The configuration claim is correct: One detail in the proposed alternative matters: #16848 checks whether NVIDIA exposes connector entries, regardless of whether a monitor is connected. It preserves early loading on a desktop card with outputs, but also on the dGPU-wired laptop that @RajdeepVerma reported above. Its predicate therefore does not cover every hibernation case this PR covers. #10065 still defers GPU drivers more broadly, and #18600 would add the NVIDIA modules back after this migration removes the drop-in. The #10065 and #16848 heads are unchanged since the preceding comparison; I checked #18600 at The fresh second-opinion review did not run: the brief exceeded the review launcher's command-line size limit. A separate availability probe succeeded for Opus 5.5 High and muse-wonder (via pi, thinking high), so they are available, but neither reviewed this update. This remains waiting on the maintainer to decide how early loading should work across these hardware cases. No code or labels changed, and the exact-commit hardware test requested above remains outstanding. |
|
Thanks for the thorough reviews. Data point for the predicate discussion: on my AMD Renoir + GTX 1650 Mobile laptop, the iGPU ( What separates this laptop from @danbunnell's RTX 3090 + Radeon 610M desktop is where the internal panel is. Proposal: remove early NVIDIA only when a non-NVIDIA GPU owns an internal-panel connector ( Happy to update the helper and its test if the maintainer wants to go this way. Also noting for #18600: it should apply the same condition, or it re-adds the modules after this migration. |
|
Rechecked @RajdeepVerma's internal-panel proposal at unchanged head The connector check in #16848 keeps early NVIDIA on the reported laptop because its NVIDIA GPU exposes On a disposable Omarchy worker, the installer configuration matrix showed early NVIDIA on hybrid fixtures on current base, its removal on this head, and early loading again with the installer fix reverted. NVIDIA-only fixtures stayed unchanged. All 116 CLI checks and 9 existing NVIDIA hook checks passed. The newer Checked by GPT-6 in Codex (effort not exposed), with second opinions from Opus 5.5 High and muse-wonder via pi, thinking high. Both agreed that the proposed boundary needs a maintainer decision and that #18600 still conflicts with this removal; their independence from this review is not guaranteed. This remains waiting on that decision. Full-head hardware confirmation is still outstanding. No code or labels changed. |
Stop early-loading the NVIDIA driver on hybrid GPU machines so hibernation can resume
Problem
On a hybrid laptop (Intel/AMD iGPU + NVIDIA dGPU), hibernate writes the image fine but resume silently boots fresh. The previous boot's journal shows:
install/hardware/nvidia.shwrites/etc/mkinitcpio.conf.d/nvidia.confwithMODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)on every NVIDIA machine. During resume the kernel freezes devices before restoring the image; the driver is already loaded from the initramfs, but nothing has called its procfs suspend interface (nvidia-hibernate.serviceonly runs from the real root), sonv_pmops_freezereturns-EIOand the resume is abandoned.On a hybrid machine the early load buys nothing, the iGPU already provides KMS at the LUKS prompt and udev loads nvidia normally once root is mounted. Removing the modules from the initramfs fixes resume; I've been running this way on an ASUS ROG Strix G16 (Raptor Lake-HX + RTX, nvidia-open-dkms 610.57.04, linux 7.1.8, LUKS + btrfs,
resume=/resume_offset=).Change
bin/omarchy-hw-nvidia-only-display(new): true when NVIDIA owns every display controller. Reads sysfs likeomarchy-hw-nvidia-gsp(nolspci, so it doesn't wake a runtime-suspended GPU), and treats any unreadable device as "another GPU" so the answer errs toward not early-loading. It is the same scanomarchy_hooks.confalready does inline to decide whether to drop thekmshook.install/hardware/nvidia.sh: writenvidia.confonly when that helper says NVIDIA-only; otherwise ensure it is absent.migrations/1787683023.sh: on existing hybrid installs, removenvidia.confand rebuild once vialimine-mkinitcpio, with a marker so the machine-wide rebuild isn't repeated per user (same pattern as1786605598.sh).NVIDIA-only machines are unchanged: they still early-load and still drop
kms.omarchy_hooks.conf's conditional keys offnvidia_drminMODULES, so on hybrid machines (whereMODULESno longer contains it) it keepskms, which is what it did before anyway.Testing
OMARCHY_PCI_DEVICES_PATHtree with a single0x10declass-0x03device.lsinitcpioshows 0 nvidia entries),systemctl hibernateresumes to the running session; before the change every hibernate ended in a fresh boot with the log lines above.Fixes #8352