[SWDEV-540665] Power cap on 1VF cli parsing fix

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
Change-Id: I5aac8f820fd8ae1c6c1dbae3b5b9e69018c69452


[ROCm/amdsmi commit: e030f71229]
This commit is contained in:
Maisam Arif
2025-08-22 15:02:16 -05:00
gecommit door Pham, Gabriel
bovenliggende 588cf7d0c2
commit a68cd9612a
2 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
@@ -5059,7 +5059,7 @@ class AMDSMICommands():
command = " ".join(sys.argv[1:])
raise AmdSmiRequiredCommandException(command, self.logger.format)
else:
if not any([args.process_isolation is not None, args.clk_limit is not None]):
if not any([args.process_isolation is not None, args.clk_limit is not None, args.power_cap is not None]):
command = " ".join(sys.argv[1:])
raise AmdSmiRequiredCommandException(command, self.logger.format)
@@ -1237,7 +1237,7 @@ class AMDSMIParser(argparse.ArgumentParser):
power_cap_min = str(power_cap_min) + ' W'
set_power_cap_help = f"Set power capacity limit:\n\tmin cap: {power_cap_min}, max cap: {power_cap_max}"
set_clk_limit_help = "Sets the sclk (aka gfxclk) or mclk minimum and maximum frequencies. \n\tex: amd-smi set -L (sclk | mclk) (min | max) value"
set_process_isolation_help = "Enable or disable the GPU process isolation on a per partition basis: 0 for disable and 1 for enable.\n"
set_process_isolation_help = "Enable or disable the GPU process isolation on a per partition basis:\n 0 for disable and 1 for enable.\n"
# Help text for CPU set options
set_cpu_pwr_limit_help = "Set power limit for the given socket. Input parameter is power limit value."
@@ -1274,7 +1274,7 @@ class AMDSMIParser(argparse.ArgumentParser):
required=False, help=set_compute_partition_help, metavar=('TYPE/INDEX'))
set_value_exclusive_group.add_argument('-M', '--memory-partition', action='store', choices=self.helpers.get_memory_partition_types(), type=str.upper, required=False, help=set_memory_partition_help, metavar='PARTITION')
# Power cap is enabled on guest, maintain order
set_value_exclusive_group.add_argument('-o', '--power-cap', action='store', type=lambda value: self._positive_int(value, '--power-cap'), required=False, help=set_power_cap_help, metavar='WATTS')
set_value_exclusive_group.add_argument('-o', '--power-cap', action='store', type=lambda value: self._not_negative_int(value, '--power-cap'), required=False, help=set_power_cap_help, metavar='WATTS')
if self.helpers.is_baremetal():
set_value_exclusive_group.add_argument('-p', '--soc-pstate', action='store', required=False, type=lambda value: self._not_negative_int(value, '--soc-pstate'), help=set_soc_pstate_help, metavar='POLICY_ID')
set_value_exclusive_group.add_argument('-x', '--xgmi-plpd', action='store', required=False, type=lambda value: self._not_negative_int(value, '--xgmi-plpd'), help=set_xgmi_plpd_help, metavar='POLICY_ID')