From bfd480c6baa55ea39a72166857105e25431fef91 Mon Sep 17 00:00:00 2001 From: Bindhiya Kanangot Balakrishnan Date: Fri, 15 Nov 2024 14:44:50 -0600 Subject: [PATCH] [SWDEV-498507] Tool amd-smi could be more case insensitive Modified amdsmi_cli to accept case insensitive arguments if the argument does not start with a single dash(-). Signed-off-by: Bindhiya Kanangot Balakrishnan Change-Id: I1b6320db0afaad0900d5a2049206002c3899fa71 [ROCm/amdsmi commit: fc7e1ddb4a9f00b48ff389a786c46ebf7b458d3f] --- projects/amdsmi/CHANGELOG.md | 19 +++++++++++++++++++ projects/amdsmi/amdsmi_cli/amdsmi_cli.py | 2 ++ 2 files changed, 21 insertions(+) diff --git a/projects/amdsmi/CHANGELOG.md b/projects/amdsmi/CHANGELOG.md index dec23bb3c0..915f52bbd7 100644 --- a/projects/amdsmi/CHANGELOG.md +++ b/projects/amdsmi/CHANGELOG.md @@ -4,6 +4,25 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr ***All information listed below is for reference and subject to change.*** +## amd_smi_lib for ROCm 6.4.0 + +### Added + +### Changed + +### Removed + +### Optimized + +- **Modified `amd-smi` CLI to allow case insensitive arguments if the argument does not begin with a single dash**. + - With this change `amd-smi version` and `amd-smi VERSION` will now yield the same output. + - `amd-smi static --bus` and `amd-smi STATIC --BUS` will produce identical results. + - `amd-smi static -b` and `amd-smi static -B` will still return different results (-b for bus and -B for board). + +### Resolved issues + +### Upcoming changes + ## amd_smi_lib for ROCm 6.3.0 ### Added diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_cli.py b/projects/amdsmi/amdsmi_cli/amdsmi_cli.py index 15fe9051c2..ddec9921bb 100755 --- a/projects/amdsmi/amdsmi_cli/amdsmi_cli.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_cli.py @@ -100,6 +100,8 @@ if __name__ == "__main__": except NameError: logging.debug("argcomplete module not found. Autocomplete will not work.") + sys.argv = [arg.lower() if arg.startswith('--') or not arg.startswith('-') + else arg for arg in sys.argv] args = amd_smi_parser.parse_args(args=None if sys.argv[1:] else ['--help']) # Handle command modifiers before subcommand execution