Repository navigation
Skip force-igpu Vfio dance when no NVIDIA GPU is present - #12504
paulogeyer wants to merge 3 commits into
Conversation
The sleep hook ran whenever supergfxctl existed and Integrated mode was configured. On machines without an NVIDIA dGPU, post still tried to switch to Vfio, timed out every resume, and could leave the restore marker behind. Exit early unless a PCI display controller with vendor 0x10de is present. Hybrid/G14 behavior is unchanged when NVIDIA is present. Fixes omacom#12496
Automated AI review
Verified: the change fixes #12496 on machines without an NVIDIA GPU. It also stops the hook on the hybrid NVIDIA laptops the hook was written for. In Integrated mode supergfxd removes the dGPU from the PCI device list, so the new check exits at The PCI check misses the dGPU that supergfxd has removed
In supergfxctl 5.2.7 (the version in Omarchy's package recipe), entering Integrated mode runs Consecutive sleep cycles after booting in Integrated mode, assuming the hook's header premise that the dGPU reappears on wake: The hibernate branch of Impact: on the hybrid NVIDIA laptops the hook targets, the dGPU is left powered after about every other resume. That is the behavior the hook exists to prevent. The skipped Suggested change: detect the dGPU in a way that survives the Integrated-mode removal, and keep the Intel-only case a no-op. Optional approaches:
Optional test improvement: the test plan's "fake NVIDIA PCI" case lists the device at Verified:
Review informationTest scope: source review of the hook at the PR head and base, its installer and migration, supergfxctl 5.2.7 source, and Linux v7.2 PCI removal code. One isolated command-only run executed base and head copies of the hook against a synthetic PCI tree and a supergfxctl stub modeled on the 5.2.7 transitions. No real suspend, resume or hibernate, supergfxd daemon, or GPU hardware was used. The AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for tracking this down. The bug in #12496 is real and this pull request does fix it, but the new gate also turns the hook off on the hybrid laptops it exists for, so it needs a different check before it can land. What was checked. I ran the hook at base ( The bug reproduces and is fixed. With the marker set and a The regression. When supergfxd is in Integrated mode, it takes the dGPU off the PCI bus. At boot and on every Hybrid → Integrated switch it runs
Codex also pointed out that the Tests. A narrower gate. Ask supergfxd instead of sysfs, the way AMD-dGPU hybrids lose the hook under this gate as well, since the toggle is not NVIDIA-specific. A gate that asks supergfxd avoids that too. The mode change to 755 is harmless, because both install paths set 0755 themselves. #11843 also edits This waits on the author: a gate that holds on hybrids in Integrated mode, and a test that does not depend on the host's GPU. |
|
Thanks for this — #12496 is real and still present on One blocking issue before merge: the PCI Narrower gate (same idea as supported=$(/usr/bin/timeout --kill-after=1s 3s /usr/bin/supergfxctl -s 2>/dev/null) || supported=""
# timeout/error must NOT count as "no dGPU"
if [[ $supported == "[Integrated]" ]]; then
exit 0
fiAlso keep the NVIDIA check out of the |
In Integrated mode supergfxd removes the NVIDIA dGPU from sysfs, so the 0x10de probe skipped the hook on the hybrid laptops it exists for. Ask supergfxd for its supported modes in pre only; a timeout/error keeps the hook armed, and post relies on the restore marker alone.
|
Thanks @jandrusk, you're right: in Integrated mode the dGPU is already gone from sysfs, so the PCI probe disabled the hook on the G14s it's for. Pushed a fix:
Tested with a stub harness (fake supergfxctl, no root, no real suspend):
It hasn't been tested on a real G14 in Integrated mode yet, so a run there would be welcome. |
The hook is a root-owned copy that omarchy-toggle-hybrid-gpu and migration 1788662350 publish once, so the new gate never reached a machine that already had the hook, including the T480s in omacom#12496. Replace the copy only when it is exactly one of the two versions quattro shipped, so an administrator's edits survive. Co-Authored-By: Codex Medium <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for the rework. The new gate fixes #12496 without the hybrid regression, and I pushed one commit so the fix also reaches machines that already have the hook installed. What was checked. I installed the real supergfxctl 5.2.7 (Omarchy's package) on a disposable Omarchy worker. The worker has no dGPU, so it is the T480s case, and supergfxd answers
The hybrid side can't be run on a worker, so it rests on supergfxctl's source. What I pushed (eabe187): Tests. Second opinion. Codex Medium reviewed this over three rounds. It found that the template change alone never reached installed machines, which is why the migration was added. It also found that the migration's first version wrote over the hook in place, so it now stages and renames. Its last round, on eabe187, found nothing open. It agreed with the reading of supergfxctl above; independence is not guaranteed. This now waits on the maintainer: the fix is verified, but the shell suite is not green on this branch for the unrelated reasons above. |
Summary
default/systemd/system-sleep/force-igpuran wheneversupergfxctlexisted and Integrated mode was configured. On machines without an NVIDIA dGPU,poststill tried to switch to Vfio, timed out every resume, and could leave the restore marker behind.Exit early unless a PCI display controller with vendor
0x10deis present. Hybrid behavior is unchanged when NVIDIA is present.Fixes #12496
Test plan
supergfxctl+ empty PCI → stockpostfails, patchedpostexits 0