diff --git a/common/rdc_field.data b/common/rdc_field.data index d3de984..53bf261 100644 --- a/common/rdc_field.data +++ b/common/rdc_field.data @@ -36,6 +36,7 @@ THE SOFTWARE. FLD_DESC_ENT(RDC_FI_INVALID, "Unknown/Invalid field", "INVALID", false) FLD_DESC_ENT(RDC_FI_GPU_COUNT, "GPU count in the system", "GPU_COUNT", true) FLD_DESC_ENT(RDC_FI_DEV_NAME, "Name of the device", "DEV_NAME", true) +FLD_DESC_ENT(RDC_FI_OAM_ID, "OAM ID of the device", "OAM_ID", true) FLD_DESC_ENT(RDC_FI_GPU_CLOCK, "Current GPU clock frequencies", "GPU_CLOCK", true) FLD_DESC_ENT(RDC_FI_MEM_CLOCK, "Current Memory clock frequencies", "MEM_CLOCK", true) FLD_DESC_ENT(RDC_FI_MEMORY_TEMP, "Memory temperature in millidegrees Celsius", "MEMORY_TEMP", true) diff --git a/include/rdc/rdc.h b/include/rdc/rdc.h index 9919ee4..5dae241 100644 --- a/include/rdc/rdc.h +++ b/include/rdc/rdc.h @@ -149,6 +149,7 @@ typedef enum { //!< @brief Identifier fields RDC_FI_GPU_COUNT = 1, //!< GPU count in the system RDC_FI_DEV_NAME, //!< Name of the device + RDC_FI_OAM_ID, //!< OAM ID of the device /** * @brief Frequency related fields diff --git a/python_binding/RdcReader.py b/python_binding/RdcReader.py index 2dc69c6..ebec716 100644 --- a/python_binding/RdcReader.py +++ b/python_binding/RdcReader.py @@ -5,6 +5,7 @@ default_field_ids = [ rdc_field_t.RDC_FI_GPU_MEMORY_USAGE, rdc_field_t.RDC_FI_GPU_MEMORY_TOTAL, + rdc_field_t.RDC_FI_OAM_ID, rdc_field_t.RDC_FI_POWER_USAGE, rdc_field_t.RDC_FI_GPU_CLOCK, rdc_field_t.RDC_FI_GPU_UTIL, diff --git a/python_binding/rdc_bootstrap.py b/python_binding/rdc_bootstrap.py index 7c94576..d8b2035 100644 --- a/python_binding/rdc_bootstrap.py +++ b/python_binding/rdc_bootstrap.py @@ -75,6 +75,7 @@ class rdc_field_t(c_int): RDC_FI_INVALID = 0 RDC_FI_GPU_COUNT = 1 RDC_FI_DEV_NAME = 2 + RDC_FI_OAM_ID = 3 RDC_FI_GPU_CLOCK = 100 RDC_FI_MEM_CLOCK = 101 RDC_FI_MEMORY_TEMP = 200 diff --git a/rdc_libs/rdc/src/RdcMetricFetcherImpl.cc b/rdc_libs/rdc/src/RdcMetricFetcherImpl.cc index a0ff671..c2a85ec 100644 --- a/rdc_libs/rdc/src/RdcMetricFetcherImpl.cc +++ b/rdc_libs/rdc/src/RdcMetricFetcherImpl.cc @@ -623,6 +623,20 @@ rdc_status_t RdcMetricFetcherImpl::fetch_smi_field(uint32_t gpu_index, rdc_field } break; } + case RDC_FI_OAM_ID: { + amdsmi_asic_info_t asic_info; + value->status = amdsmi_get_gpu_asic_info(processor_handle, &asic_info); + value->type = INTEGER; + if (value->status == AMDSMI_STATUS_SUCCESS) { + // 0xFFFF means not supported for OAM ID + if (asic_info.oam_id == 0xFFFF) { + value->status = AMDSMI_STATUS_NOT_SUPPORTED; + } else { + value->value.l_int = asic_info.oam_id; + } + } + break; + } case RDC_FI_ECC_CORRECT_TOTAL: case RDC_FI_ECC_UNCORRECT_TOTAL: get_ecc_total(gpu_index, field_id, value); diff --git a/rdc_libs/rdc/src/RdcSmiLib.cc b/rdc_libs/rdc/src/RdcSmiLib.cc index 87e4e4b..79891c7 100644 --- a/rdc_libs/rdc/src/RdcSmiLib.cc +++ b/rdc_libs/rdc/src/RdcSmiLib.cc @@ -176,7 +176,7 @@ rdc_status_t RdcSmiLib::rdc_telemetry_fields_query(uint32_t field_ids[MAX_NUM_FI RDC_EVNT_XGMI_0_BEATS_TX, RDC_EVNT_XGMI_1_NOP_TX, RDC_EVNT_XGMI_1_REQ_TX, RDC_EVNT_XGMI_1_RESP_TX, RDC_EVNT_XGMI_1_BEATS_TX, RDC_EVNT_XGMI_0_THRPUT, RDC_EVNT_XGMI_1_THRPUT, RDC_EVNT_XGMI_2_THRPUT, RDC_EVNT_XGMI_3_THRPUT, - RDC_EVNT_XGMI_4_THRPUT, RDC_EVNT_XGMI_5_THRPUT, + RDC_EVNT_XGMI_4_THRPUT, RDC_EVNT_XGMI_5_THRPUT, RDC_FI_OAM_ID, }; std::copy(fields.begin(), fields.end(), field_ids); *field_count = fields.size();