Repository navigation
Stop the desktop lag when the NVIDIA driver comes after installation - #18600
danbunnell wants to merge 4 commits into
Conversation
[Medium impact] The PR appears safe to merge; no blocking issue was found. SummaryAdds
No new actionable issues were found. Reviews (7) · Last reviewed commit: "Drop the NVIDIA rebuild migration" · Reviewed by Greptile |
|
Reviewed at 7cee234 against What ran, on a disposable Omarchy worker (x86, virtio GPU,
The Hyprland primary-GPU result itself needs an NVIDIA card, which a worker doesn't have. It rests on the issue's logs, and on this configuration giving the same Second opinion: Codex (medium effort) and muse-wonder (via pi, thinking high) reviewed the same head. Independence isn't guaranteed. Both agree the problem is real and the drop-in's sort order and N1x exclusion are sound. Both also argue that keying early loading on the installed driver, rather than on an NVIDIA GPU, is too broad. That is a decision for the maintainer, not a defect in the code, so it is listed below. I checked their other points against the source, and none needs a change here:
Two smaller points are noted, and neither is specific to this PR. First, the migration's For the maintainer to decide:
This waits on the maintainer. |
|
Greptile's review of the modinfo stub in Re-run on a disposable Omarchy worker at ba14bf6: Codex (medium effort) and muse-wonder (via pi, thinking high) reviewed the commit and found nothing. Both confirmed that it behaves exactly as the old line did and that no other line in this PR breaks the same rule. Independence isn't guaranteed. Nothing else moved. The three decisions in my previous comment are still the maintainer's: what turns early loading on, the |
|
Thank you for the review, the tests and the style fix in ba14bf6. I agree that the maintainer must decide the policy. I also agree that #8263, #16848 and this PR need one policy. This comment gives one more fact for that decision, a proposal and a correction. #8263 causes this bug again on desktops
The statement "a hybrid machine gets early KMS from its iGPU" is correct for the LUKS prompt. But it is not sufficient for Hyprland when the monitor is on the NVIDIA GPU. Thus, "hybrid" is not the correct condition to stop early loading. From its description, #16848 acts only when the NVIDIA GPU has no display connectors. It does not change a desktop that has its monitor on the NVIDIA GPU. Proposal for one policy
Items 3 and 4 read the hardware at build time. A GPU change then has effect at the next rebuild. Today, I can change this PR to follow the policy that you select. If you prefer, I can also make the change for item 1 in a different PR. Correction to question 4Question 4 says that Omarchy has no command that installs the NVIDIA driver after you add a GPU. This is not correct. I will not open the |
|
The head is still ba14bf6, so the worker results in my earlier comments stand. This covers the new comment above. I checked its claims against the code, and Codex (medium effort) and muse-wonder (via pi, thinking high) checked the same. Both agreed with each point below. Independence isn't guaranteed.
I did not check the hibernation point (item 4, #10039 and #8352). None of this changes the code under review. The decisions in my first comment are still the maintainer's: what turns early loading on, the |
|
Classification at the unchanged head ba14bf6 is now unsettled. My review, GPT-6 in Codex (effort not exposed), classifies the failure in #18599 as a bug; the configured classifier, deepseek-v4p1-flash (effort not reported), returned I checked the current diff, linked issue, latest comments and review, base-branch rules, and the existing worker logs. Greptile reports no new findings. No code changed and no tests ran in this pass; the previous worker results remain evidence for the head and base they tested. This waits on the maintainer to resolve the classification and the existing decisions about early loading, the |
|
This comment gives the facts for the classification and the open decisions in one place. If you agree with each recommendation below, this PR needs no more changes. Classification: bugFor the user, this is a defect in a configuration that Omarchy supports, not a new function:
Companion changeomacom/omarchy-pkgs#3222 adds Decisions
One fact for decision 2: a machine that got the driver after installation, and that uses hibernation, has the lag today but resume works. With this PR, the lag stops but resume fails, as on machines from the installer. A fix for resume is necessary for both groups. Thus, I recommend fixing it in one place, not here. If you select a different option, tell me the number and the letter, and I will change this PR. |
ba14bf6 to
6544d48
Compare
|
I read 661ef24 against My classification is |
…nstallation install/hardware/nvidia.sh writes /etc/mkinitcpio.conf.d/nvidia.conf only during installation. Without it, nvidia_drm loads late, Hyprland can make another GPU its primary GPU, and the full desktop is slow. No initramfs rebuild repairs this, because the kms hook does not add out-of-tree modules. nvidia_module.conf adds the four NVIDIA modules at each initramfs build where modinfo finds them for the kernel, except on N1x. It reads no removable hardware, so it stays correct when a GPU is added or removed. A migration rebuilds the initramfs one time on machines with an NVIDIA GPU that need it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AGENTS.md keeps numeric tests out of [[ ]]. Raised by Greptile's review. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Exit 75 when the machine needs the rebuild but omarchy-settings does not ship nvidia_module.conf yet, so the migration stays pending instead of being marked done. Machines without an NVIDIA GPU, or with nvidia.conf, still skip it without waiting. Co-Authored-By: Claude Opus 5.5 <[email protected]>
91-omarchy-initcpio-rebuild.hook (omacom#20287) rebuilds the boot images after an omarchy-settings upgrade that changes /etc/mkinitcpio.conf.d/*.conf, through omarchy-boot-rebuild on Limine and systemd-boot. The upgrade that ships nvidia_module.conf is such a change, so the one-time rebuild happens without a migration. The migration only called limine-mkinitcpio, so it also missed systemd-boot machines. Co-Authored-By: Claude Opus 5.5 <[email protected]>
661ef24 to
b3458ac
Compare
|
I rebased this PR on
The PR now changes six files and no migration. The decisions in my earlier comment do not change. |
|
The new head removes the Limine-only migration. I traced the settings-upgrade hook to the shared boot rebuild command for Limine and systemd-boot. With the NVIDIA driver installed and no installer The CLI suite and both initramfs test files passed. Three files failed in the full shell suite. All three also failed when checked on I reviewed the change in Codex (GPT-6.2 Sol, high effort). Opus 5.5 High and muse-wonder (via pi, high effort) agreed on the cause and the rebuild path. The reviewers may have seen the same reasoning. A maintainer decision remains on early loading for hybrid or offload-only systems, including hibernation and preserving edits to the drop-in across upgrades. Packaging companion #3222 Could a maintainer with the affected dual-GPU setup confirm GPU selection on |
What changes
Fixes #18599.
install/hardware/nvidia.shwrites/etc/mkinitcpio.conf.d/nvidia.confonly during installation. A machine that gets its NVIDIA GPU or driver later does not have this file. On that machine,nvidia_drmloads from the root file system, and Hyprland can start first. Hyprland then uses another GPU as its primary GPU and copies each frame to the NVIDIA outputs. The full desktop is slow.No initramfs rebuild repairs this. The
kmshook adds only in-tree modules, for example fromdrivers/gpu/drm/. The NVIDIA modules are out-of-tree modules inupdates/dkms/orextramodules/.This PR makes these changes:
etc/mkinitcpio.conf.d/nvidia_module.conf(new): At each initramfs build, this drop-in addsnvidia nvidia_modeset nvidia_uvm nvidia_drmtoMODULESwhenmodinfofinds all four for the kernel. It does not add them in these conditions:MODULESalready containsnvidia_drm, for example fromnvidia.conf.install/hardware/n1x.shcontrols the NVIDIA driver on N1x.omarchy-hw-aarch64-n1xyet.The name follows
thunderbolt_module.conf. The file sorts afternvidia.confand beforeomarchy_hooks.conf, becauseomarchy_hooks.confreadsMODULESto remove thekmshook.No removable hardware in the decision: The drop-in does not look for an NVIDIA GPU. The N1x check reads only fixed platform IDs. Package transactions change the installed modules. The mkinitcpio pacman hook (on systemd-boot, the Omarchy override with the same triggers) rebuilds the initramfs when a transaction installs, upgrades or removes
usr/src/*/dkms.conf(nvidia-open-dkms) orusr/lib/modules/*/extramodules/(linux-omarchy-nvidia-open). Thus, the decision stays correct when you add or remove a GPU. A check for an NVIDIA PCI device would make the decision incorrect after a GPU change, until the next rebuild.Kernels without the modules: Where
nvidia.confdoes not exist, a kernel that does not have the NVIDIA modules builds without them. Withnvidia.conf, the build of that kernel still fails, for example a stocklinuxkernel without a DKMS build.No migration:
91-omarchy-initcpio-rebuild.hook(Rebuild boot images on omarchy-settings upgrades only when initramfs inputs change #20287) rebuilds the boot images after theomarchy-settingsupgrade that ships this drop-in. It usesomarchy-boot-rebuild, on Limine and on systemd-boot. Thus, machines that need the modules now get them at that upgrade. An earlier version of this PR had a migration for this rebuild. I removed it, because it only usedlimine-mkinitcpio.Tests:
test/shell.d/mkinitcpio-hooks-test.shhas three new cases and one renamed case.fake_platformintest/shell.d/base-test.shnow also makes anaarch64-n1xfixture.Comments and docs:
omarchy_hooks.conf,default/settings-runtime-profileanddocs/file-layout.mdname the new drop-in.install/hardware/nvidia.shdoes not change.install/user/hardware/fix-nouveau-cursor.shand some migrations use its files as markers.bin/omarchy-provision-hardwareuses them as inputs for the first-boot rebuild of images.Size
The four modules and their firmware add approximately 91 MiB to each image. On the RTX 3090 machine with driver 615.78.08, the image changes from 166 MiB to 257 MiB:
This cost applies in these conditions:
nvidia.confalready adds the same modules.nvidia.confkeeps this cost after a GPU removal and never removes it.The
kmsfilter from #6791 does not change. An NVIDIA-only machine still has no nouveau firmware.Alternative: The drop-in can also require
omarchy-hw-nvidia. Then a machine with the driver but no NVIDIA GPU does not get the modules. But when you add the NVIDIA GPU, no rebuild occurs. The driver then loads late until the next kernel update. I think that the size cost is better than this stale state. I can make this change if you prefer it.Companion change
omacom/omarchy-pkgsmust addetc/mkinitcpio.conf.d/nvidia_module.conftobackup+=inpkgbuilds/omarchy-settings/PKGBUILD, next toomarchy_hooks.conf. Then pacman keeps a change that a user makes to the file. This is the opt-out. The companion change must be in the same release as this PR or in an earlier release. It is omacom/omarchy-pkgs#3222 (draft).Questions for maintainers
/etc/mkinitcpio.conf.d/nvidia.confto stop the early load will get the early load again. Their opt-out is a change tonvidia_module.conf.nvidia.shstop writing/etc/mkinitcpio.conf.d/nvidia.confin a later PR?omarchy apply hardware --install-user USERrunsinstall/hardware/nvidia.shagain, which installs the driver and writesnvidia.conf. But the command is hidden, nothing starts it when you add a GPU, and it does not rebuild the initramfs. On the affected machine, the user installednvidia-open-dkmswith pacman. Must Omarchy show this command to users, in a different PR?Limits
options nvidia_drm modeset=1. It uses the default of the driver. Drivers 560 and later, which includes 580xx, enable modesetting by default.surface_device_modules.confsetsMODULES=(...)and sorts after this drop-in. Thus, a Surface with an NVIDIA GPU does not get the early load. This is the same as withnvidia.conftoday.autodetectand thekmsfilter use the hardware at build time. A GPU change for these drivers needs a rebuild, as before.Verification
bash test/shell.d/mkinitcpio-hooks-test.sh: 47 of 47 pass. Each new case fails when I change the part of the drop-in that it tests:nvidia_drmcheck../test/shellwithOMARCHY_TEST_USE_LIVE_COMPOSITOR=1(the headless compositor did not start on this machine): 288 of 290 files pass.bar-drag-test.shalso fails onquattro.config-test.shread an old localomarchy-pkgscheckout; withOMARCHY_PKGS_PATHat the currentomarchy-pkgsmaster, it passes.boot-initcpio-sync-test.shpasses.Real build on the affected machine (RTX 3090 and Radeon 610M,
nvidia-open-dkms615.78.08,linux-omarchy7.2.15):/etc/mkinitcpio.confand all drop-ins to a temporary directory. I removednvidia.confand addednvidia_module.confand the changedomarchy_hooks.conf.MKINITCPIO_CONF=<dir>/mkinitcpio.conf mkinitcpio -k "$(uname -r)" -g <dir>/test.img.confighasMODULES="nvidia nvidia_modeset nvidia_uvm nvidia_drm thunderbolt". The image contains the four.ko.zstfiles and the NVIDIA firmware.kmsstays, because the machine has an iGPU.Boot result of the early load on the affected machine. I made the repair with the installer's
nvidia.conf, which gives the sameMODULES:amdgpu(iGPU)nvidia-drmNVRM: RmImportObjecterrorsEGL (blit)errors in the Hyprland logNo NVIDIA GPU: I read the boot path in the source. The busybox
initloadsMODULESwithmodprobe -qab. With no device,nvidia.koprintsNVRM: No NVIDIA GPU found.and returns-ENODEV. The other three modules then fail. The boot continues, and withquietthe console shows no message.Not checked:
nvidia_module.conf.nvidia-580xx-dkms.linux-omarchy-nvidia-openpackage. I read its PKGBUILD inomarchy-pkgs: it installs intoextramodules/.Screenshots
No visible change in the UI: this PR changes only the initramfs configuration. The Verification section shows the boot result.
🤖 Generated with Claude Code