feat(amdsmi): map amd-smi --version to the version subcommand#8890
Open
marifamd wants to merge 1 commit into
Open
feat(amdsmi): map amd-smi --version to the version subcommand#8890marifamd wants to merge 1 commit into
amd-smi --version to the version subcommand#8890marifamd wants to merge 1 commit into
Conversation
`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>
❌ 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 |
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
amd-smi --versionpreviously raisedAmdSmiInvalidSubcommandException("AMD-SMI Command '--version' is invalid"). Users expect--versionto work like the near-universal CLI convention, so this maps it to the existingversionsubcommand.Technical Details
amdsmi_cli.py, a leading--versionflag (case-insensitive, consistent with the existing--rocm-smihandling) is rewritten to theversionsubcommand before argument parsing. Routing through the realversionsubparser means it inherits full option support (--gpu_version,--cpu_version,--nic_version) with no bespoke handler.metric --version, invalid subcommands, and--helpbehave exactly as before.Verification
Verified against an installed build on an MI-series host:
amd-smi --versionamd-smi --version --gpu_version/--jsonamd-smi --VERSIONamd-smi version(control)amd-smi --bogusamd-smi metric --versionamd-smi --helpUnit Tests
tests/python/cli/test_version.pyaddsamd-smi --versionandamd-smi --version --gpu_versionto the existing version CLI test.Documentation
docs/how-to/amdsmi-cli-tool.md: note that--versionis an alias for theversioncommand.CHANGELOG.md: added entry under Added.JIRA ID
N/A