Skip to content

[ROCM-21057] Fall back to pp_dpm_* sysfs when SMU power-gates clock domains - #6043

Merged
marifamd merged 1 commit into
developfrom
users/kbillaka/ROCM-21057-3
Jun 2, 2026
Merged

marifamd merged 1 commit into
developfrom
users/kbillaka/ROCM-21057-3

Conversation

@koushikbillakanti-amd

@koushikbillakanti-amd koushikbillakanti-amd commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

On gfx1151, amd-smi static -C shows MEM/DF/SOC/DCEF/VCLK/DCLK as N/A at idle because the SMU power-gates those domains, so the kernel's pp_dpm_* table has no * current-level marker and the rsmi parser was discarding the whole table as STATUS_UNEXPECTED_DATA. This PR keeps the supported DPM frequency table visible at idle as well.

Technical Details

Fixed get_frequencies() in the rsmi backend to stop returning UNEXPECTED_DATA when no * marker is present: the parsed num_supported / frequency[] are kept and current is set to (uint32_t)-1 (documented in amdsmi_frequencies_t). VCLK/DCLK still have no rsmi/gpu_metrics path, so the existing inline pp_dpm reader was moved out of public amd_smi.cc into internal amd_smi_utils.{h,cc}. CLI translates the sentinel to N/A and guards the fclk index in metric --clock. Output schema is unchanged.

JIRA ID

ROCM-21057

Test Plan

Built from source on gfx1151 and ran amd-smi static -C and amd-smi metric --clock at idle, during a HIP busy_kernel workload, and post-workload; cross-validated CURRENT_LEVEL against * markers in /sys/class/drm/renderD*/device/pp_dpm_*. Also re-ran amd-smi list / monitor / metric -u to check for regressions.

Test Result

Idle now shows full FREQUENCY_LEVELS for MEM/DF/SOC with CURRENT_LEVEL: N/A while the domain is gated; under load CURRENT_LEVEL appears and exactly matches the sysfs * marker; post-load it drops back. metric --clock no longer crashes on idle fclk. DCEF/VCLK/DCLK remain N/A only when the sysfs file is absent or empty. No regressions in other amd-smi subcommands.

Submission Checklist

@koushikbillakanti-amd
koushikbillakanti-amd force-pushed the users/kbillaka/ROCM-21057-3 branch 2 times, most recently from cec4c99 to f991b92 Compare May 15, 2026 05:39
Comment thread projects/amdsmi/src/amd_smi/amd_smi.cc Resolved

@bill-shuzhou-liu bill-shuzhou-liu 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.

Can you also add the comment for amdsmi_frequencies_t::current in the amdsmi.h to indicate the current may be -1 when in sleep mode as no current is present?

@marifamd marifamd changed the title ROCM-21057: fall back to pp_dpm_* sysfs when SMU power-gates clock domains [ROCM-21057] Fall back to pp_dpm_* sysfs when SMU power-gates clock domains May 26, 2026
Comment thread projects/amdsmi/src/amd_smi/amd_smi.cc Resolved

@gabrpham gabrpham 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.

Looks good to me. Approved.

@koushikbillakanti-amd
koushikbillakanti-amd force-pushed the users/kbillaka/ROCM-21057-3 branch from 19ff3f5 to c07d156 Compare June 2, 2026 16:28
@marifamd
marifamd merged commit ef4ddda into develop Jun 2, 2026
33 checks passed
@marifamd
marifamd deleted the users/kbillaka/ROCM-21057-3 branch June 2, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants