Fix iMac20,2 AMDGPU startup race - #10169
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 |
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)