Skip to content

fix(rdc): report N/A for values amd-smi cannot read - #14047

Draft
adam360x wants to merge 1 commit into
developfrom
users/adam360x/rdc-sentinels
Draft

adam360x wants to merge 1 commit into
developfrom
users/adam360x/rdc-sentinels

Conversation

@adam360x

@adam360x adam360x commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #14041 as a draft: it shows only its own commit. When #14041 merges, this PR moves to develop, where RDC CI runs, and becomes ready for review.

Motivation

amd-smi reports a value it cannot read as the maximum of the field's type, and RDC passed most of those on as readings. On a host with an RX 6800 XT and an RX 7900, GPU_GFX_BUSY_INST showed 4294967295, GPU_VCN_BUSY_INST and GPU_JPEG_BUSY_INST 65535, and the ECC totals 0 while every per-block ECC field was N/A. When no clock level is current, amdsmi_get_clk_freq() reports current = UINT32_MAX, and RDC indexed the frequency table with it; with the fake amd-smi, rdcd crashed.

Technical Details

Issue Tracking

ISSUE ID : #14107

Part of a series of RDC fixes, which #14107 lists. No JIRA ticket.

Test Plan

test_fake_gpu_not_available.py: every case passes after this change, and all but two fail before it (rdcd crashes in the clock case). The power case passes before too, as develop reports that power as N/A since #13637, and so does the memory health check's, which checks behavior this change keeps.

Test Result

Fake-GPU suite: 116 passed, 24 skipped. tests/ci: 92 passed, 6 skipped.

Submission Checklist

amd-smi reports a value it cannot read as the maximum of the field's
type, and RDC passed most of those on as readings. On a host with an
RX 6800 XT and an RX 7900, GPU_GFX_BUSY_INST showed 4294967295,
GPU_VCN_BUSY_INST and GPU_JPEG_BUSY_INST 65535, and the ECC totals 0
while every per-block ECC field was N/A. With the fake amd-smi,
SOC_CLOCK, VCLK0 and DCLK0 showed 4294967295000000, GPU_UTIL and
GPU_MEMORY_ACTIVITY 65535, the RDC_HEALTH_* throttle and residency
counters -1, and GPU_MEMORY_CUR_BANDWIDTH 0 without a memory activity
reading. GPU_PARTITION_COUNT (65535 on that host) and POWER_USAGE
(4294967295000000 with the fake) are fixed on develop by #13638 and
#13637.

amdsmi_get_clk_freq() reports current = UINT32_MAX when no level is
current, as for a power-gated clock domain on some APUs (documented in
amdsmi.h since #6043). RDC indexed frequency[] with it for GPU_CLOCK
and MEM_CLOCK; with the fake, rdcd crashes with SIGSEGV. RDC now
checks the index against num_supported and the array size.

RDC reports these values as not supported (N/A). It checks each
against the marker amd-smi documents for it: UINT32_MAX for current
clocks, also accepting the 0xFFFF that older amd-smi passed on; 0xFFFF
for activities; and the field type's maximum for gpu_metrics and
violation counters. The ECC totals are N/A when no
block reported a count. The memory health check still goes on to such
a GPU's retired pages, as it did when the total was 0; the power and
thermal health checks report no incident for a missing counter, as
before. With RDC_BULK_FETCH_ENABLED=true, a gpu_metrics value that is
not available is left to the per-field fetch, which costs one more
amd-smi call per such field and update.

The fake amd-smi reports these cases as amd-smi does: RDC_FAKE_SENTINEL
sets current = UINT32_MAX in amdsmi_get_clk_freq(), only clk in
amdsmi_get_clock_info(), 0xFFFF activities in amdsmi_get_gpu_activity(),
and covers amdsmi_get_violation_status(). It no longer applies to
amdsmi_get_gpu_busy_percent(), which reads the kernel's value and has
no marker. Each case in test_fake_gpu_not_available.py passes after
this change, and all but two fail before it (rdcd crashes in the
clock case): the power case passes before too, as develop reports
that power as N/A since #13637, and so does the memory health
check's, which checks behavior this change keeps.

The same unchecked index in RdcConfigSettingsImpl
(frequency[num_supported - 1]) is left for a separate change.

Signed-off-by: Adam360x <Adam.pryor@amd.com>
@therock-pr-bot

therock-pr-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

This branch has not been deployed

No deployments
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.

1 participant