Skip to content

revert(amdsmi): revert the Python packaging rework (#7913, #7914) - #9339

Merged
WBobby merged 3 commits into
developfrom
users/marifamd/revert-amdsmi-packaging-rework
Jul 27, 2026
Merged

WBobby merged 3 commits into
developfrom
users/marifamd/revert-amdsmi-packaging-rework

Conversation

@marifamd

@marifamd marifamd commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Reverts PR: #7914 , #7913

Description

Reverts the AMD SMI Python packaging rework: the manylinux wheel CI job (#7913) and the packaging rework (#7914, flat loader, dist-packages install, wheel build).

The revert accounts for changes that landed on develop after the rework merged:

  • Keeps the libamd_smi.so.27 SONAME and its CHANGELOG entry from the 27.0.0 version bump. The restored pre-rework loader hardcodes the SONAME, so the literal is bumped from .so.26 to .so.27 in tools/generator.py (the template) and the regenerated amdsmi_wrapper.py to match AMDSMI_LIB_VERSION_MAJOR.
  • Keeps the ras --cper --json no-entries fix (fix(amdsmi): emit valid JSON for ras --cper --json with no entries #8819) and its CHANGELOG entry; only the rework's own CHANGELOG entry is removed.

Restores the pre-rework loader, the pip-based DEBIAN/RPM install scriptlets, and setup.py.in; removes pin_shebang.cmake, tools/disable_system_fallback.py, and tests/python/test_abi_compat.py.

Verification

  • CMake configure: clean (version 27.0.0)
  • make -j: 0 errors, libamd_smi.so.27 and amdsmitst built
  • amdsmi_wrapper.py imports and loads libamd_smi.so.27

JIRA ID

ROCM-3941

marifamd added 2 commits July 27, 2026 17:18
Reverts the manylinux wheel CI job (#7913) and the Python packaging
rework (#7914): flat loader, dist-packages install, and wheel build.
Restores the pre-rework loader in amdsmi_wrapper.py / tools/generator.py,
the pip-based DEBIAN/RPM install scriptlets, and setup.py.in; removes
pin_shebang.cmake, tools/disable_system_fallback.py, and
tests/python/test_abi_compat.py.

Accounts for changes that landed on develop after the rework merged:
- Keeps the libamd_smi.so.27 SONAME and its CHANGELOG entry from the
  27.0.0 version bump. The restored loader hardcoded the SONAME, so the
  literal is bumped from .so.26 to .so.27 in both generator.py and the
  regenerated wrapper to match AMDSMI_LIB_VERSION_MAJOR.
- Keeps the ras --cper --json no-entries fix (#8819) and its CHANGELOG
  entry; only the rework's own CHANGELOG entry is removed.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
The pre-rework loader hardcodes the system-fallback SONAME. After the
revert restores it, bump the literal from libamd_smi.so.26 to
libamd_smi.so.27 in the generator template and the regenerated wrapper
so it matches AMDSMI_LIB_VERSION_MAJOR (bumped to 27 on develop after
the rework merged).

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
@marifamd
marifamd requested a review from a team July 27, 2026 22:33
@marifamd
marifamd requested a review from a team as a code owner July 27, 2026 22:33
@github-actions github-actions Bot added documentation Improvements or additions to documentation project: amdsmi github actions Pull requests that update GitHub Actions code labels Jul 27, 2026
@therock-pr-bot

therock-pr-bot Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass —
📝 PR Title/Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ❌ Fail Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/amdsmi/amdsmi_cli/amdsmi_cli.py, projects/amdsmi/amdsmi_cli/amdsmi_init.py, projects/amdsmi/py-interface/amdsmi_wrapper.py, projects/amdsmi/tests/amdsmi_build/run_amdsmi_build.py, projects/amdsmi/tests/python/common/common.py (+1 more); no test file found
🔎 pre-commit ⏳ Pending ⏳ Still running…
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ Unit Test

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

@therock-pr-bot

therock-pr-bot Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ Unit Test

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@WBobby WBobby left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to revert to fix TheRock bump ROCm/TheRock#6897

…lure

The CI summary scanned amd-smi command logs for the substring "Error
code:" and marked the command failed. Under --loglevel debug the CLI
prints that string for unsupported-feature paths (e.g. a missing vclk
reading), so metric was reported as a non-fatal failure on hardware that
ran the command successfully.

Match only a same-line "Error code: <rc>" (space + digit), which is what
the workflow appends on a real non-zero exit; the CLI wraps its status
code onto the next line, so it no longer trips the scanner.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
@WBobby
WBobby merged commit 116972a into develop Jul 27, 2026
31 of 32 checks passed
@WBobby
WBobby deleted the users/marifamd/revert-amdsmi-packaging-rework branch July 27, 2026 23:20
lamikr pushed a commit that referenced this pull request Jul 28, 2026
Relands the manylinux wheel CI job (#7913) and the Python packaging rework
(#7914) after they were reverted in #9339, together with the follow-up
amd-smi CLI shebang fixes so the rework and its corrections land as one
change.

Packaging rework (reintroduced):
- Install the amdsmi module into the system python's site-packages via
  install(DIRECTORY) instead of pip + a .pth file; drop the pip plumbing and
  python3-pip/setuptools/wheel deps from the DEBIAN/RPM scriptlets.
- Replace the ROCm-path-walking resolver in amdsmi_wrapper.py (and
  tools/generator.py, regenerated in lockstep) with a flat loader:
  AMDSMI_LIB_OVERRIDE, a bundled libamd_smi_python.so, then the system
  libamd_smi.so; a _MissingLibrary sentinel keeps import tolerant.
- Add BUILD_PYTHON_WHEEL (default OFF): build a SONAME-isolated
  libamd_smi_python.so and a wheel that disables the loader's system fallback.
- Stage the module under share/amd_smi for ROCM_PATH consumers and TheRock.
- Add test_abi_compat.py and the manylinux wheel CI job.

CLI shebang fixes:
- Use a portable "#!/usr/bin/env python3" shebang for the amd-smi CLI so it
  runs on relocatable installs with no /usr/bin/python3 (TheRock containers)
  and on wheel runners where /usr/bin/python3 lacks the amdsmi module.
- Stop pinning the CLI shebang to a fixed interpreter: remove pin_shebang.cmake
  and the AMDSMI_CLI_SHEBANG_INTERP derivation. The pinned absolute path became
  a hard RPM "Requires:" (e.g. /usr/libexec/platform-python3.6) that RHEL10 and
  SLES16 could not satisfy; the RPM now depends only on python(abi).
- Resolve the env-form shebang in the install-verify harness instead of running
  "/usr/bin/env -c".

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
@amd-chiranjeevi amd-chiranjeevi added the bump-pr-revert PR reverted which blocked the rocm-systems promotion label Jul 29, 2026
marifamd added a commit that referenced this pull request Aug 8, 2026
Relands the manylinux wheel CI job (#7913) and the Python packaging rework
(#7914) after they were reverted in #9339, together with the follow-up
amd-smi CLI shebang fixes so the rework and its corrections land as one
change.

Packaging rework (reintroduced):
- Install the amdsmi module into the system python's site-packages via
  install(DIRECTORY) instead of pip + a .pth file; drop the pip plumbing and
  python3-pip/setuptools/wheel deps from the DEBIAN/RPM scriptlets.
- Replace the ROCm-path-walking resolver in amdsmi_wrapper.py (and
  tools/generator.py, regenerated in lockstep) with a flat loader:
  AMDSMI_LIB_OVERRIDE, a bundled libamd_smi_python.so, then the system
  libamd_smi.so; a _MissingLibrary sentinel keeps import tolerant.
- Add BUILD_PYTHON_WHEEL (default OFF): build a SONAME-isolated
  libamd_smi_python.so and a wheel that disables the loader's system fallback.
- Stage the module under share/amd_smi for ROCM_PATH consumers and TheRock.
- Add test_abi_compat.py and the manylinux wheel CI job.

CLI shebang fixes:
- Use a portable "#!/usr/bin/env python3" shebang for the amd-smi CLI so it
  runs on relocatable installs with no /usr/bin/python3 (TheRock containers)
  and on wheel runners where /usr/bin/python3 lacks the amdsmi module.
- Stop pinning the CLI shebang to a fixed interpreter: remove pin_shebang.cmake
  and the AMDSMI_CLI_SHEBANG_INTERP derivation. The pinned absolute path became
  a hard RPM "Requires:" (e.g. /usr/libexec/platform-python3.6) that RHEL10 and
  SLES16 could not satisfy; the RPM now depends only on python(abi).
- Resolve the env-form shebang in the install-verify harness instead of running
  "/usr/bin/env -c".

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump-pr-revert PR reverted which blocked the rocm-systems promotion documentation Improvements or additions to documentation github actions Pull requests that update GitHub Actions code Not ready to Review organization: ROCm project: amdsmi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants