fix(gpu): read AMD graphics and memory clocks from hwmon #60844
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 278 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.337
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #60844"
general
weight: 0.35
gjulianm
What does this PR do?
amd_gpucheck now readsgpu.clock.speed.graphics/gpu.clock.speed.memoryfrom the hwmonfreqN_inputlabeledsclk/mclk(Hz to MHz), and uses thelevel ofpp_dpm_sclk/pp_dpm_mclkonly when hwmon has no such clock.gfx_0/mem_0from gpu_metrics;pp_dpm_only marks the level near it (smu_v13_0_6_get_current_clk_freq_by_tablefeeds all three). On RDNA1/RDNA2 and APUs, hwmon sclk is the SMU's averaged clock.pp_dpm_*is still read first: during a RAS interrupt it readsunavailable(or fails) while hwmon returns a value the driver did not set, so no clock is reported then, as before.Motivation
An AMD customer trial reported that only the memory clock came through. Since Linux 7.0 (85b0b7d7a3db, 7380228401c4), AMD Instinct GPUs print these tables with
smu_cmn_print_dpm_clk_levels, which marks a level only within 25 MHz of the current clock:Reading hwmon first fixes both and reports the clock itself rather than the nearest level.
Describe how you validated your changes