Cherry-pick AMDSMI commits into ROCm 10.0 - #9734
Open
marbre wants to merge 3 commits into
Open
Conversation
marbre
marked this pull request as ready for review
August 5, 2026 20:32
astyrrian1
approved these changes
Aug 6, 2026
HereThereBeDragons
approved these changes
Aug 6, 2026
marifamd
approved these changes
Aug 7, 2026
This was referenced Aug 7, 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>
…7912) Add tests/run_amdsmi_pkg_conflict_test.py, which asserts that two AMD SMI packages built with different SOVERSIONs do not co-own the same libamd_smi.so.<major>, so installing one over the other cannot silently break the other's loader. Wire the ABI-compat output into the build harness: summarize_results in run_amdsmi_build.py now scans abi_compat_output.txt alongside the existing integration/unit/perf test outputs so an ABI regression surfaces in the CI summary. Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
…rework (#9033) ## Description Correctness and coverage follow-ups to the AMD SMI Python packaging rework (relanded in #9340). This branch is the packaging-hardening layer on top of the SONAME conflict test + build harness (#7912). Rebased onto `develop` after #7912 and #9340 merged; the now-upstream shebang and self-locate-loader commits were dropped, and the surviving relocatable-loader change was reconciled with develop's version (keeps develop's `len(parents) > 3` guard and adds a `try/except OSError` fall-through so a present-but-unloadable relocatable library does not shadow the system SONAME). ### Loader / wrapper - Fall through to the system library when the relocatable TheRock library exists but fails to load (missing deps). - Dedupe the wrapper `_libraries` init (the ctypesgen preamble already initializes it). - Read and write the staged wrapper as UTF-8 in `disable_system_fallback.py` so the wheel flag flip is deterministic regardless of build locale; make the staging idempotent so a rebuild that reuses the flipped copy succeeds. ### Packaging correctness - Stop the RPM from co-owning system Python directories. - Restrict package `preun`/`prerm` cleanup to a full erase (not upgrades). - Quote the install prefix when writing `ld.so.conf.d` on RPM. - Pin permissions on the installed Python module; make the operational log group-writable (not world-writable) and stop the logger from restoring world-writable permissions. - Only strip release libraries when a strip tool is available; fail the build when the system `python3` cannot be detected. ### Wheel build - Build one wheel per platform (not per interpreter), tag it `manylinux_2_28`, and verify the bundled `.so`. - Use a clean PyPI version and expose the commit as metadata. - Reject regenerating the wrapper against the wheel library; skip the system site-packages install for wheel builds. ### Tests - Loader-contract tests in `test_abi_compat.py`: preferred bundled `.so`, wheel refuses system fallback when the bundle is missing, the relocatable OSError fall-through, and an ambiguous-wrapper hard failure. Assert the idempotent no-op in the fallback double-run guard. - Guard against drift between the two installed module copies; install the dual-copy runner so its guard tests run in CI; run the wheel install-location check without a GPU. ### Verification - `cmake -DBUILD_TESTS=ON` + `make`: 0 errors, `libamd_smi.so.27` + `amdsmitst` built. - `test_abi_compat.py` (10) and `test_dual_copy_guard.py` (4): all pass. ## JIRA ID ROCM-3941 --------- Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
marifamd
force-pushed
the
users/marbre/therock-10.0-AIRDEL-17
branch
from
August 8, 2026 17:51
36175f9 to
91aea1d
Compare
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
Cherry-picks amdsmi commits into the ROCm 10.0 release branch.
Technical Details
Issue Tracking
JIRA ID: AIRDEL-17