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 <Ori.Messinger@amd.com>
Change-Id: I647c30c978ffb13f6819ac3d069ee340710a7f99


[ROCm/amdsmi commit: 786f66671a]
Dieser Commit ist enthalten in:
Ori Messinger
2022-05-19 03:44:32 -04:00
Ursprung cf61df76ad
Commit 23b3bcc038
@@ -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))