Repository navigation
chore(amdsmi): adopt two-line SPDX MIT license headers - #10402
Merged
Merged
Conversation
❌ PR Check — Action Required
📖 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
approved these changes
Aug 19, 2026
amd-josnarlo
approved these changes
Aug 19, 2026
gabrpham
approved these changes
Aug 19, 2026
Replace the full MIT block in the contributor guide with the two-line SPDX short form: a plain "Copyright Advanced Micro Devices, Inc." line followed by "SPDX-License-Identifier: MIT", with no year and no per-file license text (the full text stays in LICENSE). Add a matching "Copyright & License Headers" section to the style review agent so header drift is flagged during review. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Rewrite AMD-owned source headers to the two-line form, using each file's
comment leader:
Copyright Advanced Micro Devices, Inc.
SPDX-License-Identifier: MIT
This drops the per-file full MIT block, "All rights reserved", years, and
"(c)". It also fixes the double space in amd_smi_config.h.in and updates
the Python and Rust wrapper generators (tools/generator.py,
rust-interface/build.rs) so regenerated bindings carry the same
short-form header.
Third-party, vendored, kernel UAPI, Broadcom NIC, and generated files
(amdsmi_wrapper.py, amdsmi_wrapper.rs) keep their upstream headers and are
left unchanged.
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Add tests/check_license_headers.py, a check-only scanner that reports AMD-owned sources missing the two-line SPDX MIT header and exits non-zero without editing any file. Wire it into the amd-smi pre-commit config as the amdsmi-license-headers hook. Scope and exclusions (third-party, vendored, kernel UAPI, Broadcom NIC, and the generated wrappers) match the normalization in the preceding change, so the hook passes on the current tree and catches future drift. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
marifamd
force-pushed
the
users/marifamd/license-headers
branch
from
August 21, 2026 02:22
1d8d45b to
783ad47
Compare
- Remove the ' * See LICENSE...' and ' */' remnants the header rewrite left behind in rocm_smi_npm.cc and rocm_smi_npm.h; both files used the short four-line license block, so only its first two lines were replaced - Restores compilation: the stray lines parsed as top-level declarations and broke every OS job in the build matrix Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- Add has_orphaned_block_tail() so a file carrying both SPDX lines still fails when a '*/' precedes any '/*'; presence alone let the malformed rocm_smi_npm headers through - Report missing headers and leftover tails separately so the message names the actual defect - Add run_amdsmi_license_header_test.py covering well-formed, missing, orphaned-tail, and intact-block-comment cases Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
- Convert the full MIT block to the two-line SPDX form in the WSL backend, GPU backend, and cache-label test files that landed on develop after the original sweep, so the license-header hook passes on the whole tree Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
The header normalization reached into build templates and vendored includes it should not own. Narrow it to AMD sources: - checker: treat .in as non-source; add include/ras-decode and include/ualoe_lib to the exclude list - revert those templates and vendored headers to their pre-normalization state (ras-decode keeps CRLF; full MIT blocks restored) - LICENSE: use the current year only - test: cover the .in exclusion Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
dmitrii-galantsev
added a commit
that referenced
this pull request
Aug 27, 2026
develop adopted a two-line SPDX MIT header and a pre-commit hook that enforces it (#10402), which landed after this branch was cut. Rebasing onto it puts the viewer's eight files in scope of that check.
dmitrii-galantsev
added a commit
that referenced
this pull request
Aug 27, 2026
develop's own amd-smi SPDX hook fails on five files that still carry the old long-form MIT block: two ualoe_lib sources, status_string_test.cc, and two python unit tests. The hook checks the tree rather than the diff, so every PR opened against develop inherits the failure and a reviewer cannot tell a red check caused by the PR from one that was already there. Two-line header, same as #10402 applied everywhere else. MIT either way, no functional change. Separate commit so it can be dropped or landed on its own; it is unrelated to the OpenSpec work in the rest of this branch.
dmitrii-galantsev
added a commit
that referenced
this pull request
Aug 27, 2026
develop's own amd-smi SPDX hook fails on five files that still carry the old long-form MIT block: two ualoe_lib sources, status_string_test.cc, and two python unit tests. The hook checks the tree rather than the diff, so every PR opened against develop inherits the failure and a reviewer cannot tell a red check caused by the PR from one that was already there. Two-line header, same as #10402 applied everywhere else. MIT either way, no functional change. Separate commit so it can be dropped or landed on its own; it is unrelated to the OpenSpec work in the rest of this branch.
amd-justchen
added a commit
that referenced
this pull request
Aug 27, 2026
…0845) ## Why #10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. **The hook currently fails on `develop` itself**, so every open amd-smi PR is red — including ones that touch none of the offending files. ``` $ git checkout origin/develop $ python3 projects/amdsmi/tests/check_license_headers.py Missing or malformed AMD SPDX license header: src/ualoe_lib/ualoe_nl.c src/ualoe_lib/ualoe_telem.c tests/amd_smi_test/unit/system/status_string_test.cc tests/python/unit/gpu/test_cli_vram_type_lpddr5.py tests/python/unit/system/test_expect_status.py ``` The blast radius is wide because the hook is `pass_filenames: false` and rescans the whole tracked tree. It fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. #10083 trips it by editing one line of `src/CMakeLists.txt`. ## What The five files fall into two groups with different causes. **Three are amd-smi's own**, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. Converted here: | File | Landed via | |---|---| | `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 | | `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 | | `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` | **The other two are not ours to edit.** `src/ualoe_lib/` is the vendored UALoE library, replaced wholesale by the periodic *"sync UALoE lib"* drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit `exclude:` block, keeping clang-format and the rest off that code. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/` behind, so the checker now polices code the next sync will overwrite. Rewriting those headers would be reverted by the next drop and the hook would break again, so the missing prefix is added to `EXCLUDE_PREFIX` instead. The three files #10402 did rewrite under `src/ualoe_lib/` are left alone; they now fall outside the check and will drift back on their own at the next sync. Header text and check scope only — no functional change. ## Verification ``` $ python3 projects/amdsmi/tests/check_license_headers.py # exit 0 $ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py # 6/6 cases $ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed> codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts / large-files / mixed-line-ending / clang-format / ruff format / amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed ``` Confirmed the two vendored files are byte-identical to `develop` (`git diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and that the checker skips them when named explicitly. Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
weibchen1111
pushed a commit
to weibchen1111/rocm-systems
that referenced
this pull request
Aug 28, 2026
ROCm#10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. The hook currently fails on develop itself, so every open amd-smi PR is red. The hook is `pass_filenames: false` and rescans the whole tracked tree, so it fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. Five files were flagged, in two groups with different causes. Three are amd-smi's own, and simply landed while ROCm#10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. They are converted here: tests/amd_smi_test/unit/system/status_string_test.cc (ROCm#10177) tests/python/unit/gpu/test_cli_vram_type_lpddr5.py (ROCm#10775) tests/python/unit/system/test_expect_status.py The other two, src/ualoe_lib/ualoe_nl.c and ualoe_telem.c, are not ours to edit. src/ualoe_lib is the vendored UALoE library, replaced wholesale by the periodic "sync UALoE lib" drops (ROCm#9688), which is why that PR excluded `ualoe_lib/` from the rest of the pre-commit suite. ROCm#10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/`, so the checker polices code the next sync will overwrite - a header rewritten here reverts, and the hook breaks again. The missing prefix is added instead. The three files ROCm#10402 did rewrite under src/ualoe_lib are left alone; they now fall outside the check and will drift back on their own. Header text and check scope only - no functional change.
Contributor
TheRock Submodule Bump ActivityNewest first
|
amd-josnarlo
pushed a commit
that referenced
this pull request
Aug 28, 2026
- Update homepage URLs to the current rocm-systems monorepo path in CMakeLists.txt, py-interface/pyproject.toml.in, and the improvement-evaluation skill source list - Add a Documentation URL to the Python package metadata (py-interface/pyproject.toml.in) - Fix the rocm-smi link in amdsmi_cli/README.md to the monorepo projects/rocm-smi-lib path - Update the ASAN reference in help_package.cmake from the retired RadeonOpenCompute org to ROCm - Correct the CONTRIBUTING.md link in the NIC integration guide to the .github/ path - `python3 tests/check_license_headers.py` reports 0 offenders (exit 0). - gersemi (CMake) clean; ruff clean except one pre-existing unrelated file. - Generated wrappers unchanged. --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
This was referenced Aug 28, 2026
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>
1 task done
dmitrii-galantsev
added a commit
that referenced
this pull request
Sep 30, 2026
Completion had two independent faults. Since #529 the parser registers only the subcommand named in sys.argv, or the default parser when none is given. argcomplete runs the CLI with only the program name in argv and passes the command line in COMP_LINE, so only "default" was registered and no subcommand or subcommand option completed. Register every subcommand when _ARGCOMPLETE is set, as the --help path already does. Normal invocations stay lazy. #10402 replaced the license header in amdsmi_cli.py and dropped the "# PYTHON_ARGCOMPLETE_OK" line with it. argcomplete's global hook, which the amd-smi-lib postinst enables with activate-global-python-argcomplete, only completes scripts that carry that marker in their first 1024 bytes. Restore it. The install page installed argcomplete with pip, which fails on system Pythons marked externally managed by PEP 668, and relied on the global hook, which does not recognize TheRock's pip console launcher. Install the distribution package for native installs, pip only inside a venv, and register amd-smi explicitly, handling the "3"-suffixed helper that Ubuntu 22.04 ships. Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
dmitrii-galantsev
added a commit
that referenced
this pull request
Sep 30, 2026
Completion had two independent faults. Since #529 the parser registers only the subcommand named in sys.argv, or the default parser when none is given. argcomplete runs the CLI with only the program name in argv and passes the command line in COMP_LINE, so only "default" was registered and no subcommand or subcommand option completed. Register every subcommand when _ARGCOMPLETE is set, as the --help path already does. Normal invocations stay lazy. #10402 replaced the license header in amdsmi_cli.py and dropped the "# PYTHON_ARGCOMPLETE_OK" line with it. argcomplete's global hook, which the amd-smi-lib postinst enables with activate-global-python-argcomplete, only completes scripts that carry that marker in their first 1024 bytes. Restore it. The install page installed argcomplete with pip, which fails on system Pythons marked externally managed by PEP 668, and relied on the global hook, which does not recognize TheRock's pip console launcher. Install the distribution package for native installs, pip only inside a venv, and register amd-smi explicitly, handling the "3"-suffixed helper that Ubuntu 22.04 ships. Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
marifamd
pushed a commit
that referenced
this pull request
Oct 6, 2026
Completion had two independent faults. Since #529 the parser registers only the subcommand named in sys.argv, or the default parser when none is given. argcomplete runs the CLI with only the program name in argv and passes the command line in COMP_LINE, so only "default" was registered and no subcommand or subcommand option completed. Register every subcommand when _ARGCOMPLETE is set, as the --help path already does. Normal invocations stay lazy. #10402 replaced the license header in amdsmi_cli.py and dropped the "# PYTHON_ARGCOMPLETE_OK" line with it. argcomplete's global hook, which the amd-smi-lib postinst enables with activate-global-python-argcomplete, only completes scripts that carry that marker in their first 1024 bytes. Restore it. The install page installed argcomplete with pip, which fails on system Pythons marked externally managed by PEP 668, and relied on the global hook, which does not recognize TheRock's pip console launcher. Install the distribution package for native installs, pip only inside a venv, and register amd-smi explicitly, handling the "3"-suffixed helper that Ubuntu 22.04 ships. Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 8, 2026
- Update homepage URLs to the current rocm-systems monorepo path in CMakeLists.txt, py-interface/pyproject.toml.in, and the improvement-evaluation skill source list - Add a Documentation URL to the Python package metadata (py-interface/pyproject.toml.in) - Fix the rocm-smi link in amdsmi_cli/README.md to the monorepo projects/rocm-smi-lib path - Update the ASAN reference in help_package.cmake from the retired RadeonOpenCompute org to ROCm - Correct the CONTRIBUTING.md link in the NIC integration guide to the .github/ path ## Verification - `python3 tests/check_license_headers.py` reports 0 offenders (exit 0). - gersemi (CMake) clean; ruff clean except one pre-existing unrelated file. - Generated wrappers unchanged. --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 8, 2026
#10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. The hook currently fails on develop itself, so every open amd-smi PR is red. The hook is `pass_filenames: false` and rescans the whole tracked tree, so it fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. Five files were flagged, in two groups with different causes. Three are amd-smi's own, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. They are converted here: tests/amd_smi_test/unit/system/status_string_test.cc (#10177) tests/python/unit/gpu/test_cli_vram_type_lpddr5.py (#10775) tests/python/unit/system/test_expect_status.py The other two, src/ualoe_lib/ualoe_nl.c and ualoe_telem.c, are not ours to edit. src/ualoe_lib is the vendored UALoE library, replaced wholesale by the periodic "sync UALoE lib" drops (#9688), which is why that PR excluded `ualoe_lib/` from the rest of the pre-commit suite. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/`, so the checker polices code the next sync will overwrite - a header rewritten here reverts, and the hook breaks again. The missing prefix is added instead. The three files #10402 did rewrite under src/ualoe_lib are left alone; they now fall outside the check and will drift back on their own. Header text and check scope only - no functional change.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 8, 2026
…0845) ## Why #10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. **The hook currently fails on `develop` itself**, so every open amd-smi PR is red — including ones that touch none of the offending files. ``` $ git checkout origin/develop $ python3 projects/amdsmi/tests/check_license_headers.py Missing or malformed AMD SPDX license header: src/ualoe_lib/ualoe_nl.c src/ualoe_lib/ualoe_telem.c tests/amd_smi_test/unit/system/status_string_test.cc tests/python/unit/gpu/test_cli_vram_type_lpddr5.py tests/python/unit/system/test_expect_status.py ``` The blast radius is wide because the hook is `pass_filenames: false` and rescans the whole tracked tree. It fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. #10083 trips it by editing one line of `src/CMakeLists.txt`. ## What The five files fall into two groups with different causes. **Three are amd-smi's own**, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. Converted here: | File | Landed via | |---|---| | `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 | | `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 | | `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` | **The other two are not ours to edit.** `src/ualoe_lib/` is the vendored UALoE library, replaced wholesale by the periodic *"sync UALoE lib"* drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit `exclude:` block, keeping clang-format and the rest off that code. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/` behind, so the checker now polices code the next sync will overwrite. Rewriting those headers would be reverted by the next drop and the hook would break again, so the missing prefix is added to `EXCLUDE_PREFIX` instead. The three files #10402 did rewrite under `src/ualoe_lib/` are left alone; they now fall outside the check and will drift back on their own at the next sync. Header text and check scope only — no functional change. ## Verification ``` $ python3 projects/amdsmi/tests/check_license_headers.py # exit 0 $ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py # 6/6 cases $ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed> codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts / large-files / mixed-line-ending / clang-format / ruff format / amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed ``` Confirmed the two vendored files are byte-identical to `develop` (`git diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and that the checker skips them when named explicitly. Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 9, 2026
- Update homepage URLs to the current rocm-systems monorepo path in CMakeLists.txt, py-interface/pyproject.toml.in, and the improvement-evaluation skill source list - Add a Documentation URL to the Python package metadata (py-interface/pyproject.toml.in) - Fix the rocm-smi link in amdsmi_cli/README.md to the monorepo projects/rocm-smi-lib path - Update the ASAN reference in help_package.cmake from the retired RadeonOpenCompute org to ROCm - Correct the CONTRIBUTING.md link in the NIC integration guide to the .github/ path ## Verification - `python3 tests/check_license_headers.py` reports 0 offenders (exit 0). - gersemi (CMake) clean; ruff clean except one pre-existing unrelated file. - Generated wrappers unchanged. --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 9, 2026
#10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. The hook currently fails on develop itself, so every open amd-smi PR is red. The hook is `pass_filenames: false` and rescans the whole tracked tree, so it fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. Five files were flagged, in two groups with different causes. Three are amd-smi's own, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. They are converted here: tests/amd_smi_test/unit/system/status_string_test.cc (#10177) tests/python/unit/gpu/test_cli_vram_type_lpddr5.py (#10775) tests/python/unit/system/test_expect_status.py The other two, src/ualoe_lib/ualoe_nl.c and ualoe_telem.c, are not ours to edit. src/ualoe_lib is the vendored UALoE library, replaced wholesale by the periodic "sync UALoE lib" drops (#9688), which is why that PR excluded `ualoe_lib/` from the rest of the pre-commit suite. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/`, so the checker polices code the next sync will overwrite - a header rewritten here reverts, and the hook breaks again. The missing prefix is added instead. The three files #10402 did rewrite under src/ualoe_lib are left alone; they now fall outside the check and will drift back on their own. Header text and check scope only - no functional change.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 9, 2026
…0845) ## Why #10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. **The hook currently fails on `develop` itself**, so every open amd-smi PR is red — including ones that touch none of the offending files. ``` $ git checkout origin/develop $ python3 projects/amdsmi/tests/check_license_headers.py Missing or malformed AMD SPDX license header: src/ualoe_lib/ualoe_nl.c src/ualoe_lib/ualoe_telem.c tests/amd_smi_test/unit/system/status_string_test.cc tests/python/unit/gpu/test_cli_vram_type_lpddr5.py tests/python/unit/system/test_expect_status.py ``` The blast radius is wide because the hook is `pass_filenames: false` and rescans the whole tracked tree. It fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. #10083 trips it by editing one line of `src/CMakeLists.txt`. ## What The five files fall into two groups with different causes. **Three are amd-smi's own**, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. Converted here: | File | Landed via | |---|---| | `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 | | `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 | | `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` | **The other two are not ours to edit.** `src/ualoe_lib/` is the vendored UALoE library, replaced wholesale by the periodic *"sync UALoE lib"* drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit `exclude:` block, keeping clang-format and the rest off that code. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/` behind, so the checker now polices code the next sync will overwrite. Rewriting those headers would be reverted by the next drop and the hook would break again, so the missing prefix is added to `EXCLUDE_PREFIX` instead. The three files #10402 did rewrite under `src/ualoe_lib/` are left alone; they now fall outside the check and will drift back on their own at the next sync. Header text and check scope only — no functional change. ## Verification ``` $ python3 projects/amdsmi/tests/check_license_headers.py # exit 0 $ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py # 6/6 cases $ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed> codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts / large-files / mixed-line-ending / clang-format / ruff format / amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed ``` Confirmed the two vendored files are byte-identical to `develop` (`git diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and that the checker skips them when named explicitly. Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
marifamd
pushed a commit
that referenced
this pull request
Oct 14, 2026
) ## Motivation The AMD SMI install page and packaging docs no longer matched what AMD SMI ships. The page required "the `amdgpu-dkms` driver" (added in #6032). `amdgpu-dkms` is a package; AMD SMI needs the `amdgpu` module, in-kernel or DKMS. The page also recommended `pip install amdsmi` as a self-contained wheel, which PyPI does not serve, and told multi-ROCm users to remove `amd-smi-lib`, which other ROCm packages depend on. `amd-smi` bash completion was also broken. ## Technical Details One commit per concern: 1. **Driver requirements.** Require the `amdgpu` driver on native Linux, not the `amdgpu-dkms` package, and link the WSL guide for the `/dev/dxg` backend. HSMP is optional and upstream since Linux 5.18 (`amd_hsmp`) and 6.13 (`hsmp_acpi`). 2. **Azure Linux note.** Scope the `more_itertools` note to `amd-smi-lib` from 7.2.x and earlier, or built from source before 10.1, whose postinst runs pip. The `packaging.md` upgrade table moves from 7.14 to 10.1 to match. 3. **Nightly index.** Use `nightly.repo.amd.com/rocm/whl-next`; `rocm.nightlies.amd.com/whl-multi-arch` stopped updating on 2026-08-22. `amd-smi` is in `rocm-sdk-core`, so no extras are needed. 4. **Python module path.** `amdrocm-amdsmi` and the pip SDK ship `amdsmi` only under `share/amd_smi`. Document the `PYTHONPATH` step for both, and verify with a call into the native library, because the wrapper imports even when the library cannot load. 5. **Bash completion (code fix).** Two independent causes: - Since #529 the parser registers only the subcommand named in `argv`. argcomplete runs the CLI with only the program name in `argv`, so no subcommand or subcommand option completed. The fix registers every subcommand when `_ARGCOMPLETE` is set; normal runs stay lazy. - #10402 dropped `# PYTHON_ARGCOMPLETE_OK` from `amdsmi_cli.py`, so the global hook skipped `amd-smi`. The marker is restored. The docs now install `python3-argcomplete` from the distro (pip only inside a venv, since system pip fails under PEP 668). They register `amd-smi` explicitly, which also covers TheRock's pip launcher, and handle Ubuntu 22.04's `register-python-argcomplete3`. Four unit tests cover the marker, full registration during completion, and lazy registration otherwise. 6. **Python packages actually shipped.** - The PyPI `amdsmi` releases through 7.0.2 are community-built, wrapper-only wheels. They load `libamd_smi.so` via `ROCM_HOME`, then `ROCM_PATH`, then the linker, and need the library from the same ROCm release. The docs now warn against them instead of recommending them. - `packaging.md` and `py-interface/README.md` separate those releases from the bundled-library wheel that `BUILD_PYTHON_WHEEL=ON` builds, and list that wheel's runtime prerequisites. The raw build needs system libnl/libmnl. The repaired manylinux wheel vendors libnl/libmnl. Both need `libdrm_amdgpu`. - TheRock tarballs and the pip SDK are documented as importable with `PYTHONPATH`. The README uses absolute links because it becomes the wheel's PyPI description. - The multi-ROCm procedure no longer removes `amd-smi-lib`, which `rdc`, `rocm-validation-suite` and `rocprofiler-systems` depend on. Readers check which copy Python imports, remove only an unwanted pip copy, and select a ROCm instance with `PYTHONPATH` (plus `ROCM_PATH`, set for the Python command only, for 7.1 and earlier wrappers). The docs describe the packages published today. They do not claim that a bundled-library wheel is on PyPI. ## Test Plan Isolated Docker containers with two Radeon PRO W6800s (in-tree amdgpu, no DKMS). The containers mounted no host ROCm, site-packages or modules. Each case checked the loaded native library in `/proc/self/maps` or with `LD_DEBUG`, not just a successful import. The runtime code was built and tested at the previous head plus these changes. The pushed tree is byte-identical. - **Classic DEB built from this tree:** - 186 Python unit tests - 158 C++ unit tests, 32 read-only C++ tests, and 6 public-API tests linked against the installed shared library - 137 read-only integration cases - 13 read-only CLI commands - live Bash completion through both the global hook and explicit registration - **Loader contract and completion tests on Python 3.6 through 3.14:** 45 loader-contract tests and the 4 completion tests on each interpreter. - **Published TheRock artifacts:** - native DEB (Ubuntu 24.04) and RPM (AlmaLinux 9) installs, without `amdgpu-dkms` - the nightly pip SDK, with the exact `_rocm_sdk_core` command from the docs, and explicit completion through its launcher - the tarball - **Legacy wrappers:** - PyPI 7.0.2 with the matching ROCm 7.0.2 library, and with the current 10.2 library - `ROCM_HOME` precedence - the documented multi-ROCm selection, using both the ROCm 7.0.2 wrapper shipped in `share/amd_smi` and a current wrapper, with an old pip copy left installed - **Wheels:** - raw `BUILD_PYTHON_WHEEL=ON` wheel: 11 loader scenarios, and symbol isolation from a globally loaded system library - repaired manylinux wheel: stock Ubuntu 24.04 with no GPU and no system libnl/libmnl; read-only GPU queries before and after installing `libdrm-amdgpu1` - **Distro argcomplete setup:** on Ubuntu 22.04 and 24.04, Debian 12, AlmaLinux 9 and Leap 15.6, using a minimal argparse fixture, not the AMD SMI CLI. This covered package install, helper names and Bash `COMPREPLY`. System pip was also run on Ubuntu 24.04 and Debian 12, plus pip inside a venv. - **Checks:** fresh Sphinx builds of the base and this branch; `projects/amdsmi/.pre-commit-config.yaml` on the changed files; `tests/check_license_headers.py`; `git diff --check`. ## Test Result - **Classic DEB:** everything listed above passes. Integration: 106 passed, 31 skipped by the suite's own skip markers (12 CPU, 17 GPU, 2 NIC). The skips are not counted as coverage. - **Published TheRock artifacts:** each loads its own `libamd_smi.so` and sees both GPUs. - **Legacy wrappers:** PyPI 7.0.2 works with the ROCm 7.0.2 library. With the 10.2 library, import fails with `undefined symbol: amdsmi_set_gpu_clk_range`. The documented multi-ROCm procedure loads the matching library in both cases. - **Wheels:** - The raw wheel passes all 11 loader scenarios. - The repaired wheel loads its bundled and vendored libraries in stock Ubuntu 24.04. Without `libdrm-amdgpu1`, discovery succeeds but some queries return NOT_SUPPORTED and the BDF is wrong. With `libdrm-amdgpu1` installed, the results are correct. This is why the docs list libdrm as a prerequisite. - **Distro argcomplete setup:** Ubuntu 22.04 ships only the `3`-suffixed helper; the other four ship the plain name. System pip is rejected by PEP 668 on Ubuntu 24.04 and Debian 12; pip inside a venv works. - **Docs:** 224 warnings on both base and branch, with identical messages; there are no new warnings. - **Hooks and checks:** clean. Not covered: - mutating GPU tests (sets, resets, partitioning, benchmarks), excluded on purpose - CPU/HSMP, NICs, partition-capable Instinct GPUs and Windows Pre-existing issues found during testing, not changed here: - The classic DEB's dependencies omit libnl/libmnl. - `amdsmi_get_gpu_device_bdf()` returns an uninitialized BDF with success when `libdrm_amdgpu` is missing. Related open PRs: - ROCm/TheRock#8424 would register the module path automatically for `amdrocm-amdsmi` and `rocm-sdk-core`. It is not merged, so these docs describe current packages. --------- Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 14, 2026
- Update homepage URLs to the current rocm-systems monorepo path in CMakeLists.txt, py-interface/pyproject.toml.in, and the improvement-evaluation skill source list - Add a Documentation URL to the Python package metadata (py-interface/pyproject.toml.in) - Fix the rocm-smi link in amdsmi_cli/README.md to the monorepo projects/rocm-smi-lib path - Update the ASAN reference in help_package.cmake from the retired RadeonOpenCompute org to ROCm - Correct the CONTRIBUTING.md link in the NIC integration guide to the .github/ path ## Verification - `python3 tests/check_license_headers.py` reports 0 offenders (exit 0). - gersemi (CMake) clean; ruff clean except one pre-existing unrelated file. - Generated wrappers unchanged. --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 14, 2026
#10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. The hook currently fails on develop itself, so every open amd-smi PR is red. The hook is `pass_filenames: false` and rescans the whole tracked tree, so it fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. Five files were flagged, in two groups with different causes. Three are amd-smi's own, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. They are converted here: tests/amd_smi_test/unit/system/status_string_test.cc (#10177) tests/python/unit/gpu/test_cli_vram_type_lpddr5.py (#10775) tests/python/unit/system/test_expect_status.py The other two, src/ualoe_lib/ualoe_nl.c and ualoe_telem.c, are not ours to edit. src/ualoe_lib is the vendored UALoE library, replaced wholesale by the periodic "sync UALoE lib" drops (#9688), which is why that PR excluded `ualoe_lib/` from the rest of the pre-commit suite. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/`, so the checker polices code the next sync will overwrite - a header rewritten here reverts, and the hook breaks again. The missing prefix is added instead. The three files #10402 did rewrite under src/ualoe_lib are left alone; they now fall outside the check and will drift back on their own. Header text and check scope only - no functional change.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 14, 2026
…0845) ## Why #10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. **The hook currently fails on `develop` itself**, so every open amd-smi PR is red — including ones that touch none of the offending files. ``` $ git checkout origin/develop $ python3 projects/amdsmi/tests/check_license_headers.py Missing or malformed AMD SPDX license header: src/ualoe_lib/ualoe_nl.c src/ualoe_lib/ualoe_telem.c tests/amd_smi_test/unit/system/status_string_test.cc tests/python/unit/gpu/test_cli_vram_type_lpddr5.py tests/python/unit/system/test_expect_status.py ``` The blast radius is wide because the hook is `pass_filenames: false` and rescans the whole tracked tree. It fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. #10083 trips it by editing one line of `src/CMakeLists.txt`. ## What The five files fall into two groups with different causes. **Three are amd-smi's own**, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. Converted here: | File | Landed via | |---|---| | `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 | | `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 | | `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` | **The other two are not ours to edit.** `src/ualoe_lib/` is the vendored UALoE library, replaced wholesale by the periodic *"sync UALoE lib"* drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit `exclude:` block, keeping clang-format and the rest off that code. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/` behind, so the checker now polices code the next sync will overwrite. Rewriting those headers would be reverted by the next drop and the hook would break again, so the missing prefix is added to `EXCLUDE_PREFIX` instead. The three files #10402 did rewrite under `src/ualoe_lib/` are left alone; they now fall outside the check and will drift back on their own at the next sync. Header text and check scope only — no functional change. ## Verification ``` $ python3 projects/amdsmi/tests/check_license_headers.py # exit 0 $ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py # 6/6 cases $ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed> codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts / large-files / mixed-line-ending / clang-format / ruff format / amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed ``` Confirmed the two vendored files are byte-identical to `develop` (`git diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and that the checker skips them when named explicitly. Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 14, 2026
- Update homepage URLs to the current rocm-systems monorepo path in CMakeLists.txt, py-interface/pyproject.toml.in, and the improvement-evaluation skill source list - Add a Documentation URL to the Python package metadata (py-interface/pyproject.toml.in) - Fix the rocm-smi link in amdsmi_cli/README.md to the monorepo projects/rocm-smi-lib path - Update the ASAN reference in help_package.cmake from the retired RadeonOpenCompute org to ROCm - Correct the CONTRIBUTING.md link in the NIC integration guide to the .github/ path ## Verification - `python3 tests/check_license_headers.py` reports 0 offenders (exit 0). - gersemi (CMake) clean; ruff clean except one pre-existing unrelated file. - Generated wrappers unchanged. --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 14, 2026
#10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. The hook currently fails on develop itself, so every open amd-smi PR is red. The hook is `pass_filenames: false` and rescans the whole tracked tree, so it fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. Five files were flagged, in two groups with different causes. Three are amd-smi's own, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. They are converted here: tests/amd_smi_test/unit/system/status_string_test.cc (#10177) tests/python/unit/gpu/test_cli_vram_type_lpddr5.py (#10775) tests/python/unit/system/test_expect_status.py The other two, src/ualoe_lib/ualoe_nl.c and ualoe_telem.c, are not ours to edit. src/ualoe_lib is the vendored UALoE library, replaced wholesale by the periodic "sync UALoE lib" drops (#9688), which is why that PR excluded `ualoe_lib/` from the rest of the pre-commit suite. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/`, so the checker polices code the next sync will overwrite - a header rewritten here reverts, and the hook breaks again. The missing prefix is added instead. The three files #10402 did rewrite under src/ualoe_lib are left alone; they now fall outside the check and will drift back on their own. Header text and check scope only - no functional change.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 14, 2026
…0845) ## Why #10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. **The hook currently fails on `develop` itself**, so every open amd-smi PR is red — including ones that touch none of the offending files. ``` $ git checkout origin/develop $ python3 projects/amdsmi/tests/check_license_headers.py Missing or malformed AMD SPDX license header: src/ualoe_lib/ualoe_nl.c src/ualoe_lib/ualoe_telem.c tests/amd_smi_test/unit/system/status_string_test.cc tests/python/unit/gpu/test_cli_vram_type_lpddr5.py tests/python/unit/system/test_expect_status.py ``` The blast radius is wide because the hook is `pass_filenames: false` and rescans the whole tracked tree. It fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. #10083 trips it by editing one line of `src/CMakeLists.txt`. ## What The five files fall into two groups with different causes. **Three are amd-smi's own**, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. Converted here: | File | Landed via | |---|---| | `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 | | `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 | | `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` | **The other two are not ours to edit.** `src/ualoe_lib/` is the vendored UALoE library, replaced wholesale by the periodic *"sync UALoE lib"* drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit `exclude:` block, keeping clang-format and the rest off that code. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/` behind, so the checker now polices code the next sync will overwrite. Rewriting those headers would be reverted by the next drop and the hook would break again, so the missing prefix is added to `EXCLUDE_PREFIX` instead. The three files #10402 did rewrite under `src/ualoe_lib/` are left alone; they now fall outside the check and will drift back on their own at the next sync. Header text and check scope only — no functional change. ## Verification ``` $ python3 projects/amdsmi/tests/check_license_headers.py # exit 0 $ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py # 6/6 cases $ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed> codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts / large-files / mixed-line-ending / clang-format / ruff format / amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed ``` Confirmed the two vendored files are byte-identical to `develop` (`git diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and that the checker skips them when named explicitly. Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 15, 2026
- Update homepage URLs to the current rocm-systems monorepo path in CMakeLists.txt, py-interface/pyproject.toml.in, and the improvement-evaluation skill source list - Add a Documentation URL to the Python package metadata (py-interface/pyproject.toml.in) - Fix the rocm-smi link in amdsmi_cli/README.md to the monorepo projects/rocm-smi-lib path - Update the ASAN reference in help_package.cmake from the retired RadeonOpenCompute org to ROCm - Correct the CONTRIBUTING.md link in the NIC integration guide to the .github/ path ## Verification - `python3 tests/check_license_headers.py` reports 0 offenders (exit 0). - gersemi (CMake) clean; ruff clean except one pre-existing unrelated file. - Generated wrappers unchanged. --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 15, 2026
#10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. The hook currently fails on develop itself, so every open amd-smi PR is red. The hook is `pass_filenames: false` and rescans the whole tracked tree, so it fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. Five files were flagged, in two groups with different causes. Three are amd-smi's own, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. They are converted here: tests/amd_smi_test/unit/system/status_string_test.cc (#10177) tests/python/unit/gpu/test_cli_vram_type_lpddr5.py (#10775) tests/python/unit/system/test_expect_status.py The other two, src/ualoe_lib/ualoe_nl.c and ualoe_telem.c, are not ours to edit. src/ualoe_lib is the vendored UALoE library, replaced wholesale by the periodic "sync UALoE lib" drops (#9688), which is why that PR excluded `ualoe_lib/` from the rest of the pre-commit suite. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/`, so the checker polices code the next sync will overwrite - a header rewritten here reverts, and the hook breaks again. The missing prefix is added instead. The three files #10402 did rewrite under src/ualoe_lib are left alone; they now fall outside the check and will drift back on their own. Header text and check scope only - no functional change.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 15, 2026
…0845) ## Why #10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. **The hook currently fails on `develop` itself**, so every open amd-smi PR is red — including ones that touch none of the offending files. ``` $ git checkout origin/develop $ python3 projects/amdsmi/tests/check_license_headers.py Missing or malformed AMD SPDX license header: src/ualoe_lib/ualoe_nl.c src/ualoe_lib/ualoe_telem.c tests/amd_smi_test/unit/system/status_string_test.cc tests/python/unit/gpu/test_cli_vram_type_lpddr5.py tests/python/unit/system/test_expect_status.py ``` The blast radius is wide because the hook is `pass_filenames: false` and rescans the whole tracked tree. It fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. #10083 trips it by editing one line of `src/CMakeLists.txt`. ## What The five files fall into two groups with different causes. **Three are amd-smi's own**, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. Converted here: | File | Landed via | |---|---| | `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 | | `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 | | `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` | **The other two are not ours to edit.** `src/ualoe_lib/` is the vendored UALoE library, replaced wholesale by the periodic *"sync UALoE lib"* drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit `exclude:` block, keeping clang-format and the rest off that code. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/` behind, so the checker now polices code the next sync will overwrite. Rewriting those headers would be reverted by the next drop and the hook would break again, so the missing prefix is added to `EXCLUDE_PREFIX` instead. The three files #10402 did rewrite under `src/ualoe_lib/` are left alone; they now fall outside the check and will drift back on their own at the next sync. Header text and check scope only — no functional change. ## Verification ``` $ python3 projects/amdsmi/tests/check_license_headers.py # exit 0 $ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py # 6/6 cases $ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed> codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts / large-files / mixed-line-ending / clang-format / ruff format / amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed ``` Confirmed the two vendored files are byte-identical to `develop` (`git diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and that the checker skips them when named explicitly. Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 15, 2026
- Update homepage URLs to the current rocm-systems monorepo path in CMakeLists.txt, py-interface/pyproject.toml.in, and the improvement-evaluation skill source list - Add a Documentation URL to the Python package metadata (py-interface/pyproject.toml.in) - Fix the rocm-smi link in amdsmi_cli/README.md to the monorepo projects/rocm-smi-lib path - Update the ASAN reference in help_package.cmake from the retired RadeonOpenCompute org to ROCm - Correct the CONTRIBUTING.md link in the NIC integration guide to the .github/ path ## Verification - `python3 tests/check_license_headers.py` reports 0 offenders (exit 0). - gersemi (CMake) clean; ruff clean except one pre-existing unrelated file. - Generated wrappers unchanged. --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 15, 2026
#10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. The hook currently fails on develop itself, so every open amd-smi PR is red. The hook is `pass_filenames: false` and rescans the whole tracked tree, so it fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. Five files were flagged, in two groups with different causes. Three are amd-smi's own, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. They are converted here: tests/amd_smi_test/unit/system/status_string_test.cc (#10177) tests/python/unit/gpu/test_cli_vram_type_lpddr5.py (#10775) tests/python/unit/system/test_expect_status.py The other two, src/ualoe_lib/ualoe_nl.c and ualoe_telem.c, are not ours to edit. src/ualoe_lib is the vendored UALoE library, replaced wholesale by the periodic "sync UALoE lib" drops (#9688), which is why that PR excluded `ualoe_lib/` from the rest of the pre-commit suite. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/`, so the checker polices code the next sync will overwrite - a header rewritten here reverts, and the hook breaks again. The missing prefix is added instead. The three files #10402 did rewrite under src/ualoe_lib are left alone; they now fall outside the check and will drift back on their own. Header text and check scope only - no functional change.
corey-derochie-amd
pushed a commit
that referenced
this pull request
Oct 15, 2026
…0845) ## Why #10402 converted every amd-smi source to the two-line SPDX MIT header and added the `amdsmi-license-headers` pre-commit hook to hold the line. **The hook currently fails on `develop` itself**, so every open amd-smi PR is red — including ones that touch none of the offending files. ``` $ git checkout origin/develop $ python3 projects/amdsmi/tests/check_license_headers.py Missing or malformed AMD SPDX license header: src/ualoe_lib/ualoe_nl.c src/ualoe_lib/ualoe_telem.c tests/amd_smi_test/unit/system/status_string_test.cc tests/python/unit/gpu/test_cli_vram_type_lpddr5.py tests/python/unit/system/test_expect_status.py ``` The blast radius is wide because the hook is `pass_filenames: false` and rescans the whole tracked tree. It fires for any PR touching a single amd-smi `.py`/`.cc`/`.txt` and then reports files that PR never went near. #10083 trips it by editing one line of `src/CMakeLists.txt`. ## What The five files fall into two groups with different causes. **Three are amd-smi's own**, and simply landed while #10402 was in review, so its branch never saw them and they arrived with the old twenty-line MIT block. Converted here: | File | Landed via | |---|---| | `tests/amd_smi_test/unit/system/status_string_test.cc` | #10177 | | `tests/python/unit/gpu/test_cli_vram_type_lpddr5.py` | #10775 | | `tests/python/unit/system/test_expect_status.py` | `88dbbe3b93c` | **The other two are not ours to edit.** `src/ualoe_lib/` is the vendored UALoE library, replaced wholesale by the periodic *"sync UALoE lib"* drops — which is exactly why #9688 added `ualoe_lib/` to the pre-commit `exclude:` block, keeping clang-format and the rest off that code. #10402 carried only the `include/ualoe_lib/` half of that exclusion into the checker and left `src/` behind, so the checker now polices code the next sync will overwrite. Rewriting those headers would be reverted by the next drop and the hook would break again, so the missing prefix is added to `EXCLUDE_PREFIX` instead. The three files #10402 did rewrite under `src/ualoe_lib/` are left alone; they now fall outside the check and will drift back on their own at the next sync. Header text and check scope only — no functional change. ## Verification ``` $ python3 projects/amdsmi/tests/check_license_headers.py # exit 0 $ python3 projects/amdsmi/tests/run_amdsmi_license_header_test.py # 6/6 cases $ pre-commit run --config projects/amdsmi/.pre-commit-config.yaml --files <changed> codespell / trailing-whitespace / end-of-file-fixer / merge-conflicts / large-files / mixed-line-ending / clang-format / ruff format / amd-smi C++ test conventions / amd-smi SPDX license headers ....... all Passed ``` Confirmed the two vendored files are byte-identical to `develop` (`git diff origin/develop -- projects/amdsmi/src/ualoe_lib/` is empty), and that the checker skips them when named explicitly. Fixes the `amdsmi-license-headers` hook regression introduced by #10402.
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.
Summary
Standardize AMD-owned source files on the two-line SPDX MIT license header and
add a check-only pre-commit hook so the convention stays consistent.
Header format (uses each file's comment leader):
No per-file year, no
(c), no "All rights reserved", and no per-file MIT block.The full license text stays in
LICENSE.What's in this PR (three logical commits)
.github/CONTRIBUTING.mdwiththe two-line convention and add a "Copyright & License Headers" section to the
style review agent so header drift is flagged in review.
(net -6442 lines of boilerplate). Also fixes the double space in
include/config/amd_smi_config.h.inand updates the wrapper generators(
tools/generator.py,rust-interface/build.rs) so regenerated bindings carrythe same short-form header.
tests/check_license_headers.py, a check-only scanner thatreports offenders and exits non-zero without editing any file, wired into
.pre-commit-config.yamlasamdsmi-license-headers.Excluded (upstream headers kept)
Third-party, vendored E-SMI, kernel UAPI (
amd_hsmp.h,xf86drm.h), Broadcom NICheaders, and the generated wrappers (
py-interface/amdsmi_wrapper.py,rust-interface/src/amdsmi_wrapper.rs). These are confirmed unchanged in the diff.Verification
python3 tests/check_license_headers.pyreports 0 offenders (exit 0).Out of scope
tests/amdsmi_build/test_run_amdsmi_build.pyfailsruff format --checkondevelopas well (pre-existing, unrelated to headers), so it is left untouched.