From 3794b3796cc93a2fb4976b19002650763f1cf59b Mon Sep 17 00:00:00 2001 From: Bindhiya Kanangot Balakrishnan Date: Thu, 5 Dec 2024 19:34:39 -0600 Subject: [PATCH] [SWDEV-457845] Error code unification for amd-smi set Earlier amd-smi set was returning different outputs in Linux and Windows. In Linux it was returning ValueError. As part of Error Code unification, corrected this output message. Signed-off-by: Bindhiya Kanangot Balakrishnan Change-Id: Iba9ddd9c5b2bed0456f303e4373f6771c93608be [ROCm/amdsmi commit: 1586005a5b10119e84fe6f7756a7455fd09c34d9] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index 1632d6a6fc..9c3ec17dbe 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -4318,6 +4318,18 @@ class AMDSMICommands(): core_args_enabled = True break + # Error if no subcommand args are passed + if self.helpers.is_baremetal(): + if not any([args.gpu, args.fan, args.perf_level, args.profile, args.perf_determinism, \ + args.compute_partition, args.memory_partition, args.power_cap,\ + args.soc_pstate, args.xgmi_plpd, args.clk_limit, args.process_isolation]): + command = " ".join(sys.argv[1:]) + raise AmdSmiRequiredCommandException(command, self.logger.format) + else: + if not any([args.clean_local_data]): + command = " ".join(sys.argv[1:]) + raise AmdSmiRequiredCommandException(command, self.logger.format) + # Only allow one device's arguments to be set at a time if not any([gpu_args_enabled, cpu_args_enabled, core_args_enabled]): raise ValueError('No GPU, CPU, or CORE arguments provided, specific arguments are needed')