Repository navigation
fix(amdsmi): correct tray output, CPER list input and DRM example crash - #11143
Merged
Merged
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
oliveiradan
reviewed
Sep 3, 2026
oliveiradan
reviewed
Sep 3, 2026
oliveiradan
reviewed
Sep 3, 2026
oliveiradan
reviewed
Sep 3, 2026
oliveiradan
requested changes
Sep 3, 2026
dmitrii-galantsev
approved these changes
Sep 3, 2026
oliveiradan
approved these changes
Sep 3, 2026
oliveiradan
left a comment
Contributor
There was a problem hiding this comment.
Comments were addressed. Approved.
geomin12
reviewed
Sep 14, 2026
1 task done
…ample crash Six defects found while verifying develop across MI300A, MI350X, MI210, Strix Halo, Navi and a 75c1 part. amd-smi node --tray guarded its output on the retrieved dictionary being non-empty, so the N/A defaults sitting next to it were unreachable and the section rendered as a bare NODE: header. All three formats now report N/A. amdsmi_get_afids_from_cper validated its input with isinstance() against a subscripted generic, which Python rejects for any value, so the function raised TypeError for every caller. The CLI printed the Python exception class name ahead of the JSON error document, so parsing amd-smi --json output failed on every error path. The DRM example read the accelerator partition configuration into an uninitialized structure without checking the return value. An unsupported query left num_profiles indeterminate and the loop ran past the end of the profiles array, segfaulting for unprivileged callers on every GPU. The CLI test generator emitted flags that require a value with no value attached, so any host exposing such a flag failed by construction. The build workflow discarded example exit codes, which is why the segfault above went unnoticed. Fatal signals now fail the step; ordinary non-zero codes are reported but tolerated, since a query can legitimately be unsupported on a given ASIC. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
…rtiton function and amdsmi-build workflow exit codes
10.1 has branched, so these fixes ship in 10.2.0. Drop the --json error entry: develop's #8624 already removed the class-name prefix and documents it. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
State why only a crash fails the step while an error status is logged. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- Narrow the CPER entry to list input; bytes callers never hit the TypeError - Describe the example crash as the non-root NO_PERM path; the API zeroes its output before an unsupported query fails Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
marifamd
force-pushed
the
users/marifamd/amdsmi-verification-fixes
branch
from
October 13, 2026 17:37
e145f03 to
978f407
Compare
…smi-verification-fixes Conflicts: - CHANGELOG.md: keep develop's driver-date entry (#13358), then this PR's three 10.2.0 Resolved Issues entries. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- Restore amdsmi-build.yml and tests/python/cli/base.py to develop - #12997 changes the same example step and FindArgs, with tests Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- The CLI guide still said the TRAY block and keys are omitted Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- Quote the real --json shape, a list - Drop the zero-init clause from the DRM entry; #11922 made that change Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- temp_measurements entries are printed even when unsupported Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- Annotate Union[bytes, List[Dict[str, Any]]], valid on Python 3.6 - Describe both input forms in the docstring and the Python API reference - Report both accepted types in AmdSmiParameterException Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Contributor
|
@copilot rebase and fix conflict |
…smi-verification-fixes Co-authored-by: adam360x <61172547+adam360x@users.noreply.github.com>
Contributor
Integrated |
1 task done
Contributor
TheRock Submodule Bump ActivityNewest first
|
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
Verifying
developacross MI300A, MI350X, MI210, Strix Halo, Navi 21 + Navi 32 and a75c1part turned up these defects:amd-smi node --trayprinted an empty section on hardware without UALoE.amdsmi_get_afids_from_cper()raisedTypeErrorfor list input.amd_smi_drm_exsegfaulted when run without root, and CI discarded the example exit codes, so nothing caught it.Technical Details
CLI (
amdsmi_cli/subcommands/node.py):tray_dictguard. Human,--jsonand--csvnow reportMAX_ACC_PER_TRAYandTRAY_TYPEasN/Awhen tray info is unavailable, instead of a bareNODE:and{"node": {}}Python API (
py-interface/amdsmi_interface.py):amdsmi_get_afids_from_cper(): check list input withisinstance(..., list).isinstance()withList[Dict[str, Any]]always raisesTypeError, so the documented list-of-dicts input never worked and other bad input raisedTypeErrorinstead ofAmdSmiParameterException.bytesinput (the CLI path) was unaffectedExample (
example/amd_smi_drm_example.cc):amdsmi_get_gpu_accelerator_partition_profile_config()succeeds. Without root it returnsAMDSMI_STATUS_NO_PERMbefore filling its output, so the loop read an uninitializednum_profiles. fix(amdsmi): drm_examples SIGSEGV due to partition var init #11922 zero-initialized the struct ondevelop; this adds the status checksocket_info,profile,partition_id,vmode,temp_measurementsCLI test generator (
tests/python/cli/base.py):isupper()UntestedCI (
.github/workflows/amdsmi-build.yml):amdsmi_status_treturned frommain()and are only logged, since a call can be unsupported on a given ASIC. Before,|| echodiscarded every exit codeChangelog (
CHANGELOG.md):10.2.0Resolved Issues entriesThe
--jsonerror-prefix fix from the first revision is dropped: #8624 already removed the exception class name from every output format.Issue Tracking
N/A, found during manual verification of
develop.Test Plan
Original branch, on the machines above (source build installed to a staging prefix):
amd-smi node --trayin human,--jsonand--csvamd_smi_drm_exas root and non-rootamdsmitstread-only suites,unit_tests.py,test_abi_compat.pycli.test_list,cli.test_node,cli.test_version,cli.test_staticAfter merging
develop:pre-commiton every changed fileg++ -fsyntax-only -Wall -Wextraon the DRM exampleamdsmi_get_afids_from_cper()withbytes, a list of records, and anint, against the installed 27.1.0 library and themock_cperfixturesFindArgsagainst stubbed--helpoutputTest Result
amd_smi_drm_ex, non-root (Navi 21 + Navi 32)Segmentation fault, rc=139INPUT_OUT_OF_BOUNDSfrom the clock query, no crash)amd-smi node --trayNODE:TRAY:withMAX_ACC_PER_TRAY: N/AandTRAY_TYPE: N/Acli.test_listamdsmitstread-onlyunit_tests.pytest_abi_compat.pycli.test_node,cli.test_versionamdsmi_get_afids_from_cper([record])TypeErrorbytescallamdsmi_get_afids_from_cper(5)TypeErrorAmdSmiParameterExceptionFindArgsstub--nicrun with no valueUntested;reset --profilestill expandspre-commit,g++ -fsyntax-onlycli.test_staticfailedtest_trayandtest_asic_revision_id_keyson the original host becausetests/python/common/runcmd.pyputs/opt/rocm/binfirst onPATH, so the CLI tests ran the older installedamd-smi, which has no--tray.Submission Checklist