Skip to content

gpuagent: refresh GFX max clock on the get path for RDNA only (GPUOP-… - #91

Merged
sarat-k merged 1 commit into
ROCm:mainfrom
bhatturu:user/bhatturu/GPUOP-985-gfx-maxclock-refresh
Aug 27, 2026
Merged

gpuagent: refresh GFX max clock on the get path for RDNA only (GPUOP-…#91
sarat-k merged 1 commit into
ROCm:mainfrom
bhatturu:user/bhatturu/GPUOP-985-gfx-maxclock-refresh

Conversation

@bhatturu

Copy link
Copy Markdown
Contributor

…985)

GFX high_frequency (max clock) was filled once in smi_gpu_init_immutable_attrs and only copied thereafter. On RDNA the boost ceiling is mutable and rises under load, so the init snapshot goes stale versus the live amd-smi value, failing the GPU_MAX_CLOCK accuracy check. CDNA has a fixed DPM range so it never drifts.

Record the RDNA GPUs at init (target_graphics_version top nibble == 1) and, only for those, re-read amdsmi_get_clock_info(GFX) in smi_fill_clock_status_ at most once per 5s per GPU, caching hi/lo and re-applying it onto the per-get spec copy. CDNA GPUs skip the refresh entirely, keeping the MI get path unchanged. The amdsmi call runs outside g_gfx_maxclk_mutex so one GPU's refresh never blocks the others' clock-status fills.

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

…985)

GFX high_frequency (max clock) was filled once in smi_gpu_init_immutable_attrs
and only copied thereafter. On RDNA the boost ceiling is mutable and rises under
load, so the init snapshot goes stale versus the live amd-smi value, failing the
GPU_MAX_CLOCK accuracy check. CDNA has a fixed DPM range so it never drifts.

Record the RDNA GPUs at init (target_graphics_version top nibble == 1) and, only
for those, re-read amdsmi_get_clock_info(GFX) in smi_fill_clock_status_ at most
once per 5s per GPU, caching hi/lo and re-applying it onto the per-get spec copy.
CDNA GPUs skip the refresh entirely, keeping the MI get path unchanged. The
amdsmi call runs outside g_gfx_maxclk_mutex so one GPU's refresh never blocks
the others' clock-status fills.

@rsrikanth86 rsrikanth86 left a comment

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.

lgtm

@sarat-k
sarat-k merged commit 5b2bf2c into ROCm:main Aug 27, 2026
1 check passed
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.

3 participants