Skip to content

Commit

Permalink
Add OAM_ID
Browse files Browse the repository at this point in the history
Change-Id: I771b2f7f088940838c09ba3521a7955faa64e7ec
Signed-off-by: Galantsev, Dmitrii <[email protected]>
  • Loading branch information
dmitrii-galantsev committed Sep 10, 2024
1 parent 8c56855 commit a0f7290
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/rdc_field.data
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions include/rdc/rdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions python_binding/RdcReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions python_binding/rdc_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions rdc_libs/rdc/src/RdcMetricFetcherImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion rdc_libs/rdc/src/RdcSmiLib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a0f7290

Please sign in to comment.