Skip to content

Lock the lid and idle the Radeon on 15-inch 2016–2017 MacBook Pros - #7196

Open
shawnyeager wants to merge 10 commits into
omacom:quattrofrom
shawnyeager:mbp15-dgpu-sleep
Open

shawnyeager wants to merge 10 commits into
omacom:quattrofrom
shawnyeager:mbp15-dgpu-sleep

Conversation

@shawnyeager

@shawnyeager shawnyeager commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On the 15-inch 2016–2017 Radeon MacBooks, closing the lid no longer suspends. That path does not resume, so the machine stays on, locks, idles the GPU, and disables the internal output so the 560 stops scanning out.

Independent of the Touch Bar and CS8409 speaker work. Verified on MacBookPro14,3. 13-inch T1 models are Intel-only and are not included.

Why

Stock lid-suspend is a hard reboot on these boards.

Stay-on with the lid closed still cooked the chassis. amdgpu sat on 3D_FULL_SCREEN (~13 W at 0% busy). Backlight 0 still scanned out eDP. Hyprland DPMS did too — the CRTC stayed up. Stock key_press_enables_dpms / mouse_move_enables_dpms then turned scanout back on. Clamshell then force-enabled the internal panel on every monitorremoved, which undid the blank.

A powerprofilesctl set power-saver overlay on lid close put BCM43602 (14e4:43ba) into PCI D3/ASPM. brcmfmac does not come back from that.

What

  • Detector is MacBookPro13,3 / 14,3 only.
  • Lid switch locks. systemd refuses suspend and hibernate. The menu hides those rows.
  • The discrete GPU stays bound. POWER_SAVING lets Polaris drop clocks at idle. This is not a GPU power-off.
  • Lid close disables the internal output (hl.monitor({ disabled = true })) and persists that in a Hyprland toggle so a reload does not bring the panel back. Key/mouse DPMS-wake is held off. It does not set power-saver.
  • Clamshell does not force-enable the internal panel while the lid is shut with no external, so a monitorremoved event cannot undo the disable.
  • Open drops the toggle, restores the panel, brightness, the wake flags, and omarchy-powerprofiles-set autodetect.
  • BCM43602 stays PCI-awake: udev power/control=on and d3cold_allowed=0, applied at install and by migration 1788634178.
  • A docked lid close skips the overlay so the external display stays usable.
  • Migration seeds AC=balanced only if the user has never chosen a profile.
  • The NVMe d3cold unit follows nvme0 instead of 0000:01:00.0 (the Radeon on these machines).

No mux, no rEFInd, no voicing.

Related: #7064, #7140

Test plan

  • test/shell.d/mbp15-dgpu-test.sh (detector, idle profile, lid overlay, output disable, wake-flag save/restore, wifi PCI pin, no lid-close power-saver)
  • test/shell.d/lid-close-test.sh (lock, then clamshell, then 15-inch chill)
  • test/shell.d/monitor-clamshell-scale-test.sh (clamshell does not re-enable a shut undocked panel)
  • MacBookPro14,3: POWER_SAVING idles ~214–320 MHz; lid lock + backlight 0; open restores
  • Live lid close after this commit: confirm eDP is disabled (hyprctl monitors all) and GPU power drops, and that a key/mouse does not bring the panel back. Tests cover the helper; that close was not run in this session.
  • MacBookPro14,3: lid close leaves wlan up; power/control on 14e4:43ba stays on.

S3 and s2idle do not resume on MacBookPro13,3 / 14,3. Lid close now
locks, systemd refuses suspend/hibernate, and the menu hides those
rows. The discrete GPU stays bound; POWER_SAVING lets Polaris drop
clocks at idle instead of sitting on the 3D_FULL_SCREEN rung.

The NVMe d3cold unit now follows nvme0 instead of assuming 01:00.0,
which is the Radeon on these 15-inch machines.
Stay-on with the lid closed still cooked the panel backlight and left
the CPU in the snappy profile. Close now dims gmux and sets
power-saver without writing Omarchy's remembered AC/battery choice.
Open restores brightness and runs powerprofiles-set autodetect.
Seed AC=balanced once so a reboot is not performance.
Clamshell is display math. Restore the 15" power-saver overlay from
omarchy-system-lid-open, which is now the default lid-open bind.
udev bind is enough to apply POWER_SAVING; a second boot unit was
redundant.
Backlight 0 still drives eDP. With suspend banned, a closed lid then
soaks the chassis (Touch Bar included) for as long as the machine stays
on. Disable DPMS on close; enable and restore brightness on open.
powerprofilesctl set power-saver on lid close puts the Broadcom
card into PCI D3/ASPM. brcmfmac on 14e4:43ba does not come back.

