Repository navigation
fix(amdsmi): report N/A driver date when the kernel has none - #13358
Merged
Merged
Conversation
- Return an empty driver_date from amdsmi_get_gpu_driver_info() when the kernel reports the DRM driver date as 0, so Python shows N/A - Move the date formatting into smi_amdgpu_format_driver_date() and unit-test it - Assert driver_date renders N/A in the Python empty-fields test - Document driver_date in the Python API reference and add a CHANGELOG entry 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. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
marifamd
requested review from
adam360x,
bill-shuzhou-liu,
gabrpham and
oliveiradan
October 13, 2026 19:09
bill-shuzhou-liu
approved these changes
Oct 13, 2026
gabrpham
approved these changes
Oct 13, 2026
gabrpham
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Approved,
adam360x
approved these changes
Oct 13, 2026
marifamd
added a commit
that referenced
this pull request
Oct 13, 2026
…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>
Contributor
TheRock Submodule Bump ActivityNewest first
|
4 of 6 tasks
JeniferC99
pushed a commit
that referenced
this pull request
Oct 22, 2026
## Motivation **Before:** ``amdsmi_driver_info_t`` was 768 bytes. #11821 grew it to 1792 bytes with four new string fields, but ``AMDSMI_LIB_VERSION_MAJOR`` stayed 27 and the library stayed ``libamd_smi.so.27``. It also made ``amdsmi_get_gpu_driver_info()`` zero ``sizeof(*info)``, so a binary built against the old header overflows its 768-byte buffer by 1024 bytes. **After:** the struct is 768 bytes again and ``amdsmi_get_gpu_driver_info()`` fills only ``driver_version``, ``driver_date`` and ``driver_name``. The ``driver_date`` fix from #13358 stays. ## Technical Details **Public header** (``include/amd_smi/amdsmi.h``): - Drop ``driver_kernel_version``, ``amdgpu_driver_version``, ``driver_build_version`` and ``driver_full_version`` - Drop the ``@details`` block on ``amdsmi_get_gpu_driver_info()`` **Library** (``src/amd_smi/amd_smi.cc``, ``src/amd_smi/amd_smi_utils.cc``, ``include/amd_smi/impl/amd_smi_utils.h``, ``src/amd_smi/amd_smi_wsl_device.cc``): - Remove the DKMS lookup and version parsing helpers and the WSL ``driver_full_version`` copy - Keep ``smi_amdgpu_format_driver_date()`` from #13358 **Python and Rust** (``py-interface/``, ``rust-interface/``): - Drop the four fields from the wrappers, the Python dictionary and the Rust getters - Keep ``AmdsmiVramTypeHbm4``, which ``amdsmi.h`` still defines **CLI** (``amdsmi_cli/``): - The default banner, ``amd-smi version`` and ``amd-smi static --driver`` read ``driver_version`` again **Docs and example** (``CHANGELOG.md``, ``docs/``, ``example/amd_smi_drm_example.cc``): - Remove both copies of the 10.2.0 "Added" entry (``develop`` has it twice) and the "Changed" entry - Restore the CLI examples and the Python API field table, keeping the ``driver_date`` row **Tests** (``tests/``): - Remove the DKMS, CLI and struct-layout tests that #11821 added - Move the ``driver_date`` tests from #13358 into ``driver_date_test.cc`` and ``test_driver_date.py``, because their old files were created by #11821 ## Scope rationale - NOT reverting #13358: the ``driver_date`` fix does not depend on the new fields - NOT bumping ``AMDSMI_LIB_VERSION_MAJOR``: this restores the layout that 27.x callers already have - NOT adding a versioned struct or a new API for the version details: a separate change if the fields are wanted again ## JIRA ID JIRA ID: ROCM-24167 ## Test Plan - [x] Build ``amdsmitst`` with ``-DBUILD_TESTS=ON -DBUILD_CLI=OFF`` - [x] ``amdsmitst --gtest_filter='SystemUnit.DriverDate*'`` and ``'*Unit.*'`` - [x] ``python3 -m unittest`` for ``test_driver_date.py`` and ``test_cli_static_bus_pcie.py`` - [x] ``check_test_conventions.py`` and the amdsmi ``pre-commit`` config - [ ] GPU host, WSL build, Rust build and CLI end to end: not run ## Test Result - ``SystemUnit.DriverDate*``: 3 passed. ``*Unit.*``: 289 passed, 0 failed - ``test_driver_date.py``: 1 passed. ``test_cli_static_bus_pcie.py``: 4 passed - Conventions check and ``pre-commit`` pass - A plain ``git revert`` conflicted in 7 files with later commits (#13358, #11075 and others), all resolved by hand ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
4 of 7 tasks
JeniferC99
pushed a commit
that referenced
this pull request
Oct 28, 2026
…4489) Cherry pick of f1e0b35 - had merge conflicts, needs manual checking of `projects/amdsmi/py-interface/amdsmi_wrapper.py` JIRA ID: AIRDEL-117 -------------- **Before:** ``amdsmi_driver_info_t`` was 768 bytes. #11821 grew it to 1792 bytes with four new string fields, but ``AMDSMI_LIB_VERSION_MAJOR`` stayed 27 and the library stayed ``libamd_smi.so.27``. It also made ``amdsmi_get_gpu_driver_info()`` zero ``sizeof(*info)``, so a binary built against the old header overflows its 768-byte buffer by 1024 bytes. **After:** the struct is 768 bytes again and ``amdsmi_get_gpu_driver_info()`` fills only ``driver_version``, ``driver_date`` and ``driver_name``. The ``driver_date`` fix from #13358 stays. **Public header** (``include/amd_smi/amdsmi.h``): - Drop ``driver_kernel_version``, ``amdgpu_driver_version``, ``driver_build_version`` and ``driver_full_version`` - Drop the ``@details`` block on ``amdsmi_get_gpu_driver_info()`` **Library** (``src/amd_smi/amd_smi.cc``, ``src/amd_smi/amd_smi_utils.cc``, ``include/amd_smi/impl/amd_smi_utils.h``, ``src/amd_smi/amd_smi_wsl_device.cc``): - Remove the DKMS lookup and version parsing helpers and the WSL ``driver_full_version`` copy - Keep ``smi_amdgpu_format_driver_date()`` from #13358 **Python and Rust** (``py-interface/``, ``rust-interface/``): - Drop the four fields from the wrappers, the Python dictionary and the Rust getters - Keep ``AmdsmiVramTypeHbm4``, which ``amdsmi.h`` still defines **CLI** (``amdsmi_cli/``): - The default banner, ``amd-smi version`` and ``amd-smi static --driver`` read ``driver_version`` again **Docs and example** (``CHANGELOG.md``, ``docs/``, ``example/amd_smi_drm_example.cc``): - Remove both copies of the 10.2.0 "Added" entry (``develop`` has it twice) and the "Changed" entry - Restore the CLI examples and the Python API field table, keeping the ``driver_date`` row **Tests** (``tests/``): - Remove the DKMS, CLI and struct-layout tests that #11821 added - Move the ``driver_date`` tests from #13358 into ``driver_date_test.cc`` and ``test_driver_date.py``, because their old files were created by #11821 - NOT reverting #13358: the ``driver_date`` fix does not depend on the new fields - NOT bumping ``AMDSMI_LIB_VERSION_MAJOR``: this restores the layout that 27.x callers already have - NOT adding a versioned struct or a new API for the version details: a separate change if the fields are wanted again JIRA ID: ROCM-24167 - [x] Build ``amdsmitst`` with ``-DBUILD_TESTS=ON -DBUILD_CLI=OFF`` - [x] ``amdsmitst --gtest_filter='SystemUnit.DriverDate*'`` and ``'*Unit.*'`` - [x] ``python3 -m unittest`` for ``test_driver_date.py`` and ``test_cli_static_bus_pcie.py`` - [x] ``check_test_conventions.py`` and the amdsmi ``pre-commit`` config - [ ] GPU host, WSL build, Rust build and CLI end to end: not run - ``SystemUnit.DriverDate*``: 3 passed. ``*Unit.*``: 289 passed, 0 failed - ``test_driver_date.py``: 1 passed. ``test_cli_static_bus_pcie.py``: 4 passed - Conventions check and ``pre-commit`` pass - A plain ``git revert`` conflicted in 7 files with later commits (#13358, #11075 and others), all resolved by hand - [ ] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. ## Motivation <!-- Explain the purpose of this PR and the goals it aims to achieve. --> ## Technical Details <!-- Explain the changes along with any relevant GitHub links. --> ## Issue Tracking <!-- Include a GitHub Issue and/or JIRA ID. Do not post any full JIRA links here. --> <!-- GitHub issue: #1234 --> <!-- JIRA ID: EXAMPLECOMPONENT-1234 --> ## Test Plan <!-- Explain any relevant testing done to verify this PR. --> ## Test Result <!-- Briefly summarize test outcomes. --> ## Submission Checklist - [ ] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. --------- Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com> Co-authored-by: Daniel Oliveira <daniel.oliveira@amd.com> Co-authored-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
1 task done
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
amdsmi_get_gpu_driver_info()reportsdriver_dateas0on kernels that no longer use the DRM driver date, such as the Ubuntu 6.11 kernel in an SR-IOV guest.0is not a date, so report it as not available instead.Technical Details
Library (
src/amd_smi/amd_smi.cc,src/amd_smi/amd_smi_utils.cc,include/amd_smi/impl/amd_smi_utils.h):smi_amdgpu_format_driver_date(), which returns an empty string for the kernel's0amdsmi_get_gpu_driver_info()leavesdriver_dateempty in that case, like the other driver fields that can be unavailablePython (
py-interface/amdsmi_interface.py): no change, it already maps empty driver fields toN/ACLI: no change, no subcommand prints the driver date
Tests:
SystemUnit.DriverDate*intests/amd_smi_test/unit/system/dkms_versions_test.cc:20150101,0, empty, and an unexpected formattests/python/unit/system/test_driver_versions.py: assertdriver_daterendersN/Awhen emptyDocs:
driver_daterow in the Python API referenceIssue Tracking
JIRA ID: ROCM-32689
Test Plan
amdsmitst --gtest_filter='*Unit*'tests/python/unit/system/test_driver_versions.pyagainst this buildamdsmi_get_gpu_driver_info()on bare metal (Navi 21, kernel 6.8) and on an SR-IOV guest (Radeon PRO V710 VF, Ubuntu 6.11 kernel)Test Result
driver_datestays2015/01/01 00:00driver_datewas0with the develop build and isN/Awith this change (the kernel's raw DRM date is0)