From eb9116e8c25772edaced4cdb3f4f4566252a59ec Mon Sep 17 00:00:00 2001 From: gabrpham Date: Tue, 1 Oct 2024 16:41:58 -0500 Subject: [PATCH] [SWDEV-486872] Removed '--ras' from static command when platform is VM Signed-off-by: gabrpham Change-Id: I0b03f168d7011428cfea3ab303865f4eaeea78ac --- CHANGELOG.md | 3 +++ amdsmi_cli/amdsmi_commands.py | 11 ++++++----- amdsmi_cli/amdsmi_parser.py | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3caaedcd35..ad3bd0a1de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -571,6 +571,9 @@ GPU: 0 - **Removed usage of _validate_positive in Parser and replaced with _positive_int and _not_negative_int as appropriate**. - This will allow 0 to be a valid input for several options in setting CPUs where appropriate (for example, as a mode or NBIOID) +- **Removed `--ras` option from `amd-smi static` command in Guest environments** + - VMs don't have permission from Hosts to obtain RAS information, so this option was made invalid on Guest environments. + ### Optimizations - **Adjusted ordering of gpu_metrics calls to ensure that pcie_bw values remain stable in `amd-smi metric` & `amd-smi monitor`**. diff --git a/amdsmi_cli/amdsmi_commands.py b/amdsmi_cli/amdsmi_commands.py index 8e450d2c3d..7e25d2f075 100644 --- a/amdsmi_cli/amdsmi_commands.py +++ b/amdsmi_cli/amdsmi_commands.py @@ -311,8 +311,6 @@ class AMDSMICommands(): args.board = board if driver: args.driver = driver - if ras: - args.ras = ras if vram: args.vram = vram if cache: @@ -321,12 +319,14 @@ class AMDSMICommands(): args.process_isolation = process_isolation # Store args that are applicable to the current platform - current_platform_args = ["asic", "bus", "vbios", "driver", "ras", + current_platform_args = ["asic", "bus", "vbios", "driver", "vram", "cache", "board", "process_isolation"] - current_platform_values = [args.asic, args.bus, args.vbios, args.driver, args.ras, + current_platform_values = [args.asic, args.bus, args.vbios, args.driver, args.vram, args.cache, args.board, args.process_isolation] if self.helpers.is_linux() and self.helpers.is_baremetal(): + if ras: + args.ras = ras if partition: args.partition = partition if limit: @@ -336,7 +336,8 @@ class AMDSMICommands(): if xgmi_plpd: args.xgmi_plpd = xgmi_plpd current_platform_args += ["ras", "limit", "partition", "soc_pstate", "xgmi_plpd"] - current_platform_values += [args.ras, args.limit, args.partition, args.soc_pstate, args.xgmi_plpd] + current_platform_values += [args.ras, args.limit, args.partition, + args.soc_pstate, args.xgmi_plpd] if self.helpers.is_linux() and not self.helpers.is_virtual_os(): if numa: diff --git a/amdsmi_cli/amdsmi_parser.py b/amdsmi_cli/amdsmi_parser.py index 2ef524fc31..4f8ace7a70 100644 --- a/amdsmi_cli/amdsmi_parser.py +++ b/amdsmi_cli/amdsmi_parser.py @@ -635,10 +635,10 @@ class AMDSMIParser(argparse.ArgumentParser): static_parser.add_argument('-c', '--cache', action='store_true', required=False, help=cache_help) static_parser.add_argument('-B', '--board', action='store_true', required=False, help=board_help) static_parser.add_argument('-R', '--process-isolation', action='store_true', required=False, help=process_isolation_help) - static_parser.add_argument('-r', '--ras', action='store_true', required=False, help=ras_help) # Options to display on Hypervisors and Baremetal if self.helpers.is_hypervisor() or self.helpers.is_baremetal(): + static_parser.add_argument('-r', '--ras', action='store_true', required=False, help=ras_help) static_parser.add_argument('-p', '--partition', action='store_true', required=False, help=partition_help) static_parser.add_argument('-l', '--limit', action='store_true', required=False, help=limit_help) static_parser.add_argument('-P', '--soc-pstate', action='store_true', required=False, help=soc_pstate_help)