Repository navigation
Use s2idle on T2 Macs with a discrete GPU - #9105
T1mmsquared wants to merge 2 commits into
Conversation
Deep suspend cannot complete where a discrete GPU is present: amdgpu fails its
noirq suspend ("GPU mode1 reset failed", pci_pm_suspend_noirq returns -22), the
whole transition unwinds, and systemd retries with s2idle anyway. Every failed
pass also rewrites four Apple EFI secure-boot variables.
Integrated-only T2 Macs still get deep, so the suspend fix from omacom#6562 is kept
where it works. A migration moves existing discrete-GPU installs off deep and
rebuilds the boot image.
|
Chiming in: Happy to retest a branch, would love a durable fix to get merged. |
The unanchored VGA|3D|Display pattern also matched the T2 chip's two "Non-VGA unclassified device" lines, so every T2 Mac read as hybrid. That made the s2idle gate in fix-t2.sh and migration 1788072498 fire on integrated-only T2 Macs too, moving them off the deep sleep they resume from, and showed the Hybrid GPU menu entry on machines with one GPU. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reviewed at 54fecac, and I pushed one fix as 5f29ed8. What was wrong. The gate this relies on, What ran, and where. On a disposable Omarchy worker VM, with a stubbed Second opinion. None this time. The configured reviewer (Codex Medium) answered a ping, but the review was refused because the day's review budget was spent. So this review is one model's reasoning: Claude Opus 5.5. Related. #9830 also changes this line of Waiting on. A test of the full head on affected hardware. @T1mmsquared, or @jacobkjones since you offered: on a MacBookPro16,1, please run git clone https://github.com/T1mmsquared/omarchy.git omarchy-9105 && cd omarchy-9105
git checkout 5f29ed8ad19987e1b9bd4fb98867b6a4566e9a8f
PATH="$PWD/bin:$PATH" bash migrations/1788072498.shThen reboot, close the lid once, and reply with the output of |
|
| # transition unwinds, and systemd retries with s2idle anyway. The doomed pass | ||
| # also rewrites four Apple EFI secure-boot variables on every cycle, so ask | ||
| # for s2idle directly on those models. | ||
| if omarchy-hw-hybrid-gpu; then |
There was a problem hiding this comment.
If a T2 Mac has one discrete GPU and no integrated GPU, omarchy-hw-hybrid-gpu returns false when supergfxctl is absent because it requires two GPU entries. Fresh setup then writes mem_sleep_default=deep, and the migration skips the repair. That leaves the machine attempting the deep suspend this change is meant to avoid. The same condition affects the migration at migrations/1788072498.sh:14.
Knowledge Base Used: Hardware profiles and device controls
| grep -Fq 'omarchy-hw-hybrid-gpu' "$fix_t2" || | ||
| fail "T2 setup picks the sleep state from the GPU configuration" | ||
| grep -Fq 'sleep_state="s2idle"' "$fix_t2" || | ||
| fail "T2 setup uses s2idle where a discrete GPU blocks deep suspend" | ||
| grep -Fq 'sleep_state="deep"' "$fix_t2" || | ||
| fail "T2 setup keeps deep suspend on integrated-only models" |
There was a problem hiding this comment.
These assertions only search the setup script for the helper name and both sleep-state assignments. They would still pass if the branches were reversed, while fresh installs would write the wrong sleep state. An execution-level test of the generated configuration for each GPU case would catch that regression.
Knowledge Base Used: Hardware, devices, and power
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!
install/hardware/apple/fix-t2.shdetects T2 Macs by PCI ID (106b:180[12]) and gives every one of them the same kernel command line, includingmem_sleep_default=deep. That works on integrated-only models, but a T2 Mac with a discrete GPU can never complete a deep suspend.On a MacBookPro16,1 (Radeon Pro 5500M), every suspend attempt fails and falls back:
Counted over the journal on this machine: 3 deep attempts, 3
noirq suspend of devices failed, 3GPU mode1 reset failed— a 100% failure rate. The machine still sleeps, because systemd retries with s2idle, so the symptom is easy to miss.Two costs beyond the wasted transition:
AppleSecureBootFailureReason,AppleSecureBootKernelFailureReason,AppleSecureBootWindowsFailureReason,AppleFailedBootVolumeUUID— so every suspend/resume writes NVRAM on hardware where that wear is not free.Approach
mem_sleep_default=deepwas added deliberately in #6562, so this does not remove it. It selects the sleep state from the GPU configuration using the existingomarchy-hw-hybrid-gpuhelper:Integrated-only T2 Macs produce a byte-identical config file to today, so #6562's fix is preserved exactly where it works. Only discrete-GPU models change, and they change to the state the kernel was already falling back to on its own.
Included
install/hardware/apple/fix-t2.sh— pick the sleep state from the GPU configurationmigrations/1788072498.sh— move existing discrete-GPU installs offdeepand rebuild the boot image, following the repair-marker pattern frommigrations/1785944594.shso a pre-reboot rerun stays idempotenttest/shell.d/t2-hardware-test.sh— a stubbedomarchy-hw-hybrid-gpu, plus coverage for the discrete-GPU repair, its idempotency, the integrated-only path that must keepdeep, and non-T2 hardwareTesting
test/shell.d/t2-hardware-test.sh— 10/10 pass (6 pre-existing, 4 new)./test/all— 4 failures, all pre-existing and environmental on this machine: three need a siblingomarchy-pkgscheckout that isn't present, one is a network-dependent theme URL check. None touch T2, suspend, or migrations.linux-t27.1.8. After the change/sys/power/mem_sleepreads[s2idle] deepand the failing deep pass is gone.Scope of the evidence
I can only confirm this directly on a MacBookPro16,1. The other T2 models with discrete GPUs — MacBookPro15,1 / 15,3 / 16,4, iMacPro1,1, MacPro7,1 — should be affected by the same amdgpu failure, but I have not tested them. Happy to adjust the detection if a T2 owner reports otherwise.