Stop that overlay. Pin the card with power/control=on and
d3cold_allowed=0, same stay-awake as the Thunderbolt xHCI quirk.
Lid-open still runs autodetect so a machine already stuck in
power-saver recovers.
DPMS and backlight-off still leave eDP scanning. Disable the internal
output, persist that across reloads, and do not let clamshell turn it
back on while the lid is shut with no external.
@makoni

makoni commented Sep 15, 2026

Copy link
Copy Markdown

I have lid-close suspend and resume working on a MacBookPro14,3, so I wanted to put numbers against the premise before this lands. The GPU-idling and clamshell half of this PR stands on its own either way — this is only about "stock lid-suspend is a hard reboot on these boards".

Six suspend/resume cycles on a MacBookPro14,3, stock systemd-logind lid path, Omarchy 4.0.3, kernel 7.2.3-arch1-3, Radeon Pro 560 + HD 630 over gmux, internal panel on the dGPU (card1-eDP-1; i915 has no connected output):

slept  0.7 min  ->  resumed in 0.67 s
slept  1.5 min  ->  resumed in 0.68 s
slept  2.0 min  ->  resumed in 0.69 s
slept 12.0 min  ->  resumed in 0.75 s
slept 10.2 min  ->  resumed in 0.76 s
slept  3.0 min  ->  resumed in 0.77 s

One important qualification: the lid does not wake this machine — a keypress does. Opening the lid leaves it asleep indefinitely (I left it 12 minutes and 10 minutes on two occasions); pressing any key resumes it in well under a second. The lid registers ACPI events but never a wake event — /sys/kernel/debug/wakeup_sources shows PNP0C0D:00 with event_count=2, wakeup_count=0. LID0 is already *enabled in /proc/acpi/wakeup, enabling EC as well changed nothing, and acpi.ec_no_wakeup is N. This matches discussion #4695, which notes lid-triggered wake is inconsistent across these hardware variants. So: suspend is reachable and resume is fast, but wake is keyboard-driven here.

What it took, and why I think you are one step away from it. You already pin the Wi-Fi awake — power/control=on and d3cold_allowed=0 on 14e4:43ba. That is exactly the treatment that turned out to be load-bearing; the difference is scope. Three things together:

  1. mem_sleep=s2idle. deep never resumes on this board in any configuration I tried — the journal simply ends at PM: suspend entry (deep).
  2. d3cold_allowed=0 on every PCI device, not only the BCM43602. Staged /sys/power/pm_test runs put the first blocker on the Wi-Fi exactly where you found it, but once that was pinned the same failure moved to the Thunderbolt bridges and the xHCI controllers behind them.
  3. power/control=on on the pcieport bridges. They runtime-suspend into D3cold on their own when nothing is plugged in, and d3cold_allowed does not prevent it — by the time the flag is written they are already gone.

2 and 3 are both required. I dropped 3, kept 2, rebooted and closed the lid: no resume, journal ends at PM: suspend entry (s2idle) with zero D3cold errors logged before it. That was the only failed cycle of the seven.

Two things that cost me hours, in case they save you some.

/sys/power/pm_test is excellent for finding which device blocks the transition — it stages the suspend and auto-resumes after five seconds, so the journal survives, which a genuinely failed resume never does. It is not valid for comparing configurations: a device left stuck in D3cold by one trial stays stuck and contaminates the next. My staged runs said measure 2 alone was sufficient; the real lid close said otherwise, and the real lid close was right.

Do not unload thunderbolt around sleep. It unloads cleanly, but the controllers never re-probe — timeout resetting host router, cannot enable interrupts, probe failed with error -22 — and Thunderbolt is dead until reboot. The tb_cfg_read: -108 warnings on resume are noisy (about 14 per wake, ~1800 journal lines) but harmless; resume is 0.7 s with them present.

Caveats. One machine, one session. s2idle is not S3: the fans keep spinning with the lid shut, so your thermal argument for idling Polaris may well still apply during suspend — I have not measured chassis temperature over a long sleep, and that seems worth checking before treating these as alternatives. The T1 Touch Bar also goes dark across resume and needs its stack reloaded from a system-sleep hook, but that is #10825 territory rather than this PR's.

