From 902bd6b1ae98eb6a526cd168d3c7279b7f480cac Mon Sep 17 00:00:00 2001 From: "Oliveira, Daniel" Date: Tue, 10 Sep 2024 11:25:55 -0500 Subject: [PATCH] [SWDEV-483822] rocm-smi shows 'warning' for unsupported curves Options '--showvoltagerange' and '--showvc' show 'warning' instead of 'error' for unsupported voltage curves Code changes related to the following: * CLI Change-Id: Ide662c98202c32ad01ccaf3c47a61f2543f82ebb Signed-off-by: Oliveira, Daniel [ROCm/rocm_smi_lib commit: 72b112f8f3a3983b30f509a3595ca423fa8916ae] --- projects/rocm-smi-lib/python_smi_tools/rocm_smi.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py b/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py index f993713fda..9f046a5339 100755 --- a/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py +++ b/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py @@ -791,7 +791,7 @@ def printEmptyLine(): print() -def printErrLog(device, err): +def printErrLog(device, err, is_warning=False): """ Print out an error to the SMI log :param device: DRM device identifier @@ -802,7 +802,10 @@ def printErrLog(device, err): for line in err.split('\n'): errstr = 'GPU[%s]\t: %s' % (devName, line) if not PRINT_JSON: - logging.error(errstr) + if not is_warning: + logging.error(errstr) + else: + logging.warning(errstr) else: logging.debug(errstr) @@ -2857,7 +2860,7 @@ def showRange(deviceList, rangeType): int(odvf.curr_mclk_range.lower_bound / 1000000), int(odvf.curr_mclk_range.upper_bound / 1000000)), None) if rangeType == 'voltage': if odvf.num_regions == 0: - printErrLog(device, 'Voltage curve regions unsupported.') + printErrLog(device, 'Voltage curve regions unsupported.', is_warning=True) continue num_regions = c_uint32(odvf.num_regions) regions = (rsmi_freq_volt_region_t * odvf.num_regions)() @@ -3202,7 +3205,7 @@ def showVoltageCurve(deviceList): position, int(list(odvf.curve.vc_points)[position].frequency / 1000000), int(list(odvf.curve.vc_points)[position].voltage)), None) else: - printErrLog(device, 'Voltage curve Points unsupported.') + printErrLog(device, 'Voltage curve Points unsupported.', is_warning=True) printLogSpacer()