From 905c25e59b96cc5a8ed688146e4288aef4d5200f Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Wed, 17 Jan 2024 08:06:15 -0600 Subject: [PATCH 1/2] Voltage clock display as 0 when overdrive and voltage not supported Change the python tool not to display above information if it is not supported. Change-Id: I48ffd95f07168219a629dfb391c1b4587308286d --- python_smi_tools/rocm_smi.py | 40 +++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/python_smi_tools/rocm_smi.py b/python_smi_tools/rocm_smi.py index 9ebf07167b..0def4c6a29 100755 --- a/python_smi_tools/rocm_smi.py +++ b/python_smi_tools/rocm_smi.py @@ -2502,21 +2502,27 @@ def showPowerPlayTable(deviceList): printLog(device, '1: %sMhz' % (int(odvf.curr_sclk_range.upper_bound / 1000000)), None) printLog(device, 'OD_MCLK:', None) printLog(device, '1: %sMhz' % (int(odvf.curr_mclk_range.upper_bound / 1000000)), None) - printLog(device, 'OD_VDDC_CURVE:', None) - for position in range(3): - printLog(device, '%d: %sMhz %smV' % ( - position, int(list(odvf.curve.vc_points)[position].frequency / 1000000), - int(list(odvf.curve.vc_points)[position].voltage)), None) - printLog(device, 'OD_RANGE:', None) - printLog(device, 'SCLK: %sMhz %sMhz' % ( - int(odvf.sclk_freq_limits.lower_bound / 1000000), int(odvf.sclk_freq_limits.upper_bound / 1000000)), None) - printLog(device, 'MCLK: %sMhz %sMhz' % ( - int(odvf.mclk_freq_limits.lower_bound / 1000000), int(odvf.mclk_freq_limits.upper_bound / 1000000)), None) - for position in range(3): - printLog(device, 'VDDC_CURVE_SCLK[%d]: %sMhz' % ( - position, int(list(odvf.curve.vc_points)[position].frequency / 1000000)), None) - printLog(device, 'VDDC_CURVE_VOLT[%d]: %smV' % ( - position, int(list(odvf.curve.vc_points)[position].voltage)), None) + if odvf.num_regions > 0: + printLog(device, 'OD_VDDC_CURVE:', None) + for position in range(3): + printLog(device, '%d: %sMhz %smV' % ( + position, int(list(odvf.curve.vc_points)[position].frequency / 1000000), + int(list(odvf.curve.vc_points)[position].voltage)), None) + if odvf.sclk_freq_limits.lower_bound > 0 or odvf.sclk_freq_limits.upper_bound > 0 \ + or odvf.mclk_freq_limits.lower_bound >0 or odvf.mclk_freq_limits.upper_bound > 0: + printLog(device, 'OD_RANGE:', None) + if odvf.sclk_freq_limits.lower_bound > 0 or odvf.sclk_freq_limits.upper_bound > 0: + printLog(device, 'SCLK: %sMhz %sMhz' % ( + int(odvf.sclk_freq_limits.lower_bound / 1000000), int(odvf.sclk_freq_limits.upper_bound / 1000000)), None) + if odvf.mclk_freq_limits.lower_bound >0 or odvf.mclk_freq_limits.upper_bound > 0: + printLog(device, 'MCLK: %sMhz %sMhz' % ( + int(odvf.mclk_freq_limits.lower_bound / 1000000), int(odvf.mclk_freq_limits.upper_bound / 1000000)), None) + if odvf.num_regions > 0: + for position in range(3): + printLog(device, 'VDDC_CURVE_SCLK[%d]: %sMhz' % ( + position, int(list(odvf.curve.vc_points)[position].frequency / 1000000)), None) + printLog(device, 'VDDC_CURVE_VOLT[%d]: %smV' % ( + position, int(list(odvf.curve.vc_points)[position].voltage)), None) printLogSpacer() @@ -3032,11 +3038,13 @@ def showVoltageCurve(deviceList): odvf = rsmi_od_volt_freq_data_t() for device in deviceList: ret = rocmsmi.rsmi_dev_od_volt_info_get(device, byref(odvf)) - if rsmi_ret_ok(ret, device, 'get_od_volt_info', silent=False): + if rsmi_ret_ok(ret, device, 'get_od_volt_info', silent=False) and odvf.num_regions > 0: for position in range(3): printLog(device, 'Voltage point %d: %sMhz %smV' % ( 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.') printLogSpacer() From 73c65b6bfe492388e90dc12094913d447202afb7 Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Wed, 24 Jan 2024 08:31:24 -0600 Subject: [PATCH 2/2] UMC ECC count return not supported The current code assume err_count sysfs only have 2 lines, which is changed for umc_err_count by adding extra line for defer errors. The code is changed to relax such check. Change-Id: I1c469555a5d460d7bc4f4926245646c09c6a2056 --- src/rocm_smi.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rocm_smi.cc b/src/rocm_smi.cc index b5cbf77ba4..7122e26d50 100755 --- a/src/rocm_smi.cc +++ b/src/rocm_smi.cc @@ -700,7 +700,7 @@ rsmi_dev_ecc_count_get(uint32_t dv_ind, rsmi_gpu_block_t block, DEVICE_MUTEX ret = GetDevValueVec(type, dv_ind, &val_vec); - if (val_vec.size() != 2 ) ret = RSMI_STATUS_FILE_ERROR; + if (val_vec.size() < 2 ) ret = RSMI_STATUS_FILE_ERROR; if (ret == RSMI_STATUS_FILE_ERROR) { ss << __PRETTY_FUNCTION__ << " | ======= end ======="