Skip to content

test(rdc): add handle generations and fault knobs to the fake amd-smi - #14042

Merged
adam360x merged 1 commit into
users/adam360x/rdc-fake-gpu-testsfrom
users/adam360x/rdc-fake-amdsmi-ext
Oct 23, 2026
Merged

adam360x merged 1 commit into
users/adam360x/rdc-fake-gpu-testsfrom
users/adam360x/rdc-fake-amdsmi-ext

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

The remaining RDC fixes in this series need the fake amd-smi to reproduce their bugs in CI.

Technical Details

  • Handles are generation-encoded numbers. A handle kept across the amdsmi_shut_down() that drops the last init reference is unknown, as with amd-smi: AMDSMI_STATUS_NOT_FOUND for a processor, AMDSMI_STATUS_INVAL for a socket.
  • RDC_FAKE_FAIL_ONCE, RDC_FAKE_UNFILLED and RDC_FAKE_DELAY_MS fail a call once, return success without writing outputs, or slow a call down.
  • RDC_FAKE_PROCS, RDC_FAKE_PROCS_GROW and RDC_FAKE_COUNTER_RESET model compute processes, processes that start between two calls, and counters that restart after a GPU reset.
  • RDC_FAKE_CPER_COUNT, RDC_FAKE_EVENTS, RDC_FAKE_NUM_FREQ and RDC_FAKE_VERSION_BUILD_NULL break amd-smi's output contract on purpose, so tests can check that RDC does not trust its library blindly.
  • A malformed knob value aborts instead of silently disabling the fault.

Test-only; no CHANGELOG entry.

Issue Tracking

ISSUE ID : #14107

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

Test Plan

tests/ci/test_fake_gpu_fake.py checks each new knob and the handle rules against the fake directly. Ran the fake-GPU suite and tests/ci in a GPU-less container, as CI does.

Test Result

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

Submission Checklist

Give the fake amd-smi the behaviors the remaining RDC fixes need to
reproduce their bugs in CI:

- Handles are generation-encoded numbers. The amdsmi_shut_down() that
  drops the last init reference ends the generation, so a handle kept
  across that shutdown is unknown, as to amd-smi:
  AMDSMI_STATUS_NOT_FOUND for a processor, AMDSMI_STATUS_INVAL for a
  socket.
- RDC_FAKE_FAIL_ONCE, RDC_FAKE_UNFILLED and RDC_FAKE_DELAY_MS fail a call
  once, return success without writing outputs, or slow a call down;
  amdsmi_init honors the ones that apply to it.
- RDC_FAKE_PROCS, RDC_FAKE_PROCS_GROW and RDC_FAKE_COUNTER_RESET model
  compute processes, processes that start between two calls, and
  counters that restart after a GPU reset. Process lists follow
  amd-smi's rules for short lists and count-only queries.
- RDC_FAKE_CPER_COUNT, RDC_FAKE_EVENTS, RDC_FAKE_NUM_FREQ and
  RDC_FAKE_VERSION_BUILD_NULL can also break amd-smi's output contract
  on purpose (counts past what was written, an empty frequency table,
  a NULL build string), so tests can check that RDC does not trust its
  library blindly.

A malformed value of these knobs aborts instead of silently disabling
the fault. tests/ci/test_fake_gpu_fake.py checks each new knob and the
handle rules against the fake directly.

Signed-off-by: Adam360x <Adam.pryor@amd.com>
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