Skip to content

hwmon: macsmc: M4 Pro GPU temperatures read no data while the GPU is off - #1331

Merged
RyanTheTide merged 3 commits into
integration/aurorafrom
gputemp/gpu-temp-no-data
Nov 9, 2026
Merged

RyanTheTide merged 3 commits into
integration/aurorafrom
gputemp/gpu-temp-no-data

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

On the M4 Pro MacBook Pros (T6040: J614s, J616s, J773s) every GPU temperature the SMC publishes (Tg*) reads a placeholder whenever the GPU is idle: -4.0 C on the base keys, 0, 2.2 or 3.9 C on the others. The seven GPU thermal zones read those as temperatures, sensors showed a 3.9 C GPU, and the zones' critical trips (118 C) acted on a single 1 s sample.

Why the values disappear

The SMC samples the GPU's own temperature sensors. With the macOS 26.6.2 (25G83) GPU firmware that Linux runs, the firmware powers those sensors down with the GPU when it goes idle, and the next 1 Hz SMC update replaces every Tg* key with its placeholder. As soon as the GPU powers up again, the readings are real. Measured on a J616s (7.3.0-aurora-fleet44):

  • glmark2 build: Tg05 49.4 to 53.3 C, Tg04 41.5 to 45.4 C, about 8 C above the P-cluster key Tp0G;
  • 2 s bursts: real on the first SMC tick after power-on, placeholder on the first tick after power-off, all keys together, no out-of-range sample in between (17.7k reads);
  • the gfx, afr and pmp-gfx power domains stay on throughout: it is the GPU firmware's own idle power-off, not a Linux power domain.

Nothing on the host can make 25G83 keep its sensors live while the GPU is off. Keeping the GPU powered does make them read (Tg04 34.4 C against Tp0G 34.5 C at idle), but it costs 0.21-0.28 W of SoC power and 0.33-0.39 W of system power at idle (same-boot A/B on a J616s, panel brightness held), and it is not what macOS does: macOS powers the GPU off at idle too.

What this changes

  1. Placeholders are no data, not temperatures. A new sensor-node property, apple,no-data-below-millicelsius, gives the placeholder range; macsmc-hwmon returns -ENODATA for a reading below it. The 22 Tg* sensors of the T604x MacBook Pros get 10 C (real GPU readings are 34-75 C, and a powered GPU does not run below 10 C).
  2. A thermal zone skips a no-data sample instead of breaking. The hwmon thermal bridge turns -ENODATA into THERMAL_TEMP_INVALID, which the thermal core already treats as "no valid temperature this time": the zone keeps polling and keeps its last real temperature. Without this, the core backs off on the error and eventually disables the zone as broken, so it could not trip when the GPU powered up and heated. Reading the zone's temp returns -ENODATA, as hwmon does.
  3. Debounced critical trips. The GPU zones get critical-samples = <3>, the same rule as the CPU and die zones in the same file: a real excursion still shuts down after three seconds; one noisy sample does not.

Throttling is unchanged: the GPU firmware limits itself from 101 C, and the GPU zones shed CPU power from the same point.

Testing

J616s, 7.3.0-aurora-gputemp4 (this branch on integration/aurora f4b6890), one-shot boot with an aura-try trial Stage 2 whose DTB is the committed one plus #1287 plus only this branch's 29 properties (never committed):

  • Device tree as booted: critical-samples = 3 on the GPU zones, apple,no-data-below-millicelsius = 10000 on the Tg* nodes.
  • Idle, 60 s at 1 Hz (4 Tg* channels and 7 GPU zones per sample): hwmon 224 no data / 16 real, zones 392 no data / 28 real (the real ones are short GPU wake-ups from the desktop), 0 placeholder values.
  • glmark2 build, 18 s: hwmon 72 real / 0 no data, zones 126 real / 0 no data; Tg05 43.5-44.7 C against Tp0G 35.3-36.2 C.
  • After the load, 60 s: hwmon 232 no data / 8 real, zones 406 no data / 14 real, 0 placeholder values.
  • All 7 GPU zones stayed enabled the whole time; 0 "Temperature check failed" or disabled-zone messages from the thermal core.
  • Boot: SELinux enforcing, 0 AVCs; kernel warnings identical to the fleet baseline boot apart from the kauditd suppression count.

Host selftests on this branch: run-host-tests 199/199, apple-dcp 87 ok / 0 not ok.

Raw data: our own Linux measurements (sysfs/hwmon reads, no SMC writes).

🤖 Generated with Claude Code

The seven GPU zones (Tg05, Tg0S, Tg0Y, Tg0k, Tg0z, Tg1V, Tg1l) shut the
Mac down on the first 1 s SMC sample at or above 118 C. The CPU and die
zones in the same file already need three samples (critical-samples),
because single SMC samples on these Macs jump by several degrees during
load transients. Give the GPU zones the same rule.

On a J616s the GPU keys read real values only while the GPU is powered
(glmark2: Tg05 49 to 53 C, about 8 C above Tp0G) and fall to -4 to 4 C on
the first sample after the firmware powers the GPU off. The transition
samples measured at 1 Hz stay in range (no spikes), so the debounce
only guards against noise; it does not hide a real excursion, which still
shuts down after three seconds.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
…rs as no data

On the M4 Pro (T6040) the SMC publishes every GPU temperature key (Tg*)
only while the GPU is powered. When the GPU firmware powers the GPU off
at idle, the next 1 Hz SMC update replaces each key with a placeholder:
-4.0 C on the base keys, 0, 2.2 or 3.9 C on the others. Linux reported
those as temperatures: `sensors` showed a 3.9 C GPU, and the seven GPU
thermal zones fed it to the power allocator as a reading.

Describe the placeholder range in the device tree:
apple,no-data-below-millicelsius on a sensor node makes macsmc-hwmon
return -ENODATA for a reading below it, so userspace sees no reading
instead of a false one. The hwmon thermal bridge turns -ENODATA into
THERMAL_TEMP_INVALID, which the thermal core already treats as "no
valid temperature this time": the zone keeps polling and its last real
temperature, and the update is skipped. Without that, the core would
back off on the error and eventually disable the zone as broken, so it
could not trip when the GPU powered up again.

The 22 Tg* sensors of the T604x MacBook Pros get a 10 C threshold. The
real readings measured on a J616s are 36-75 C, and a powered GPU does
not run below 10 C.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
… unit type

A -millicelsius property already has its type from the dtschema unit
suffixes (an int32 array). Describe it as a single value instead of
redefining the type, which made every user fail validation.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant