Repository navigation
test(rdc): make the fake amd-smi match amd-smi on three calls - #14980
Merged
joshnguy-amd merged 1 commit intoNov 4, 2026
Merged
joshnguy-amd merged 1 commit into
joshnguy-amd merged 1 commit into
Conversation
Address the review comments on #14041: - amdsmi_get_gpu_compute_process_gpus returns AMDSMI_STATUS_INVAL for a NULL list, as amd-smi does, instead of reporting a count. RDC's own NULL-count call then fails here as it does on real hardware. - amdsmi_init accepts AMDSMI_INIT_AMD_CPUS and finds no CPUs, as amd-smi does without the HSMP driver, so rdcd takes its production init path rather than the disable-CPUs retry. - The GPU-less daemon, harness and embedded launches set RDC_DISABLE_ROCP, so the profiler module is not loaded into the hermetic tests. Co-Authored-By: Claude <noreply@anthropic.com>
joshnguy-amd
merged commit Nov 4, 2026
daf94a9
into
users/adam360x/rdc-fake-gpu-tests
100 of 105 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address the review comments on #14041:
amdsmi_get_gpu_compute_process_gpusreturnsAMDSMI_STATUS_INVALfor a NULL list, as amd-smi does, instead of reporting a count. RDC's own NULL-count call then fails here as it does on real hardware.amdsmi_initacceptsAMDSMI_INIT_AMD_CPUSand finds no CPUs, as amd-smi does without the HSMP driver, so rdcd takes its production init path rather than the disable-CPUs retry.RDC_DISABLE_ROCP, so the profiler module is not loaded into the hermetic tests.Motivation
#14041 runs rdcd and rdci in CI against a fake amd-smi. Review found three places where the fake behaves differently from real amd-smi. Each difference hides RDC behavior that this suite is meant to exercise: a NULL-count call that fails on hardware, the CPU-init fallback path taken by every rdcd start, and the profiler module loading into a hermetic test. This PR makes the fake match amd-smi on those calls so the suite tests what runs in production.
Technical Details
Verified each point against the real sources before changing the fake:
amd_smi.cc(amdsmi_get_gpu_compute_process_gpus) returnsAMDSMI_STATUS_INVALwhendv_indicesornum_devicesis NULL. There is no count-only query. The fake now matches. This also meansRdcSmiDiagnosticImpl.ccalways takes its failure branch on real hardware, which is a separate RDC bug to file.amd_smi_system.cc(populate_amd_cpus) returnsAMDSMI_STATUS_SUCCESSwhenesmi_init()fails, so a CPU init never fails without the HSMP driver. The fake acceptsAMDSMI_INIT_AMD_CPUSand reports no CPUs. rdcd's "disable CPUs and retry" fallback inRdcEmbeddedHandler.ccis no longer taken.RDC_DISABLE_ROCP=yesis set in therdcd_serverfixture inconftest.py, in the daemon harness environment intest_fake_gpu.py, and in the embedded test, astest_gtest_runner.pyalready does.test_fake_gpu_fake.pyand the README now expectINVALfor a NULL list.This PR targets
users/adam360x/rdc-fake-gpu-testsand does not mergedevelop. #14041 conflicts withdevelopinrdc-ci.yml(therdc_testrunner label and timeout), which the #14041 author needs to resolve.Issue Tracking
GitHub issue: #14041
JIRA ID:
Test Plan
fake_amdsmi.ccand runtests/ci/test_fake_gpu_fake.py, which drives the fake through ctypes.test_fake_gpu.pyandtests/ciin CI (rdc_test) to check that the stricter amd-smi behavior doesn't expose new rdcd/rdci failures.Test Result
test_fake_gpu_fake.py: 24 passed locally against the compiled fake.test_fake_gpu.pyandtests/ci: not run locally, because they need a built RDC. They run in CI on this PR.Submission Checklist