Repository navigation
feat(amdsmi): reland gpu_block_t expansion with rdc build fix - #10973
Merged
Merged
Conversation
RDC pinned itself to the tail of amdsmi_gpu_block_t in two ways, so expanding that enum in AMD SMI broke RDC rather than AMD SMI. The test helper carried a copy of AMD SMI's block name map guarded by static_assert(AMDSMI_GPU_BLOCK_LAST == AMDSMI_GPU_BLOCK_MPIO). Nothing in RDC ever called GetBlockNameStr(), so the map and its guard only served to fail the build when a new IP block was added. Both are removed along with the unused declaration. The ECC total fetchers iterated blocks with a uint32_t counter. Once a block is defined above bit 31 the counter wraps to zero, the loop stops making progress, and get_ecc_total()/get_ecc_deferred_total() never return. The counter is now uint64_t, matching the enum's width. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
Relands the expansion from be17474, which was reverted in 2d4df42 because projects/rdc failed to build against it. The preceding commit removes RDC's coupling to the enum tail, so these blocks land unchanged. Adds 20 RAS IP blocks at bits 19-38 and moves AMDSMI_GPU_BLOCK_LAST to AMDSMI_GPU_BLOCK_UCIE_PCS across the public header, the generated Python wrapper, the Python interface, the Rust bindings, and the AMD SMI test suite. Co-authored-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com> Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
The example walked every amdsmi_gpu_block_t value but indexed a 14-entry name array, so blocks from MCA onward read past the end and printed whatever followed on the stack. The list was already five short of the pre-expansion enum; widening the enum to bit 38 stretched the overread to 25 entries. Fill in all 39 names, switch to const char* so KPX_SERDES is not truncated by the old 10-byte cell, and bound the lookup so a future block addition prints UNKNOWN instead of reading out of bounds. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
bill-shuzhou-liu
approved these changes
Aug 31, 2026
gabrpham
approved these changes
Aug 31, 2026
peterjunpark
approved these changes
Aug 31, 2026
This was referenced Sep 1, 2026
Contributor
TheRock Submodule Bump ActivityNewest first
|
marifamd
added a commit
that referenced
this pull request
Sep 24, 2026
## Motivation `amdsmi-license-headers` is `pass_filenames: false`, so it rescans the whole tree. Once a violation lands on `develop`, every later PR goes red instead of the merge that caused it. #10010 merged on a stale-green formatting run and reddened #10973 and #10998 until #8561 fixed the headers. Third time against this hook (#10402, #10845, #8561), each fixed reactively. ## Technical Details `.github/workflows/lstt-formatting.yml`: - `push` trigger on `develop`, same path filter as `pull_request`, so a whole-tree hook runs on the merge commit. - `--from-ref` is event-aware via `FROM_REF`: `github.event.before` on push, base branch on PR. PR behavior unchanged. - `cancel-in-progress` limited to `pull_request`, so consecutive merges each keep their verdict. Detection at merge, not prevention. Prevention is "Require branches to be up to date before merging". `develop`'s ruleset has `required_status_checks` with `strict_required_status_checks_policy: false`, so a PR can merge on a check that last ran against an older base — which is how the stale-green merge happened. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
anujshuk-amd
pushed a commit
that referenced
this pull request
Sep 25, 2026
## Motivation `amdsmi-license-headers` is `pass_filenames: false`, so it rescans the whole tree. Once a violation lands on `develop`, every later PR goes red instead of the merge that caused it. #10010 merged on a stale-green formatting run and reddened #10973 and #10998 until #8561 fixed the headers. Third time against this hook (#10402, #10845, #8561), each fixed reactively. ## Technical Details `.github/workflows/lstt-formatting.yml`: - `push` trigger on `develop`, same path filter as `pull_request`, so a whole-tree hook runs on the merge commit. - `--from-ref` is event-aware via `FROM_REF`: `github.event.before` on push, base branch on PR. PR behavior unchanged. - `cancel-in-progress` limited to `pull_request`, so consecutive merges each keep their verdict. Detection at merge, not prevention. Prevention is "Require branches to be up to date before merging". `develop`'s ruleset has `required_status_checks` with `strict_required_status_checks_policy: false`, so a PR can merge on a check that last ran against an older base — which is how the stale-green merge happened. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
dgaliffiAMD
pushed a commit
that referenced
this pull request
Sep 25, 2026
## Motivation `amdsmi-license-headers` is `pass_filenames: false`, so it rescans the whole tree. Once a violation lands on `develop`, every later PR goes red instead of the merge that caused it. #10010 merged on a stale-green formatting run and reddened #10973 and #10998 until #8561 fixed the headers. Third time against this hook (#10402, #10845, #8561), each fixed reactively. ## Technical Details `.github/workflows/lstt-formatting.yml`: - `push` trigger on `develop`, same path filter as `pull_request`, so a whole-tree hook runs on the merge commit. - `--from-ref` is event-aware via `FROM_REF`: `github.event.before` on push, base branch on PR. PR behavior unchanged. - `cancel-in-progress` limited to `pull_request`, so consecutive merges each keep their verdict. Detection at merge, not prevention. Prevention is "Require branches to be up to date before merging". `develop`'s ruleset has `required_status_checks` with `strict_required_status_checks_policy: false`, so a PR can merge on a check that last ran against an older base — which is how the stale-green merge happened. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
marifamd
pushed a commit
that referenced
this pull request
Oct 27, 2026
## Motivation A release notes review found that the RDC changelog on develop mixes RDC 1.4.0 entries, which ship in ROCm 10.2.0, with entries that already shipped in ROCm 10.1.0 as RDC 1.3.1. #11722 opened the 1.4.0 section as "for ROCm 10.1.0" after ROCm 10.1 had branched, so later RDC entries landed under the wrong release. ## Technical Details - Retitle `## RDC 1.4.0 for ROCm 10.1.0` to `## RDC 1.4.0 for ROCm 10.2.0`. - Add `## RDC 1.3.1 for ROCm 10.1.0` with the two entries from #10973, which ROCm 10.1.0 contains: - Removed: the unused `GetBlockNameStr()` test helper. - Resolved: the `RDC_FI_ECC_*_TOTAL` hang on GPU blocks above bit 31. - Keep the `RDC_FI_GPU_MEMORY_CUR_BANDWIDTH` fix (#11634) under 1.4.0 as a one-line entry that says the fix is now included. #11634 merged on 2026-09-15, after the ROCm 10.1 branch point (2026-09-08), and ROCm 10.1.0 does not contain it. The published ROCm 10.1.0 release notes already list this fix and can't be changed, so the 1.4.0 entry doesn't repeat the full description. - The two #10973 entries move unchanged. No other files change. Evidence: - TheRock tag `therock-10.1` pins rocm-systems `7da43026e4f`, which is also the rocm-systems `therock-10.1` tag and the head of `release/therock-10.1`. Its RDC version is 1.3.1. - `721f051b86c` (#10973) is an ancestor of `7da43026e4f`. `fc654c7c9db` (#11634) is not. Both are in `release/bkc/therock-10.2-20261013`. - The released ROCm 10.1.0 packages match. `amdrocm-amdsmi10.1` 10.1.0-3 reports version `27.1.0+7da43026`. The `librdc.so` in `amdrocm-rdc10.1` 10.1.0-3 does not contain `derive_mem_activity_percent()`, the function #11634 added. The 10.2 nightly from 2026-10-21 does. ## Issue Tracking No JIRA ticket. Reported in a release notes review. ## Test Plan Changelog-only change. A script moved the #10973 entries byte for byte and checked that the only added or removed non-blank lines are section headings. A second script replaced the #11634 entry by exact match and checked that it stays in the 1.4.0 section. --------- Signed-off-by: Adam360x <Adam.pryor@amd.com>
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.
Motivation
PR #10179 (
feat(amdsmi): expand amdsmi_gpu_block_t with new IP blocks) added 20RAS IP blocks at bits 19-38 and moved
AMDSMI_GPU_BLOCK_LASTfromAMDSMI_GPU_BLOCK_MPIO(1ULL << 18) toAMDSMI_GPU_BLOCK_UCIE_PCS(
1ULL << 38). It updated every AMD SMI consumer of that enum, but missedprojects/rdc, which had hard-coded the old tail.developsat at a ~76%TheRock CI failure rate until #10947 reverted it.
This PR fixes RDC first, relands #10179 unchanged on top, then repairs an
out-of-bounds read in an AMD SMI example that the wider enum makes worse.
Technical Details
Three commits, in dependency order. Each builds on its own.
1.
fix(rdc): remove hard-coded AMD SMI GPU block enum boundsBuild break (
tests/rdc_tests/test_common.cc,test_common.h) — the CI failure:kBlockNameMapwas a copy of AMD SMI's block name table guarded bystatic_assert(AMDSMI_GPU_BLOCK_LAST == AMDSMI_GPU_BLOCK_MPIO). Its onlyconsumer,
GetBlockNameStr(), has zero callers anywhere inprojects/rdc.The map and its guard did nothing except fail the build when AMD SMI added a
block. Removed the map, the assert, the function, and its declaration.
GetErrStateNameStr()/kErrStateNameMapare left untouched.Latent hang (
rdc_libs/rdc/src/RdcMetricFetcherImpl.cc) — not a test, production library code:get_ecc_total()andget_ecc_deferred_total()walked the enum withfor (uint32_t b = AMDSMI_GPU_BLOCK_FIRST; b <= AMDSMI_GPU_BLOCK_LAST; b = b * 2).amdsmi_gpu_block_tis 64 bits wide (AMDSMI_GPU_BLOCK_RESERVED = 1ULL << 63).Once any block sits above bit 31,
b * 2wraps to0,0 <= LASTstays true,and the loop never terminates. Both counters widened to
uint64_t.PR #10179 had already applied this same widening inside AMD SMI, in
tests/amd_smi_test/functional/gpu/ras/err_cnt_read_test.cc. RDC's two copieswere the ones missed.
2.
feat(amdsmi): expand amdsmi_gpu_block_t with new IP blocksRelands
be17474f7verbatim (reverted in2d4df4291), credited to the originalauthor. Header, generated Python wrapper, Python interface, Rust bindings, and
the AMD SMI test suite.
3.
fix(amdsmi): bound the DRM example's RAS block name lookupexample/amd_smi_drm_example.ccwalked everyamdsmi_gpu_block_tvalue butindexed
char block_names[14][10], reading past the end of the array andprinting whatever followed on the stack:
1ULL << 18)1ULL << 38)The bug predates #10179 — the array was already missing
MCA,VCN,JPEG,IH, andMPIO— but commit 2 widens it fivefold, so it is fixed here ratherthan left in tree.
const char*; the old 10-byte cell would have truncatedKPX_SERDES(10 chars + NUL).UNKNOWNinstead ofreading out of bounds.
Full-monorepo sweep
Checked every consumer of
AMDSMI_GPU_BLOCK_LASToutside the header to confirmnothing else breaks the way RDC did:
rdc/.../RdcMetricFetcherImpl.cc(x2)uint64_t)rdc/tests/.../test_common.ccamdsmi/src/amd_smi/amd_smi.cc(x2)autodeduces the 64-bit enum typeamdsmi/tests/.../err_cnt_read_test.ccuint64_tvia #10179amdsmi/tests/.../test_common.ccamdsmi_cli/subcommands/metric.pyamdsmi/example/amd_smi_drm_example.ccrocm-smi-lib/.../err_cnt_read.ccrsmi_gpu_block_t)Issue Tracking
None.
Test Plan
compiling the affected translation units.
1ULL << 18and1ULL << 38) to confirm commit 1 stands alone and is not tied to commit 2.rdc/tests/rdc_tests/test_common.cc,rdc_libs/rdc/src/RdcMetricFetcherImpl.cc,amdsmi/tests/amd_smi_test/test_common.cc, andamdsmi/example/amd_smi_drm_example.ccagainst the final combined tree (
-Wall -Wextra).position by position, to confirm all 39 entries line up with their bit positions.
uint32_tvsuint64_tcounters at both enum widths, with an iteration cap to detect non-termination.
ctypes wrapper, Python interface, Rust) and that generated values match the
intended bit positions.
clang-formatplus the fullprojects/rdcandprojects/amdsmipre-commithook sets on every changed file.
Test Result
test_common.cc:62:37: error: static assertion failed: kBlockNameMap needs to be updated(
expression evaluates to '274877906944 == 262144') — identical to the CI log.are independently valid.
LAST = 1<<18withuint32_tterminates in 19 steps;LAST = 1<<38withuint32_tdoes not terminate;LAST = 1<<38withuint64_tterminates in 39 steps.MMSCH = 524288(1<<19),OXRP = 2147483648(
1<<31),PCIE_PL = 4294967296(1<<32),UCIE_PCS = LAST = 274877906944(
1<<38); 20 new blocks present in the header, ctypes wrapper, Pythoninterface, and Rust bindings.
UMC, whichaliases
AMDSMI_GPU_BLOCK_FIRST); longest nameKPX_SERDESat 10 chars confirms theold
[10]cell would have truncated it.clang-format, ruff, mixed line ending, C++ test conventions, SPDX headers all pass.
The only removed symbol is an unused test-only helper in RDC. The enum expansion
is additive, and the example fix is confined to a sample program.
Submission Checklist