Repository navigation
Fix iMac20,2 AMDGPU startup race - #10169
aurelienbottazini wants to merge 3 commits into
Conversation
|
I have faced exactly same issue with display freezing intermittently post login on Omarchy, a bug report was filed here Please see if that provides any additional context. |
|
I have a related kernel fix under review at t2linux/linux-t2-patches#60, also submitted to AMD yesterday as an RFC. It follows the delayed-UCLK work by Atharva Tiwari and Guna R. Bharati discussed in t2linux/wiki#743. The machine I tested on is an iMac20,1 with Navi14 The current patch does not match this PR's Navi10 There is also a parser detail in the current helper worth checking. On my machine, The T2 7.1.8 source uses that format too. Testing the helper's current awk expression against this output reads |
do you mean it will not fix my machine? I don't see how it can fix my machine if it does not match my board I saw some other mac related patch and I don't know what's the strategy for omarchy regarding fixing it here or on t2 I am happy that we have two working fix |
|
@aurelienbottazini Yes, the old patch excluded your board. I've now included your The AMD staging version has booted successfully 10 times on my Could you both please share your current |
|
Hi @edschofield, I have applied your patch and found success, thanks for the effort. I have uploaded the details and logs in your PR here. |
smu_cmn_get_pp_feature_mask emits "features high: 0x... low: 0x..." on a single line, so matching "low:" as the second field never found it and the helper exited with "cannot parse" on every boot, leaving memory-clock scaling off. The test fixture used two lines and hid it; it now uses the kernel's layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without -e the installer's exit status is only that of its last systemctl call, so a failed Limine drop-in write still let the migration rebuild and record itself complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed by Claude Opus 5.5, with Codex Medium as a second opinion. This is a hardware fix a VM cannot reproduce, so it is waiting on a test from you on the iMac before it can be marked verified. Pushed two fixes to your branch (head is now
Tested on a worker VM (no iMac hardware): One open question needs the hardware. Codex pointed out, and What would settle it: on the iMac, check out Related, for the maintainer: #12203 handles the Navi 14 iMac20 boards (#12197) separately. A kernel-side fix that delays UCLK has been posted to amd-gfx, and the T2 draft that covered this board ( |
|
| cat >"$limine_conf" <<'EOF' | ||
| # Work around SMU initialization failures on the iMac20,2 Radeon Pro 5700 XT. | ||
| # Memory-clock features are restored after the display manager starts. | ||
| KERNEL_CMDLINE[default]+=" amdgpu.ppfeaturemask=0xfff7bffd" | ||
| EOF |
There was a problem hiding this comment.
Fresh installs miss boot mask On a fresh iMac20,2 install, this writes the Limine setting but does not rebuild the boot entries. The remaining install steps do not rebuild them, and first-install provisioning marks the migration that would run
limine-mkinitcpio as already applied. The first boot therefore lacks the AMDGPU mask: the startup race remains, and the new service skips feature restoration because its kernel-command-line condition is not met. Rebuild the boot entries after writing this setting.
|
Checked Greptile's finding that fresh installs miss the boot mask, by Claude Opus 5.5 and with Codex Medium as a second opinion, which agreed. It does not hold, so no change is needed in On a fresh install the hardware scripts run inside Nothing else has changed since the review above: this is still waiting on the hardware test described there. |
Summary
iMac20,2with AMD/Apple PCI IDs1002:7319 / 106b:021b.amdgpu.ppfeaturemask=0xfff7bffdto the generated Limine command line sothe memory-clock feature group is not enabled during the fragile SMU probe.
manager starts, with guards for the boot parameter and exact hardware IDs.
Problem
On this 2020 27-inch iMac, AMDGPU initialization fails intermittently before
the display manager starts. A failed boot consistently contains:
This happens during the kernel probe, so delaying SDDM did not address it.
Loading AMDGPU early from the initramfs also did not address it.
Why this workaround
The default AMDGPU feature mask on the tested kernel is
0xfff7bfff.Clearing
PP_MCLK_DPM_MASK(0x2) gives0xfff7bffd. On Navi10 that keepsthe following features out of the initial SMU allowed-feature set:
With that boot mask, the GPU initializes reliably. Once userspace reaches the
display manager, writing the original three bits back through
pp_featuresrestores memory-clock scaling without a kernel error. The helper preserves all
other feature bits and verifies that the three requested bits were accepted.
The workaround fails closed unless both the exact kernel parameter and all four
PCI IDs match. It discovers the PCI address through sysfs rather than assuming
03:00.0.Hardware and software tested
Validation
A captured unmasked boot reproduced all six SMU/GPU initialization errors
above and failed the AMDGPU probe with
-62.amdgpu.dpm=0was tested as a negative control. It failed differently withfirmware loading/probe error
-95and is not used here.An SDDM readiness gate was tested as a negative control. It could not help
because the GPU failure precedes SDDM.
Four consecutive boots with
amdgpu.ppfeaturemask=0xfff7bffdcompleted withno
Failed to setup smc hw, SMU block-init, or fatal GPU-init messages.The automatic late restore completed with:
DPM_UCLK, MEM_VDDCI_SCALING, and MEM_MVDD_SCALING all read back enabled, and
MCLK returned from the boot-time
0 MHzstate to98 MHzidle.brcmfmacremained loaded during the successful boots, so Wi-Fi driverremoval was not responsible for the result.
Related T2 reports:
The second report independently isolates early DPM_UCLK enablement on the
iMac20,1 Radeon Pro 5300 and demonstrates a kernel-level late-enable approach.
The Omarchy change is intentionally a hardware-scoped userspace workaround
until the T2 kernel carries an equivalent fix for
1002:7319 / 106b:021b.Tests
The new focused test covers hardware matching, nearby-device rejection, feature
restoration, boot-mask enforcement, fresh setup, migration, and migration
idempotence. It passes both directly and as part of
./test/all../test/allwas also run. It completed with five unrelated failures thatreproduce unchanged on the clean upstream checkout:
bar-icon-geometry-test.sh(live Quickshell geometry)launch-about-test.sh(live animation check)config-test.sh(missing siblingomarchy-pkgscheckout)snapper-test.sh(missing siblingomarchy-pkgscheckout)unowned-system-paths-test.sh(missing siblingomarchy-pkgscheckout)