From ff2bcc16fa255e9e41cff8023b9ea34f1244e0a1 Mon Sep 17 00:00:00 2001 From: Elena Sakhnovitch Date: Thu, 16 Sep 2021 09:59:45 -0400 Subject: [PATCH] [rocm_smi.py] remove repetitive footnote Printing "Primary die (usually one above or below the secondary) shows total (primary + secondary) socket power information" footnote only one time, not for every secondary die. Signed-off-by: Elena Sakhnovitch Change-Id: Iae9c5c94945ec38ecdb128a576a4eacafc30a044 [ROCm/amdsmi commit: 15e4fe80e13e5155367a1acf87c61e83f591d243] --- projects/amdsmi/python_smi_tools/rocm_smi.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/amdsmi/python_smi_tools/rocm_smi.py b/projects/amdsmi/python_smi_tools/rocm_smi.py index d9a9e303ed..8ecdef5af4 100755 --- a/projects/amdsmi/python_smi_tools/rocm_smi.py +++ b/projects/amdsmi/python_smi_tools/rocm_smi.py @@ -1859,15 +1859,19 @@ def showPower(deviceList): @param deviceList: List of DRM devices (can be a single-item list) """ + secondaryPresent=False printLogSpacer(' Power Consumption ') for device in deviceList: if checkIfSecondaryDie(device): - printLog(device, 'Average Graphics Package Power (W)', "Secondary die") - printLog(None, "\t\tPrimary die above shows total (primary + secondary) socket power information", None) + printLog(device, 'Average Graphics Package Power (W)', "N/A (Secondary die)") + secondaryPresent=True elif str(getPower(device)) != '0.0': printLog(device, 'Average Graphics Package Power (W)', getPower(device)) else: printErrLog(device, 'Unable to get Average Graphics Package Power Consumption') + if secondaryPresent: + printLog(None, "\n\t\tPrimary die (usually one above or below the secondary) shows total (primary + secondary) socket power information", None) + printLogSpacer()