None of this touches the docked/clamshell half of your work. But if suspend is reachable on these boards, then systemd refusing suspend and hibernate outright, and hiding those menu rows, is a heavy hammer — and I wanted the measurements on the record before it lands.

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Sep 27, 2026
omarchybot and others added 2 commits September 28, 2026 06:03
The skip ran on every laptop, so an undocked lid close anywhere else left the panel disabled going into suspend, with no output for the lock surface (omacom#13300).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 15-inch lid-closed toggle is only cleared by the lid-open binding. A machine that powers off with the lid shut, which a lid that no longer suspends makes likely on battery, boots with the panel disabled and nothing else to show on. The recovery unit that already does this for the manual toggle now does it here too, when the lid is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 6c7e2aea594aaab87f253dcb3e4ab599dd78f2e1 against quattro. I pushed two fixes to the branch. The findings below are still open, and whether these models should refuse suspend at all is for the maintainer to decide.

Checked. I read the diff and the lid, clamshell, lock and recovery code it plugs into. On a disposable Omarchy ISO worker, ./test/cli passed, and so did mbp15-dgpu-test.sh, monitor-clamshell-scale-test.sh, lid-close-test.sh, monitor-recovery-test.sh and config-test.sh. With the two fixes reverted, the two new tests fail. No MacBookPro13,3 or 14,3 was available, so none of the lid, GPU or Wi-Fi behaviour was reproduced. It was only read.

Pushed

  • bced4f80: the new elif in omarchy-hyprland-monitor-clamshell skipped enable_internal on every laptop whose lid shut with no external display, not just these two models. Everywhere else that lid close suspends, so the panel stayed disabled going into sleep, with no output for the lock screen to draw on. That makes Undocking with the lid closed suspends with no active output: black screen after resume (clamshell race) #13300 certain instead of a race. The skip is now gated on omarchy-hw-apple-mbp15-dgpu, and a test covers the non-Mac case.
  • 6c7e2aea: only the lid-open binding removes internal-monitor-lid-closed.lua. A 15-inch that powers off with the lid shut never sees lid-open, and a lid that no longer suspends makes that likely on battery. The next login would then load the toggle and start with the only panel disabled. omarchy-hw-recover-internal-monitor already does this cleanup at session start for the manual toggle. It now also drops this toggle when the lid is open, and its unit runs when either file exists.

Still open

  • bin/omarchy-system-lid-close:25: the panel is disabled right after the lock is requested, without waiting for the session to be secure. The lock service waits 500 ms before taking the session lock and holds off while no real screen exists (shell/plugins/lock/Service.qml, requestSessionLock). Disabling the only output first leaves the lid-closed session unlocked, and on reopen the lock races the panel coming back. omarchy-system-sleep-lock already waits for secure and is the pattern to follow.
  • migrations/1786920500.sh:10-19: the AC-profile seeding runs twice, once as the user and again after the sudo re-exec. Under sudo HOME is root's, so the state-file check finds nothing and omarchy-powerprofiles-set ac balanced runs even for a user who saved performance. It also calls powerprofilesctl set straight away, on battery too. Only the machine-wide part needs root.
  • default/udev/apple-mbp15-amdgpu-idle.rules:3 matches only ACTION=="bind". With the kms hook in the initramfs, amdgpu binds before this rule is on disk, and boot coldplug replays add, not bind. So POWER_SAVING may apply only when the installer or migration runs, never after a reboot. After a reboot, can you check whether pp_power_profile_mode still shows POWER_SAVING active?
  • bin/omarchy-hw-apple-mbp15-lid:159: lid-open restores the saved brightness but never removes the file. After a docked close, which saves nothing, opening the lid restores whatever an older undocked close saved.
  • install/hardware/apple/fix-suspend-nvme.sh: the change only reaches fresh installs. On existing 13,3 and 14,3 machines the unit still writes to 0000:01:00.0, which is the Radeon. Target the actual NVMe controller in Apple suspend fix #10877 and Scope the MacBook NVMe suspend fix to Apple's NVMe controller #11624 fix the same bug (NVMe suspend fix targets the dGPU on MacBooks with discrete graphics #10826) with migrations, and they disagree on whether these two models should get the NVMe fix at all. This part belongs with them, not here.

Scope and premise. This one PR carries four independent changes: lid and sleep policy, Radeon idle, the BCM43602 PCI pin, and NVMe. Splitting out the Wi-Fi pin and the NVMe change would leave a much smaller PR about the lid. @makoni measured six s2idle suspend/resume cycles on a MacBookPro14,3, with D3cold disabled across PCI and power/control=on on the bridges. That contradicts "cannot resume", which mbp15-dgpu.sh turns into AllowSuspend=no and AllowHibernation=no for every owner of these models. Whether to refuse sleep outright is the maintainer's decision. By the PR's own test plan, the final lid close, which disables the output, has not been run on hardware. Confirmation at 6c7e2aea from someone with a 13,3 or 14,3 would settle that part.

Second opinion. Codex Medium reviewed the same head. It found the lock-ordering gap, the sudo HOME problem, the udev bind gap and the stale brightness. I checked each against the source. It agreed that both pushed fixes are correct, though its independence is not guaranteed. It also flagged the recovery script ignoring XDG_STATE_HOME, which I did not act on: the clamshell and recovery scripts on quattro already hardcode ~/.local/state.

Waiting on the author for the open findings, and on the maintainer for the suspend policy.

@makoni

makoni commented Oct 1, 2026

Copy link
Copy Markdown

Confirming the ACTION=="bind" concern from the review, since I have one of the two affected models here (MacBookPro14,3).

amdgpu is in the initramfs on this machine — mkinitcpio with the kms hook — so it binds long before any rule from /etc/udev/rules.d exists. Times below are _SOURCE_MONOTONIC_TIMESTAMP, i.e. when each event actually happened. Worth stressing, because journalctl -o short-monotonic prints journald's receipt time instead, and journald starts late enough here to bunch every kernel message together around 17.7 s:

 6.691970  [drm] Initialized amdgpu 3.64.0 for 0000:01:00.0 on minor 1
17.129703  systemd 261.2-1-arch running in system mode
18.879414  USEC_INITIALIZED of 0000:01:00.0

The device is up and registered by 6.69 s, with fbcon following at 6.71 s. The banner at 17.13 s is PID 1 on the root filesystem — there is exactly one in this boot, and no Running in initrd. follows it — so amdgpu is bound 10.4 s before the root filesystem is up at all. udev first initializes the device 12.2 s later still, at 18.88 s.

The initramfs does ship systemd-udevd, but it carries only eight rules, all from usr/lib/udev/rules.d:

10-dm.rules  13-dm-disk.rules  50-udev-default.rules  60-persistent-storage.rules
64-btrfs.rules  71-seat.rules  80-drivers.rules  95-dm-notify.rules

Nothing from etc/udev/rules.d is in there. What reaches the device at 18.88 s is the coldplug replay:

$ systemctl cat systemd-udev-trigger.service | grep ExecStart
ExecStart=-udevadm trigger --type=all --action=add --prioritized-subsystem=module,block,tpmrm,net,tty,input

That is --action=add, so a bind-only rule never matches on a boot here. It is not reached from mbp15_apply either: the udevadm trigger there matches vendor=0x14e4 device=0x43ba, the Broadcom radio, not the Radeon at 1002:67ef. POWER_SAVING only ever gets applied because mbp15_apply calls omarchy-hw-apple-mbp15-amdgpu-idle directly — so as things stand the rule file contributes nothing, and nothing re-applies the profile after a reboot.

ACTION=="bind|add" would cover both paths; udevadm verify accepts it, and the helper already exits early on other hardware. For what it's worth, apple-mbp15-wifi-pm.rules in the same PR already matches ACTION=="add".

I can't answer the other half — whether pp_power_profile_mode still shows POWER_SAVING after a reboot — without installing the branch, and I'd rather not: the same install writes AllowSuspend=no on this model, and lid-close suspend works here.

One baseline that may be useful anyway. Stock, with none of this applied, the card does not sit at BOOTUP_DEFAULT:

$ cat /sys/class/drm/card1/device/pp_power_profile_mode
NUM        MODE_NAME     SCLK_UP_HYST   SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL ...
  0   BOOTUP_DEFAULT:        -                -                -
  1 3D_FULL_SCREEN *:        0              100               30
  2     POWER_SAVING:       10                0               30
  [VIDEO, VR, COMPUTE, CUSTOM omitted]

With the kms hook, amdgpu binds in the initramfs, before /etc/udev/rules.d is on the root filesystem, and systemd-udev-trigger replays add, not bind. A bind-only rule therefore never fires after a reboot, and POWER_SAVING was applied only when the installer or migration called the helper directly. Matching add as well covers the boot path; the helper still no-ops on other hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 37f6c2adc5d1a24d0364e45844558e3b2337e261 against quattro, after @makoni's boot trace on a MacBookPro14,3 confirmed the ACTION=="bind" finding from the last review. I pushed the fix.

Pushed

  • 37f6c2ad: default/udev/apple-mbp15-amdgpu-idle.rules now matches ACTION=="add|bind". With the kms hook, amdgpu binds in the initramfs before /etc/udev/rules.d is on disk, and systemd-udev-trigger replays coldplug as add, so the bind-only rule never fired after a reboot and POWER_SAVING was applied only when the installer or migration ran the helper directly. DRIVER=="amdgpu" still gates it, and the helper still exits on other hardware. mbp15-dgpu-test.sh now checks the installed rule matches add.

Checked. On a disposable Omarchy ISO worker, ./test/cli passed, and so did mbp15-dgpu-test.sh, lid-close-test.sh, monitor-clamshell-scale-test.sh, monitor-recovery-test.sh and config-test.sh. With the rule reverted to bind, the new assertion fails. udevadm verify accepts both rule files. On the same worker, udevadm test --action=add against an already-bound PCI device ran a bind-only rule's RUN zero times and an add|bind rule's once, which is the boot path @makoni traced. No 13,3 or 14,3 was available, so whether pp_power_profile_mode shows POWER_SAVING after a real reboot is still unconfirmed on hardware.

Second opinion. Codex Medium reviewed this commit and found nothing to change. It agreed the defect is real and add|bind is proportionate, though its independence is not guaranteed. It noted the helper's up-to-five-second wait inside a udev RUN is tolerable but not ideal; in practice it exits on the first pass, once the attribute is writable.

Still open from the last review: the panel is disabled before the session is locked (bin/omarchy-system-lid-close:25), the migration's AC-profile seeding runs again under sudo with root's HOME (migrations/1786920500.sh), lid-open never removes the saved brightness (bin/omarchy-hw-apple-mbp15-lid), and the NVMe change belongs with #10877 and #11624.

Waiting on the author for those, and on the maintainer for whether these models should refuse suspend at all, given @makoni's s2idle measurements.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 1/5

[High risk] Adds hardware power management and suspend policy for specific MacBook models.

The PR is not ready to merge because migration can override live power preferences and clamshell reconciliation can restart internal-panel scanout with the lid shut.

Findings

  1. P1 AC seed changes battery profile ▶
  2. P1 Root rerun overrides chosen profile ▶
  3. P1 Inactive external re-enables closed panel ▶
  4. P1 Custom state path prevents recovery ▶
  5. P2 NVMe unit retains setup-time device ▶

Summary

The PR adds a Radeon MacBook Pro hardware policy that replaces lid suspend with locking and internal-output disable, applies GPU and Wi-Fi power settings, and updates installation, migration, menu, and recovery paths.

  • The closed-lid display path can re-enable the panel when an attached external output is inactive.
  • Migration profile seeding can replace the live profile on battery or overwrite an existing choice during sudo re-entry.
  • Recovery does not follow a custom XDG state path; the NVMe boot unit retains a setup-time controller selection.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Lid closes] --> B{External physically connected?}
  B -->|No| C[Lock and run clamshell]
  C --> D[Save brightness and wake flags]
  D --> E[Persist and apply internal-output disable]
  B -->|Yes| F[Clamshell reconciliation]
  F --> G{External active in Hyprland?}
  G -->|Yes| H[Keep internal output disabled]
  G -->|No| I[Enable internal output]
  E --> J[Lid opens]
  J --> K[Remove toggle and restore panel and settings]
