Skip to content

feat(amdsmi): map amd-smi --version to the version subcommand#8890

Open
marifamd wants to merge 1 commit into
developfrom
users/marifamd/amdsmi-version-flag
Open

feat(amdsmi): map amd-smi --version to the version subcommand#8890
marifamd wants to merge 1 commit into
developfrom
users/marifamd/amdsmi-version-flag

Conversation

@marifamd

Copy link
Copy Markdown
Contributor

Motivation

amd-smi --version previously raised AmdSmiInvalidSubcommandException ("AMD-SMI Command '--version' is invalid"). Users expect --version to work like the near-universal CLI convention, so this maps it to the existing version subcommand.

Technical Details

  • In amdsmi_cli.py, a leading --version flag (case-insensitive, consistent with the existing --rocm-smi handling) is rewritten to the version subcommand before argument parsing. Routing through the real version subparser means it inherits full option support (--gpu_version, --cpu_version, --nic_version) with no bespoke handler.
  • No other command is affected; metric --version, invalid subcommands, and --help behave exactly as before.

Verification

Verified against an installed build on an MI-series host:

Case Result
amd-smi --version full version output (was error before)
amd-smi --version --gpu_version / --json modifiers work through the alias
amd-smi --VERSION case-insensitive
amd-smi version (control) unchanged
amd-smi --bogus still InvalidSubcommandException
amd-smi metric --version still InvalidParameterException (unchanged)
amd-smi --help unchanged

Unit Tests

tests/python/cli/test_version.py adds amd-smi --version and amd-smi --version --gpu_version to the existing version CLI test.

Documentation

  • docs/how-to/amdsmi-cli-tool.md: note that --version is an alias for the version command.
  • CHANGELOG.md: added entry under Added.

JIRA ID

N/A

`amd-smi --version` previously raised an invalid-subcommand error. Treat a leading `--version` flag as the `version` subcommand so it produces the same output, including its `--gpu_version`/`--cpu_version`/`--nic_version` options.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
@marifamd
marifamd requested a review from a team July 20, 2026 22:10
@github-actions github-actions Bot added documentation Improvements or additions to documentation project: amdsmi labels Jul 20, 2026
@therock-pr-bot

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass
📝 PR Title/Description ❌ Fail Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
JIRA ID : TESTAUTO-6039
JIRA ID - #330
JIRA ID #330
JIRA ID (on separate line)
ROCM-25757
ISSUE ID : TESTUTO-3334
ISSUE ID #3334
ISSUE ID - TESTAUTO-3433
ISSUE ID (on separate line)
AIRUNTIME-2352
ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
Closes #10
Fixes octo-org/octo-repo#100
Resolves: #123
#123
https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
Forbidden Files ✅ Pass
🧪 Unit Test ✅ Pass
🔎 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

  • ❌ PR Title/Description

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

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Title/Description

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

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.

1 participant