Skip to content

feat(rdc): add RDC_FI_AFID field + unit tests#8527

Open
dmitrii-galantsev wants to merge 2 commits into
users/dgalants/rdc-cpx-and-profiler-sample-timefrom
users/dgalants/rdc-afid-field
Open

feat(rdc): add RDC_FI_AFID field + unit tests#8527
dmitrii-galantsev wants to merge 2 commits into
users/dgalants/rdc-cpx-and-profiler-sample-timefrom
users/dgalants/rdc-afid-field

Conversation

@dmitrii-galantsev

Copy link
Copy Markdown
Contributor

Summary

Rebases #7728 (RDC_FI_AFID field decoding AFID + severity from the driver CPER ring) on top of the CPX/flat-GPU-table branch, and adds unit tests for it.

This is a stacked PR: it targets users/dgalants/rdc-cpx-and-profiler-sample-time so the diff shown is only the AFID delta. The AFID feature commit is unchanged from #7728 (authored by @brichang) apart from a Conventional-Commits subject rewrite.

Relates to #7728.

Commits

Tests

New test_afid_field.cc (6 cases) folded into the GPU-less rdc_codec_tests binary (links only librdc_bootstrap, where the field descriptor table lives). It guards the field wiring, which fails silently if a field is added to rdc.h but missed in one of the rdc_field.data expansions:

  • enum id pinned at 680 (ABI)
  • is_field_valid accepts AFID, rejects RDC_FI_INVALID
  • descriptor metadata: enum name, label AFID, non-empty description, do_display
  • name -> id resolution via both the C++ and C get_field_id_from_name, plus a negative case
  • field_id_string returns the label
  • id sits in the reserved RAS gap (RDC_FI_ECC_LAST < 680 < 700)

The live CPER decode in get_afid() needs a GPU with RAS records, so it is covered by hardware validation rather than unit tests.

Test plan

  • Local (2x gfx1030): rdc_codec_tests 11/11, rdc_unit_tests 7/7, ctest 2/2 from the build root.
  • MI350X (gfx950, 8x): built against a from-source amd_smi (ESMI on); rdc_codec_tests 11/11, rdc_unit_tests 7/7. Exercised the exact get_afid() flow across all 8 GPUs and cross-checked amd-smi ras --cper: with root the CPER ring is empty on healthy hardware so the field correctly returns N/A; without root the API returns AMDSMI_STATUS_NO_PERM and get_afid propagates the error (RDC runs as root in production). No RAS errors were injected.

Signed-off-by: Galantsev, Dmitrii dmitrii.galantsev@amd.com

brichang and others added 2 commits July 13, 2026 22:42
Add a new RDC field RDC_FI_AFID that reads CPER records directly from the
driver via amdsmi_get_gpu_cper_entries() and decodes the AMD Field ID(s)
with amdsmi_get_afids_from_cper(). The field is reported as a STRING of
comma-separated <afid>:<severity> pairs (severity one of FATAL / CORRECTED /
UNCORRECTED), or N/A when the ring is empty.

This lets users read AFIDs as a normal RDC field (rdci dmon -e AFID) without
first configuring a CPER dump folder via amd-smi, and intentionally omits the
service-action-guide text so only the AFID number and severity are surfaced.

Signed-off-by: Brian Chang <brichang@amd.com>
Cover the RDC_FI_AFID field wiring in the pure-logic rdc_codec_tests
binary: stable enum id (680), descriptor metadata (label AFID, displayed),
name/label to id resolution, field_id_string, and placement in the
reserved RAS/CPER id gap. These guard the registration the CLI and
telemetry layer depend on; the live CPER decode is covered separately by
hardware integration testing.
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.

2 participants