From 23b3bcc0386b3ad499ac17abf36ec9cdc1a742d9 Mon Sep 17 00:00:00 2001 From: Ori Messinger Date: Thu, 19 May 2022 03:44:32 -0400 Subject: [PATCH] ROCm SMI CLI: Fix --showvoltagerange bug This patch fixes a --showvoltagerange bug, which attempts to check the voltage curve on a device that does not have any voltage regions in its OverDrive voltage frequency data (odvf). Signed-off-by: Ori Messinger Change-Id: I647c30c978ffb13f6819ac3d069ee340710a7f99 [ROCm/amdsmi commit: 786f66671a8a0118e12078c6855a71cf25920dde] --- projects/amdsmi/python_smi_tools/rocm_smi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/amdsmi/python_smi_tools/rocm_smi.py b/projects/amdsmi/python_smi_tools/rocm_smi.py index fa8fa8d655..fac0c99153 100755 --- a/projects/amdsmi/python_smi_tools/rocm_smi.py +++ b/projects/amdsmi/python_smi_tools/rocm_smi.py @@ -2061,6 +2061,9 @@ def showRange(deviceList, rangeType): printLog(device, 'Valid mclk range: %sMhz - %sMhz' % ( 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.') + continue num_regions = c_uint32(odvf.num_regions) regions = (rsmi_freq_volt_region_t * odvf.num_regions)() ret = rocmsmi.rsmi_dev_od_volt_curve_regions_get(device, byref(num_regions), byref(regions))