Skip to content

SWDEV-545953 - Tests for hipStreamGetId - #529

Merged
satyanveshd merged 5 commits into
developfrom
import/develop/ROCm_hip-tests/pr-491
Aug 29, 2025
Merged

satyanveshd merged 5 commits into
developfrom
import/develop/ROCm_hip-tests/pr-491

Conversation

@systems-assistant

Copy link
Copy Markdown
Contributor

SWDEV-545953

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Continuous Integration

What were the changes?

Added the basic sanity tests for hipStreamGetId API.

Updated CHANGELOG?

  • Yes
  • No, Does not apply to this PR.

Added/Updated documentation?

  • Yes
  • No, Does not apply to this PR.

Additional Checks

  • I have added tests relevant to the introduced functionality, and the unit tests are passing locally.
  • Any dependent changes have been merged.

🔁 Imported from ROCm/hip-tests#491
🧑‍💻 Originally authored by @rocm-devops

SwRaw pushed a commit that referenced this pull request Aug 19, 2025
* Fix data race by syncing reader and writer

* Address review comments

[ROCm/rocprofiler-sdk commit: fc3eb42]
@jainprad

Copy link
Copy Markdown
Contributor

!verify

@swargamrambabu
swargamrambabu requested review from a team as code owners August 20, 2025 11:37
@satyanveshd
satyanveshd force-pushed the import/develop/ROCm_hip-tests/pr-491 branch from 5952c2f to 3619dbb Compare August 26, 2025 08:30

@mangupta mangupta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reapproving previously approved PR from before migration

@ammallya ammallya closed this Aug 27, 2025
@ammallya ammallya reopened this Aug 27, 2025
@satyanveshd
satyanveshd merged commit 4174508 into develop Aug 29, 2025
@satyanveshd
satyanveshd deleted the import/develop/ROCm_hip-tests/pr-491 branch August 29, 2025 10:37
systems-assistant Bot pushed a commit to ROCm/hip-tests that referenced this pull request Aug 29, 2025
Co-authored-by: Satyanvesh Dittakavi <Satyanvesh.Dittakavi@amd.com>
Co-authored-by: ammallya <ameyakeshava.mallya@amd.com>
Co-authored-by: swargamrambabu <rambabu.swargam@amd.com>
Co-authored-by: jainprad <92369414+jainprad@users.noreply.github.com>
[rocm-systems] ROCm/rocm-systems#529 (commit 4174508)
jharryma pushed a commit that referenced this pull request Sep 12, 2025
* Fix data race by syncing reader and writer

