diff --git a/projects/rocm-smi-lib/include/rocm_smi/rocm_smi_device.h b/projects/rocm-smi-lib/include/rocm_smi/rocm_smi_device.h index ad837bec8e..a21a64a9ce 100755 --- a/projects/rocm-smi-lib/include/rocm_smi/rocm_smi_device.h +++ b/projects/rocm-smi-lib/include/rocm_smi/rocm_smi_device.h @@ -118,6 +118,10 @@ enum DevInfoTypes { kDevErrCntSDMA, kDevErrCntUMC, kDevErrCntGFX, + kDevErrCntMMHUB, + kDevErrCntPCIEBIF, + kDevErrCntHDP, + kDevErrCntXGMIWAFL, kDevErrCntFeatures, kDevMemTotGTT, kDevMemTotVisVRAM, diff --git a/projects/rocm-smi-lib/oam/src/amd_oam.cc b/projects/rocm-smi-lib/oam/src/amd_oam.cc index 23023eebc8..1262fcc9e8 100755 --- a/projects/rocm-smi-lib/oam/src/amd_oam.cc +++ b/projects/rocm-smi-lib/oam/src/amd_oam.cc @@ -341,6 +341,22 @@ get_device_error_count(oam_dev_handle_t *handle, type = amd::smi::kDevErrCntGFX; break; + case RSMI_GPU_BLOCK_MMHUB: + type = amd::smi::kDevErrCntMMHUB; + break; + + case RSMI_GPU_BLOCK_PCIE_BIF: + type = amd::smi::kDevErrCntPCIEBIF; + break; + + case RSMI_GPU_BLOCK_HDP: + type = amd::smi::kDevErrCntHDP; + break; + + case RSMI_GPU_BLOCK_XGMI_WAFL: + type = amd::smi::kDevErrCntXGMIWAFL; + break; + default: return RSMI_STATUS_NOT_SUPPORTED; } 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 683824824e..f65027759b 100755 --- a/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py +++ b/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py @@ -1420,10 +1420,6 @@ def showClocks(deviceList): for device in deviceList: for clk_type in sorted(rsmi_clk_names_dict): freq_list = [] - if not os.path.isfile( - os.path.join('/sys/class/drm', 'card%d' % (device), 'device', 'pp_dpm_%s' % clk_type)): - logging.debug('No clock file for %s on card%d' % (clk_type, device)) - continue if rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clk_type], None) == 1: ret = rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clk_type], byref(freq)) if rsmi_ret_ok(ret, device, clk_type, True): @@ -1436,7 +1432,7 @@ def showClocks(deviceList): printLog(device, str(x), str(fr)) printLog(device, '', None) else: - printErrLog(device, '%s frequency is unsupported' % (clk_type)) + logging.debug('{} frequency is unsupported on device[{}]'.format(clk_type, device)) printLog(device, '', None) if rocmsmi.rsmi_dev_pci_bandwidth_get(device, None) == 1: ret = rocmsmi.rsmi_dev_pci_bandwidth_get(device, byref(bw)) @@ -1451,7 +1447,7 @@ def showClocks(deviceList): printLog(device, str(x), str(fr)) printLog(device, '', None) else: - printErrLog(device, 'PCIe frequency is unsupported') + logging.debug('PCIe frequency is unsupported on device [{}]'.format(device)) printLog(device, '', None) printLogSpacer(None, '-') # divider between devices for better visibility printLogSpacer() @@ -1485,10 +1481,6 @@ def showCurrentClocks(deviceList, clk_defined=None, concise=False): else: # if clk is not defined, will display all current clk for clk_type in sorted(rsmi_clk_names_dict): - if not os.path.isfile( - os.path.join('/sys/class/drm', 'card%d' % (device), 'device', 'pp_dpm_%s' % clk_type)): - logging.debug('No clock file for %s on card%d' % (clk_type, device)) - continue if rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clk_type], None) == 1: ret = rocmsmi.rsmi_dev_gpu_clk_freq_get(device, rsmi_clk_names_dict[clk_type], byref(freq)) if rsmi_ret_ok(ret, device, clk_type, True): @@ -1500,7 +1492,7 @@ def showCurrentClocks(deviceList, clk_defined=None, concise=False): else: printLog(device, '%s clock level: %s' % (clk_type, levl), '(%sMhz)' % (str(fr)[:-2])) else: - printErrLog(device, '%s clock is unsupported' % (clk_type)) + logging.debug('{} clock is unsupported on device[{}]'.format(clk_type, device)) # pcie clocks if rocmsmi.rsmi_dev_pci_bandwidth_get(device, None) == 1: ret = rocmsmi.rsmi_dev_pci_bandwidth_get(device, byref(bw)) @@ -1510,7 +1502,7 @@ def showCurrentClocks(deviceList, clk_defined=None, concise=False): bw.lanes[current_f]) printLog(device, 'pcie clock level', '{} ({})'.format(current_f, fr)) else: - printErrLog(device, 'PCIe clock is unsupported') + logging.debug('PCIe clock is unsupported on device[{}]'.format(device)) printLogSpacer() diff --git a/projects/rocm-smi-lib/src/rocm_smi.cc b/projects/rocm-smi-lib/src/rocm_smi.cc index 4a8f550aa6..c8e521aac0 100755 --- a/projects/rocm-smi-lib/src/rocm_smi.cc +++ b/projects/rocm-smi-lib/src/rocm_smi.cc @@ -604,6 +604,22 @@ rsmi_dev_ecc_count_get(uint32_t dv_ind, rsmi_gpu_block_t block, type = amd::smi::kDevErrCntGFX; break; + case RSMI_GPU_BLOCK_MMHUB: + type = amd::smi::kDevErrCntMMHUB; + break; + + case RSMI_GPU_BLOCK_PCIE_BIF: + type = amd::smi::kDevErrCntPCIEBIF; + break; + + case RSMI_GPU_BLOCK_HDP: + type = amd::smi::kDevErrCntHDP; + break; + + case RSMI_GPU_BLOCK_XGMI_WAFL: + type = amd::smi::kDevErrCntXGMIWAFL; + break; + default: return RSMI_STATUS_NOT_SUPPORTED; } diff --git a/projects/rocm-smi-lib/src/rocm_smi_device.cc b/projects/rocm-smi-lib/src/rocm_smi_device.cc index 69dff42111..dc65816513 100755 --- a/projects/rocm-smi-lib/src/rocm_smi_device.cc +++ b/projects/rocm-smi-lib/src/rocm_smi_device.cc @@ -99,6 +99,10 @@ static const char *kDevPCIEThruPutFName = "pcie_bw"; static const char *kDevErrCntSDMAFName = "ras/sdma_err_count"; static const char *kDevErrCntUMCFName = "ras/umc_err_count"; static const char *kDevErrCntGFXFName = "ras/gfx_err_count"; +static const char *kDevErrCntMMHUBFName = "ras/mmhub_err_count"; +static const char *kDevErrCntPCIEBIFFName = "ras/pcie_bif_err_count"; +static const char *kDevErrCntHDPFName = "ras/hdp_err_count"; +static const char *kDevErrCntXGMIWAFLFName = "ras/xgmi_wafl_err_count"; static const char *kDevErrCntFeaturesFName = "ras/features"; static const char *kDevMemPageBadFName = "ras/gpu_vram_bad_pages"; static const char *kDevMemTotGTTFName = "mem_info_gtt_total"; @@ -241,6 +245,10 @@ static const std::map kDevAttribNameMap = { {kDevErrCntSDMA, kDevErrCntSDMAFName}, {kDevErrCntUMC, kDevErrCntUMCFName}, {kDevErrCntGFX, kDevErrCntGFXFName}, + {kDevErrCntMMHUB, kDevErrCntMMHUBFName}, + {kDevErrCntPCIEBIF, kDevErrCntPCIEBIFFName}, + {kDevErrCntHDP, kDevErrCntHDPFName}, + {kDevErrCntXGMIWAFL, kDevErrCntXGMIWAFLFName}, {kDevErrCntFeatures, kDevErrCntFeaturesFName}, {kDevMemTotGTT, kDevMemTotGTTFName}, {kDevMemTotVisVRAM, kDevMemTotVisVRAMFName}, @@ -339,6 +347,10 @@ static std::map kDevInfoVarTypeToRSMIVariant = { {kDevErrCntUMC, RSMI_GPU_BLOCK_UMC}, {kDevErrCntSDMA, RSMI_GPU_BLOCK_SDMA}, {kDevErrCntGFX, RSMI_GPU_BLOCK_GFX}, + {kDevErrCntMMHUB, RSMI_GPU_BLOCK_MMHUB}, + {kDevErrCntPCIEBIF, RSMI_GPU_BLOCK_PCIE_BIF}, + {kDevErrCntHDP, RSMI_GPU_BLOCK_HDP}, + {kDevErrCntXGMIWAFL, RSMI_GPU_BLOCK_XGMI_WAFL}, // rsmi_event_group_t {kDevDFCountersAvailable, RSMI_EVNT_GRP_XGMI} @@ -467,6 +479,10 @@ static const std::map kDevFuncDependsMap = { kDevErrCntUMC, kDevErrCntSDMA, kDevErrCntGFX, + kDevErrCntMMHUB, + kDevErrCntPCIEBIF, + kDevErrCntHDP, + kDevErrCntXGMIWAFL, } } }, @@ -852,6 +868,10 @@ int Device::readDevInfo(DevInfoTypes type, std::vector *val) { case kDevErrCntSDMA: case kDevErrCntUMC: case kDevErrCntGFX: + case kDevErrCntMMHUB: + case kDevErrCntPCIEBIF: + case kDevErrCntHDP: + case kDevErrCntXGMIWAFL: case kDevMemPageBad: return readDevInfoMultiLineStr(type, val); break;