Loading

Reviews (1) · Last reviewed commit: "Match boot coldplug's add in the 15-inch..."

Comment thread migrations/1786920500.sh
# not cook the chassis. Do not overwrite a profile the user already chose.
ac_state="${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/powerprofiles/ac"
if [[ ! -f $ac_state ]]; then
omarchy-powerprofiles-set ac balanced >/dev/null 2>&1 || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 AC seed changes battery profile

If this migration runs while the machine is on battery, omarchy-powerprofiles-set ac balanced also applies balanced as the live system profile. That replaces the user's battery profile until a power-source change or the next login, even though this step is only meant to set an AC default.

Knowledge Base Used:

Comment thread migrations/1786920500.sh
Comment on lines +18 to +20
if (( $(id -u) != 0 )) && [[ $(mbp15_logind_dest) == /etc/* ]]; then
exec sudo --preserve-env=OMARCHY_PATH,OMARCHY_DMI_PRODUCT_NAME,OMARCHY_MBP15_LOGIND,OMARCHY_MBP15_SLEEP,OMARCHY_MBP15_UDEV_SRC,OMARCHY_MBP15_UDEV_DEST,OMARCHY_MBP15_SKIP_SYSTEMCTL \
/bin/bash -euo pipefail "$OMARCHY_PATH/migrations/1786920500.sh"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Root rerun overrides chosen profile

The sudo branch reruns the migration without preserving the user's HOME or XDG_STATE_HOME. Root therefore sees no saved AC preference and runs the earlier balanced-profile command again, even if the user chose another profile. This changes the live profile to balanced, and the update does not restore the user's choice until a power-source change or login.

Knowledge Base Used:

Comment on lines +220 to 226
elif omarchy-hw-apple-mbp15-dgpu && omarchy-hw-laptop-closed && ! omarchy-hw-external-monitors; then
# 15" Radeon, lid shut, no external: it stays on with the panel disabled, and
# forcing it back on would undo that on monitorremoved. Every other laptop is
# about to suspend and needs the panel back for the lock surface.
:
else
enable_internal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Inactive external re-enables closed panel

If an external display is physically connected but disabled in Hyprland, it counts as connected but not active. With the lid shut, neither branch matches, so enable_internal turns the laptop panel back on. The Radeon resumes scanning out while the lid is closed, defeating the new output-disable behavior.

Knowledge Base Used: Hyprland configuration and display control

# omarchy:summary=Clear the internal-monitor-disable toggle if no external display is connected.

TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua"
LID_CLOSED_TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-lid-closed.lua"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Custom state path prevents recovery

If XDG_STATE_HOME is customized, the lid helper writes this toggle there, and Hyprland loads it from there, but this recovery command and its service condition check only $HOME/.local/state. After a closed-lid power-off leaves the toggle behind, recovery never clears it and the internal display stays disabled.

Knowledge Base Used:

Comment on lines +11 to +12
if [[ -e /sys/class/nvme/nvme0/device/d3cold_allowed ]]; then
NVME_DEVICE=$(readlink -f /sys/class/nvme/nvme0/device)/d3cold_allowed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 NVMe unit retains setup-time device

If another NVMe controller enumerates as nvme0 during hardware setup, this selects that controller without checking whether it is the internal disk. The service then stores its PCI path permanently, so later boots disable D3cold on the wrong device while the internal disk remains exposed to the suspend problem. Selecting the intended disk when the service runs would avoid that stale setup-time choice.

Knowledge Base Used: Hardware, devices, and power

@omarchybot

Copy link
Copy Markdown
Collaborator

Checked Greptile's five findings against the source at 37f6c2adc5d1a24d0364e45844558e3b2337e261, the same head reviewed and tested earlier today. Nothing new was pushed and nothing was run again. Codex Medium checked the same five on its own and reached the same verdicts, though its independence is not guaranteed.

  • AC seed on battery and root rerun (migrations/1786920500.sh:12 and :19-20) are the migration finding already open. omarchy-powerprofiles-set ac balanced applies the profile live whatever the power source, and the sudo pass repeats it against root's HOME. Only the machine-wide part needs root, and the profile seeding should run once, as the user.
  • Inactive external re-enables the closed panel (bin/omarchy-hyprland-monitor-clamshell:226) does not come from this PR. With the lid shut and an external connected but disabled, quattro already falls through to enable_internal. The new elif and the lid-close hook both require no external connected, so neither touches that case. Nothing to change here.
  • Custom state path (bin/omarchy-hw-recover-internal-monitor:6) holds for the new toggle. omarchy-hw-apple-mbp15-lid writes it under XDG_STATE_HOME, which Hyprland also reads, but the recovery script and its unit's ConditionPathExists look only in ~/.local/state. With a custom XDG_STATE_HOME, a power-off with the lid shut leaves the panel disabled at the next login. This is low priority: the clamshell script on quattro already hardcodes the same directory, and a systemd condition cannot follow the variable.
  • NVMe unit keeps a setup-time path (install/hardware/apple/fix-suspend-nvme.sh:12): baking in a PCI path at setup time is not new, because quattro hardcodes 0000:01:00.0. The open finding stands that the NVMe change belongs with the other PRs on that file, which now include [Intel Mac P09] Consolidate NVMe suspend applicability #12687 as well as Target the actual NVMe controller in Apple suspend fix #10877 and Scope the MacBook NVMe suspend fix to Apple's NVMe controller #11624. Stabilize MacBookPro13,3 hardware support #10141 also touches fix-suspend-nvme.sh and the 13,3 Radeon.

Still open from earlier reviews: the panel is disabled before the session is locked (bin/omarchy-system-lid-close:25), the migration's profile seeding (above), and lid-open never removes the saved brightness (bin/omarchy-hw-apple-mbp15-lid:159).

Waiting on the author for those, and on the maintainer for whether these models should refuse suspend at all, given @makoni's s2idle measurements.

@angellindo

Copy link
Copy Markdown

Sharing bare-metal before/after measurements on a MacBookPro14,3 (15" 2017, Radeon Pro 560 1002:67ef, Intel HD 630 8086:591b, firmware 529.140.2.0.0) regarding the two core problems this PR addresses: Radeon idle heat/power draw and S3 suspend failure.

Important scope note: These results come from a local 7.2.15 custom kernel carrying apple-gmux + amdgpu runtime PM patches with the Intel iGPU driving the internal panel (gpu-power-prefs NVRAM), not stock linux-omarchy with Radeon driving the panel. It does not change the stock Radeon-primary failure this PR works around, but it shows that full D3cold power-off, automatic external monitor hotplug, and native S3 deep are achievable in the kernel layer on 14,3 (see also omacom/omarchy-pkgs#4471, which is bringing AMDGPU_RUNPM_GMUX to linux-omarchy 7.3.6 for T2 Macs).

Metric / Test (MacBookPro14,3) Before (stock 7.2.15, Radeon D0) After (DynOff runtime PM + GPE hotplug, hybrid Hyprland)
Idle battery power 21.70 W 12.80 W min / 13.07 W median / 13.29 W mean (120 s, 0/24 wakes)
PCI states at idle 01:00.0=D0, PEG0=D0 01:00.0=D3cold, PEG0 00:01.0=D3hot, 01:00.1=D3cold
Idle residence & thermals Always awake / hot chassis 99.6% suspended over 2 h 53 min (0 spurious wakes in >94 min); SMC TG0D=35.0 °C, palmrest 25.0–27.5 °C, fans 2162 / 1991 RPM (minimum)
External DP monitor hotplug Works (dGPU always on) 3/3 PASS (DP-3 left ×2, DP-5 right ×1): wakes Radeon automatically (~1 s to 3440x1440@50Hz), returns to D3cold/D3hot on unplug
Sustained GPU workload Works PASS: 60.4 s 1080p60 VA-API encode (37–40 °C) + EGL draw, returns to D3cold/D3hot in 6.4 s
Native S3 deep (systemctl suspend) Hard failure (SMU load firmware failed -22) 2/2 PASS (from both DynOff and DynPwr, 20 s RTC wake): amdgpu stays bound, Hyprland intact, post-S3 EGL pass

Limits: Single 14,3 unit, local 7.2.15 kernel (not yet ported to 7.3.6), iGPU-primary boot only, S4 hibernation untested (gated off), local DKMS (apple-ib-drv, snd_hda_macbookpro, acpica-hwpci-bus) active.

Leaving this on the record so maintainers have both kernel-level power/hotplug and S3 data alongside the decision on blocking suspend/hibernate in userspace for MacBookPro13,3/14,3.

@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Hold — maintainer decision on disabling suspend and hibernate on both MacBook models.

The new 14,3 measurements show two successful S3 resumes with a patched kernel and Intel driving the display. Stock Radeon-primary S3 still fails in the reports, and the lid workaround at this head still needs a hardware test. The s2idle alternative in #14692 keeps sleep available on the 14,3 once its kernel dependencies land. If we keep the workaround, the lid-open path needs to preserve the wake handling from #21163, and #11624 is the better home for the NVMe fix because it also removes the stale unit on existing installs.

Codex High and Opus 5.5 High checked the code and hardware reports. Opus flagged that the GPU helper enables all memory-clock levels on the 13,3, where #10141 reports instability during power-state transitions. No new worker or bare-metal tests ran.

@makoni

makoni commented Dec 3, 2026

Copy link
Copy Markdown

I measured the idle part of this on a MacBookPro14,3 (Radeon Pro 560, 1002:67ef). The panel is driven by the Radeon, as it is by default on this model. I ran bin/omarchy-hw-apple-mbp15-amdgpu-idle from 37f6c2a unchanged.

Setup. Omarchy 4.5.0-3, linux-omarchy 7.2.15-4, Hyprland 0.56.2. The laptop was on AC, with the panel at full brightness, the lid open and the display on. I used an empty workspace with nothing animating, and idle locking was held off. Nothing had written to the amdgpu sysfs files since boot.

I ran four phases one after another in the same boot. Each phase got 20 s to settle, then I took one sample per second for 180 s. Power is power1_input from the amdgpu hwmon.

The card started the stock phase warm, at 73 °C from earlier use, and was down to 50–51 °C about 90 s in. The other phases stayed at 49–52 °C. At the lowest clocks it read about 8.0 W above 70 °C, against 7.04 W at 50 °C, so the warm start inflates the stock average. Over the last 90 s of the stock phase (50–51 °C) it averaged 7.35 W.

Phase Radeon power, avg (min–max) MCLK at 1270 MHz SCLK at the lowest rung (214 MHz) SCLK at the top rung (907 MHz)
Stock (auto, 3D_FULL_SCREEN, boot-time MCLK hysteresis 5/16/20) 7.54 W (7.04–11.94) 1/180 135/180 0/180
This PR's helper (manual + POWER_SAVING + all rungs) 7.07 W (7.04–8.57) 1/180 171/180 0/180
low 7.06 W (7.04–7.61) 0/180 180/180 0/180
auto again (now with the kernel's MCLK 0/100/10) 7.36 W (7.04–10.88) 4/180 135/180 0/180

What this shows on my machine:

  • Stock with the lid open. With a static screen, stock auto on 3D_FULL_SCREEN did not hold the top SCLK rung. SCLK was at the lowest rung three-quarters of the time and never at the top. The rest were short steps to 320–838 MHz at 0% busy. The card averaged about 7.5 W, or 7.35 W once it had cooled to 50 °C. That is well under the ~13 W in the description, but that figure was with the lid closed, which I didn't test.
  • The helper. It brought that down to about 7.1 W, the same as forcing low. Against the stock phase at the same temperature, that's about 0.3 W (7.35 → 7.07 W). The full-phase averages give 0.47 W, but part of that is the warm start. This is from one 3-minute run per state.
  • The floor. The lowest reading was 7.04 W in every phase (at 49–52 °C), and the lowest clocks never went below it. I take that as roughly what the Radeon costs here while it stays powered and drives the panel.
  • PCIe link. After the helper, pp_dpm_pcie showed level 0 (2.5 GT/s x8) as current, where stock showed level 1 (8.0 GT/s x16). It stayed at level 0 through the low and second auto phases. After the run, current_link_speed/current_link_width read 2.5 GT/s x8 on both the GPU and its root port; max_link_width is 8, so the x16 is only the driver's table. I didn't read the link during the stock phase. At the lowest clocks and 50 °C, power was the same with pp_dpm_pcie at level 1 or level 0 (7.06 vs 7.05 W), so the saving comes from SCLK, not the link.

I have seen 11–12 W on this machine before. Those were earlier, uncontrolled runs while I was using it, with MCLK at 1270 MHz in roughly 40–100% of samples. One of them came right after a fresh boot with nothing changed. My guess is that ~13 W comes from MCLK climbing while something on the panel redraws, with a hot card adding to it (see the warm start above). I haven't isolated the cause, though. In this run I couldn't reproduce it at stock settings with a static screen.

Not tested: the lid-closed state, the 13,3, battery power, and repeat runs. The phase order wasn't varied either; stock always ran first.

@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Hold — the maintainer still needs to decide the scope of the lid workaround and whether to enable the Radeon helper by default.

Thanks, makoni. With the lid open on AC, the manually run helper brought Radeon draw from 7.35 W to 7.07 W at comparable temperatures. Stock never reached the top core clock in that run, which narrows the claim in the helper. Before enabling it by default, we’d need fresh-boot comparisons with the lid closed and the panel in the same state, measuring whole-system draw with and without the helper, plus a check that the udev rule applies at boot. The run adds no suspend evidence, and the branch still conflicts with quattro.

Codex High and Opus 5.5 High and muse-wonder via pi, thinking high checked the measurements and source. Opus flagged that the second stock-mode phase carried over different GPU settings. No new worker tests ran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants