[SWDEV-541289] Update violation argument in amd-smi (#526)
* Disabled violation argument for monitor on guests as it is supported on BM only. * Added `-v` and `--violation` args to metric along with `throttle` due to legacy behavior. * Supressed metric throttle arg and do not show in help text --------- Signed-off-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com>
This commit is contained in:
committed by
GitHub
parent
514517e536
commit
f6b854b4ed
@@ -1465,7 +1465,7 @@ class AMDSMICommands():
|
||||
guest_data (bool, optional): Value override for args.guest_data. Defaults to None.
|
||||
fb_usage (bool, optional): Value override for args.fb_usage. Defaults to None.
|
||||
xgmi (bool, optional): Value override for args.xgmi. Defaults to None.
|
||||
throttle (bool, optional): Value override for args.throttle. Defaults to None.
|
||||
throttle (bool, optional): Value override for args.violation. Defaults to None.
|
||||
|
||||
Raises:
|
||||
IndexError: Index error if gpu list is empty
|
||||
@@ -1527,11 +1527,11 @@ class AMDSMICommands():
|
||||
if energy:
|
||||
args.energy = energy
|
||||
if throttle:
|
||||
args.throttle = throttle
|
||||
args.violation = throttle
|
||||
current_platform_args += ["fan", "voltage_curve", "overdrive", "perf_level",
|
||||
"xgmi_err", "energy", "throttle"]
|
||||
current_platform_values += [args.fan, args.voltage_curve, args.overdrive,
|
||||
args.perf_level, args.xgmi_err, args.energy, args.throttle,
|
||||
args.perf_level, args.xgmi_err, args.energy, args.violation,
|
||||
]
|
||||
|
||||
if self.helpers.is_hypervisor():
|
||||
@@ -2556,7 +2556,7 @@ class AMDSMICommands():
|
||||
|
||||
values_dict['mem_usage'] = memory_usage
|
||||
if "throttle" in current_platform_args:
|
||||
if args.throttle:
|
||||
if args.violation:
|
||||
throttle_status = {
|
||||
# Current values - counter/accumulated
|
||||
'accumulation_counter': "N/A",
|
||||
@@ -5323,8 +5323,9 @@ class AMDSMICommands():
|
||||
args.pcie = pcie
|
||||
if process:
|
||||
args.process = process
|
||||
if violation:
|
||||
args.violation = violation
|
||||
if not self.helpers.is_virtual_os():
|
||||
if violation:
|
||||
args.violation = violation
|
||||
|
||||
# Handle No GPU passed
|
||||
if args.gpu == None:
|
||||
|
||||
@@ -994,7 +994,8 @@ class AMDSMIParser(argparse.ArgumentParser):
|
||||
metric_parser.add_argument('-l', '--perf-level', action='store_true', required=False, help=perf_level_help)
|
||||
metric_parser.add_argument('-x', '--xgmi-err', action='store_true', required=False, help=xgmi_err_help)
|
||||
metric_parser.add_argument('-E', '--energy', action='store_true', required=False, help=energy_help)
|
||||
metric_parser.add_argument('-T', '--throttle', action='store_true', required=False, help=throttle_help)
|
||||
metric_parser.add_argument('-v', '--violation', action='store_true', required=False, help=throttle_help)
|
||||
metric_parser.add_argument('-T', '--throttle', dest='violation', action='store_true', required=False, help=argparse.SUPPRESS)
|
||||
|
||||
# Options to only display to Hypervisors
|
||||
if self.helpers.is_hypervisor():
|
||||
@@ -1377,7 +1378,8 @@ class AMDSMIParser(argparse.ArgumentParser):
|
||||
monitor_parser.add_argument('-v', '--vram-usage', action='store_true', required=False, help=mem_usage_help)
|
||||
monitor_parser.add_argument('-r', '--pcie', action='store_true', required=False, help=pcie_bandwidth_help)
|
||||
monitor_parser.add_argument('-q', '--process', action='store_true', required=False, help=process_help)
|
||||
monitor_parser.add_argument('-V', '--violation', action='store_true', required=False, help=violation_help)
|
||||
if not self.helpers.is_virtual_os():
|
||||
monitor_parser.add_argument('-V', '--violation', action='store_true', required=False, help=violation_help)
|
||||
|
||||
# Add Universal Arguments & Watch Args
|
||||
self._add_watch_arguments(monitor_parser)
|
||||
|
||||
Reference in New Issue
Block a user