* Address review comments
ammallya pushed a commit that referenced this pull request Nov 17, 2025
…ition still available) + CLI API call cleanup (#529)

Updates:
- Separate extra APIs calls from amd-smi CLI to target specific CLI commands that need them.
- Remove extra current_compute_partition SYSFS calls from amd-smi static.
- Remove the partition information from the default `amd-smi static` CLI command.
- Users must now use the `-p` argument to view partition information with `amd-smi static`.
- The help text for the `partition` argument has been updated to reflect this change.
- The partition information can still be accessed using the `amd-smi partition -c -m` or `sudo amd-smi partition -a` commands.

---------

Signed-off-by: Charis Poag <Charis.Poag@amd.com>
ammallya pushed a commit that referenced this pull request Nov 18, 2025
…ition still available) + CLI API call cleanup (#529)

Updates:
- Separate extra APIs calls from amd-smi CLI to target specific CLI commands that need them.
- Remove extra current_compute_partition SYSFS calls from amd-smi static.
- Remove the partition information from the default `amd-smi static` CLI command.
- Users must now use the `-p` argument to view partition information with `amd-smi static`.
- The help text for the `partition` argument has been updated to reflect this change.
- The partition information can still be accessed using the `amd-smi partition -c -m` or `sudo amd-smi partition -a` commands.

---------

Signed-off-by: Charis Poag <Charis.Poag@amd.com>

[ROCm/amdsmi commit: 88473b7]
ammallya pushed a commit that referenced this pull request Nov 21, 2025
…ition still available) + CLI API call cleanup (#529)

Updates:
- Separate extra APIs calls from amd-smi CLI to target specific CLI commands that need them.
- Remove extra current_compute_partition SYSFS calls from amd-smi static.
- Remove the partition information from the default `amd-smi static` CLI command.
- Users must now use the `-p` argument to view partition information with `amd-smi static`.
- The help text for the `partition` argument has been updated to reflect this change.
- The partition information can still be accessed using the `amd-smi partition -c -m` or `sudo amd-smi partition -a` commands.

---------

Signed-off-by: Charis Poag <Charis.Poag@amd.com>

[ROCm/amdsmi commit: 88473b7]
jrmadsen added a commit that referenced this pull request Dec 17, 2025
- PR #529 (in rocprofiler-sdk-internal) introduced waiting on the syncer flag when emplacing in a buffer to prevent the overwriting buffer records currently being processed in a buffer flush callback
- The above fix introduced a block on the both buffers when a buffer flush callback was being executed instead of a block on the buffer being flushed.
jrmadsen added a commit that referenced this pull request Jan 6, 2026
…ion (#2334)

* Fix buffer tracing synchronization lock

- PR #529 (in rocprofiler-sdk-internal) introduced waiting on the syncer flag when emplacing in a buffer to prevent the overwriting buffer records currently being processed in a buffer flush callback
- The above fix introduced a block on the both buffers when a buffer flush callback was being executed instead of a block on the buffer being flushed.

* Add rocpd tests for duplicate records

* Address code review comments
ammallya pushed a commit that referenced this pull request Jan 30, 2026
…PPS id. We should not assign the current active PPS id to an invalid value. (#529)
ammallya pushed a commit that referenced this pull request Jan 30, 2026
…PPS id. We should not assign the current active PPS id to an invalid value. (#529)

[ROCm/rocdecode commit: ac74540]
kcossett-amd added a commit that referenced this pull request Jul 20, 2026
## Motivation

<!-- Explain the purpose of this PR and the goals it aims to achieve.
-->

`ROCprofiler-SDK`'s #6276 has made a CI warning that would previously
crash some `selective-region` tests non-fatal.
Now we can re-enable the remaining tests.

## Technical Details

Remove the following from the common TheRock exclusion list on `gfx950`
workflow AND `test_categories.yaml`:
```
selective-region-region-1-filter.*
selective-region-region-2-and-3.*
selective-region-no-marker-region-1-filter.*
```

<!-- 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 -->

Jira ID: AIPROFSYST-521

## Test Plan

<!-- Explain any relevant testing done to verify this PR. -->

Workflows + TheRock CI

## Test Result

<!-- Briefly summarize test outcomes. -->

`gfx950` tests pass:
https://github.com/ROCm/rocm-systems/actions/runs/29582264277/job/87890685718?pr=8759

TheRock CI tests pass:
https://github.com/ROCm/rocm-systems/actions/runs/29584647543/job/87915973657?pr=8759
```
        Start 488: selective-region-no-filter-start-stop-sys-run
355/473 Test #488: selective-region-no-filter-start-stop-sys-run ...................................................................................................................................   Passed    6.85 sec
        Start 489: selective-region-no-filter-start-stop-sampling
356/473 Test #489: selective-region-no-filter-start-stop-sampling ..................................................................................................................................   Passed    6.80 sec
        Start 490: selective-region-no-filter-push-pop-sys-run
357/473 Test #490: selective-region-no-filter-push-pop-sys-run .....................................................................................................................................   Passed    6.82 sec
        Start 491: selective-region-no-filter-push-pop-sampling
358/473 Test #491: selective-region-no-filter-push-pop-sampling ....................................................................................................................................   Passed    6.82 sec
        Start 492: selective-region-region-1-filter-start-stop-sys-run
359/473 Test #492: selective-region-region-1-filter-start-stop-sys-run .............................................................................................................................   Passed    6.09 sec
        Start 493: selective-region-region-1-filter-start-stop-sampling
360/473 Test #493: selective-region-region-1-filter-start-stop-sampling ............................................................................................................................   Passed    6.11 sec
        Start 494: selective-region-region-1-filter-push-pop-sys-run
361/473 Test #494: selective-region-region-1-filter-push-pop-sys-run ...............................................................................................................................   Passed    6.12 sec
        Start 495: selective-region-region-1-filter-push-pop-sampling
362/473 Test #495: selective-region-region-1-filter-push-pop-sampling ..............................................................................................................................   Passed    6.12 sec
        Start 496: selective-region-region-2-and-3-filter-start-stop-sys-run
363/473 Test #496: selective-region-region-2-and-3-filter-start-stop-sys-run .......................................................................................................................   Passed    5.93 sec
        Start 497: selective-region-region-2-and-3-filter-start-stop-sampling
364/473 Test #497: selective-region-region-2-and-3-filter-start-stop-sampling ......................................................................................................................   Passed    5.94 sec
        Start 498: selective-region-region-2-and-3-filter-push-pop-sys-run
365/473 Test #498: selective-region-region-2-and-3-filter-push-pop-sys-run .........................................................................................................................   Passed    5.93 sec
        Start 499: selective-region-region-2-and-3-filter-push-pop-sampling
366/473 Test #499: selective-region-region-2-and-3-filter-push-pop-sampling ........................................................................................................................   Passed    5.95 sec
        Start 500: selective-region-pause-no-filter-inside-start-stop-sys-run
367/473 Test #500: selective-region-pause-no-filter-inside-start-stop-sys-run ......................................................................................................................   Passed    4.79 sec
        Start 501: selective-region-pause-no-filter-inside-start-stop-sampling
368/473 Test #501: selective-region-pause-no-filter-inside-start-stop-sampling .....................................................................................................................   Passed    4.76 sec
        Start 502: selective-region-pause-no-filter-inside-push-pop-sys-run
369/473 Test #502: selective-region-pause-no-filter-inside-push-pop-sys-run ........................................................................................................................   Passed    4.80 sec
        Start 503: selective-region-pause-no-filter-inside-push-pop-sampling
370/473 Test #503: selective-region-pause-no-filter-inside-push-pop-sampling .......................................................................................................................   Passed    4.80 sec
        Start 504: selective-region-pause-no-filter-before-start-stop-sys-run
371/473 Test #504: selective-region-pause-no-filter-before-start-stop-sys-run ......................................................................................................................   Passed    4.80 sec
        Start 505: selective-region-pause-no-filter-before-start-stop-sampling
372/473 Test #505: selective-region-pause-no-filter-before-start-stop-sampling .....................................................................................................................   Passed    4.81 sec
        Start 506: selective-region-pause-no-filter-before-push-pop-sys-run
373/473 Test #506: selective-region-pause-no-filter-before-push-pop-sys-run ........................................................................................................................   Passed    4.79 sec
        Start 507: selective-region-pause-no-filter-before-push-pop-sampling
374/473 Test #507: selective-region-pause-no-filter-before-push-pop-sampling .......................................................................................................................   Passed    4.79 sec
        Start 508: selective-region-pause-no-filter-outside-start-stop-sys-run
375/473 Test #508: selective-region-pause-no-filter-outside-start-stop-sys-run .....................................................................................................................   Passed    4.81 sec
        Start 509: selective-region-pause-no-filter-outside-start-stop-sampling
376/473 Test #509: selective-region-pause-no-filter-outside-start-stop-sampling ....................................................................................................................   Passed    4.77 sec
        Start 510: selective-region-pause-no-filter-outside-push-pop-sys-run
377/473 Test #510: selective-region-pause-no-filter-outside-push-pop-sys-run .......................................................................................................................   Passed    4.82 sec
        Start 511: selective-region-pause-no-filter-outside-push-pop-sampling
378/473 Test #511: selective-region-pause-no-filter-outside-push-pop-sampling ......................................................................................................................   Passed    4.81 sec
        Start 512: selective-region-pause-filtered-inside-start-stop-sys-run
379/473 Test #512: selective-region-pause-filtered-inside-start-stop-sys-run .......................................................................................................................   Passed    4.55 sec
        Start 513: selective-region-pause-filtered-inside-start-stop-sampling
380/473 Test #513: selective-region-pause-filtered-inside-start-stop-sampling ......................................................................................................................   Passed    4.67 sec
        Start 514: selective-region-pause-filtered-inside-push-pop-sys-run
381/473 Test #514: selective-region-pause-filtered-inside-push-pop-sys-run .........................................................................................................................   Passed    4.55 sec
        Start 515: selective-region-pause-filtered-inside-push-pop-sampling
382/473 Test #515: selective-region-pause-filtered-inside-push-pop-sampling ........................................................................................................................   Passed    4.54 sec
        Start 516: selective-region-pause-filtered-before-start-stop-sys-run
383/473 Test #516: selective-region-pause-filtered-before-start-stop-sys-run .......................................................................................................................   Passed    4.53 sec
        Start 517: selective-region-pause-filtered-before-start-stop-sampling
384/473 Test #517: selective-region-pause-filtered-before-start-stop-sampling ......................................................................................................................   Passed    4.57 sec
        Start 518: selective-region-pause-filtered-before-push-pop-sys-run
385/473 Test #518: selective-region-pause-filtered-before-push-pop-sys-run .........................................................................................................................   Passed    4.53 sec
        Start 519: selective-region-pause-filtered-before-push-pop-sampling
386/473 Test #519: selective-region-pause-filtered-before-push-pop-sampling ........................................................................................................................   Passed    4.68 sec
        Start 520: selective-region-pause-filtered-outside-start-stop-sys-run
387/473 Test #520: selective-region-pause-filtered-outside-start-stop-sys-run ......................................................................................................................   Passed    4.53 sec
        Start 521: selective-region-pause-filtered-outside-start-stop-sampling
388/473 Test #521: selective-region-pause-filtered-outside-start-stop-sampling .....................................................................................................................   Passed    4.56 sec
        Start 522: selective-region-pause-filtered-outside-push-pop-sys-run
389/473 Test #522: selective-region-pause-filtered-outside-push-pop-sys-run ........................................................................................................................   Passed    4.55 sec
        Start 523: selective-region-pause-filtered-outside-push-pop-sampling
390/473 Test #523: selective-region-pause-filtered-outside-push-pop-sampling .......................................................................................................................   Passed    4.52 sec
        Start 524: selective-region-pause-no-marker-inside-start-stop-sys-run
391/473 Test #524: selective-region-pause-no-marker-inside-start-stop-sys-run ......................................................................................................................   Passed    3.37 sec
        Start 525: selective-region-pause-no-marker-inside-start-stop-sampling
392/473 Test #525: selective-region-pause-no-marker-inside-start-stop-sampling .....................................................................................................................   Passed    3.46 sec
        Start 526: selective-region-pause-no-marker-inside-push-pop-sys-run
393/473 Test #526: selective-region-pause-no-marker-inside-push-pop-sys-run ........................................................................................................................   Passed    3.35 sec
        Start 527: selective-region-pause-no-marker-inside-push-pop-sampling
394/473 Test #527: selective-region-pause-no-marker-inside-push-pop-sampling .......................................................................................................................   Passed    3.52 sec
        Start 528: selective-region-pause-no-marker-before-start-stop-sys-run
395/473 Test #528: selective-region-pause-no-marker-before-start-stop-sys-run ......................................................................................................................   Passed    3.40 sec
        Start 529: selective-region-pause-no-marker-before-start-stop-sampling
396/473 Test #529: selective-region-pause-no-marker-before-start-stop-sampling .....................................................................................................................   Passed    3.36 sec
        Start 530: selective-region-pause-no-marker-before-push-pop-sys-run
397/473 Test #530: selective-region-pause-no-marker-before-push-pop-sys-run ........................................................................................................................   Passed    3.37 sec
        Start 531: selective-region-pause-no-marker-before-push-pop-sampling
398/473 Test #531: selective-region-pause-no-marker-before-push-pop-sampling .......................................................................................................................   Passed    3.36 sec
        Start 532: selective-region-pause-no-marker-outside-start-stop-sys-run
399/473 Test #532: selective-region-pause-no-marker-outside-start-stop-sys-run .....................................................................................................................   Passed    3.35 sec
        Start 533: selective-region-pause-no-marker-outside-start-stop-sampling
400/473 Test #533: selective-region-pause-no-marker-outside-start-stop-sampling ....................................................................................................................   Passed    3.39 sec
        Start 534: selective-region-pause-no-marker-outside-push-pop-sys-run
401/473 Test #534: selective-region-pause-no-marker-outside-push-pop-sys-run .......................................................................................................................   Passed    3.49 sec
        Start 535: selective-region-pause-no-marker-outside-push-pop-sampling
402/473 Test #535: selective-region-pause-no-marker-outside-push-pop-sampling ......................................................................................................................   Passed    3.51 sec
        Start 536: selective-region-no-marker-region-1-filter-start-stop-sys-run
403/473 Test #536: selective-region-no-marker-region-1-filter-start-stop-sys-run ...................................................................................................................   Passed    4.81 sec
        Start 537: selective-region-no-marker-region-1-filter-start-stop-sampling
404/473 Test #537: selective-region-no-marker-region-1-filter-start-stop-sampling ..................................................................................................................   Passed    4.82 sec
```

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md.
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>
marifamd pushed a commit that referenced this pull request Oct 13, 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.

"# 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 13, 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.

"# 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 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants