From 3e1f707eb7e17f01f331f8cac1adedc31d786c48 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Fri, 27 Sep 2024 12:55:39 -0500 Subject: [PATCH] Adjusted throttle unit logic in amdsmi_commands.py Signed-off-by: Maisam Arif Change-Id: Icce949ff93f45c9751f43df0a80614fd377318fa [ROCm/amdsmi commit: 2c8e2060cbcf39cb86f98d43bd01a4ab87abc0be] --- projects/amdsmi/amdsmi_cli/amdsmi_commands.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py index 159ee69ceb..f7c0991a5f 100644 --- a/projects/amdsmi/amdsmi_cli/amdsmi_commands.py +++ b/projects/amdsmi/amdsmi_cli/amdsmi_commands.py @@ -2145,15 +2145,13 @@ class AMDSMICommands(): logging.debug("Failed to get violation status' for gpu %s | %s", gpu_id, e.get_error_info()) for key, value in throttle_status.items(): - if ("active" in key) and (value is True): - throttle_status[key] = "ACTIVE" - continue - elif ("active" in key) and (value is False): + if "active" in key: throttle_status[key] = "NOT ACTIVE" + if value: + throttle_status[key] = "ACTIVE" continue - if "percent" in key: - True # continue with rest of logic - else: + + if "percent" not in key: continue activity_unit = '%'