Skip to content

Commit

Permalink
SWDEV-475244 - Memory Usage and Bandwidth: memory activity
Browse files Browse the repository at this point in the history
Implemented memory activity and added a new fied id
RDC_FI_GPU_MEMORY_ACTIVITY.

Signed-off-by: Li Ma <[email protected]>
Change-Id: I11abe356ef6b01ce4917fd19dcc128efbc535f39
  • Loading branch information
Li Ma committed Oct 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b17abf9 commit 4bd31b6
Showing 6 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/rdc_field.data
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ FLD_DESC_ENT(RDC_FI_GPU_MEMORY_USAGE, "Memory usage of the GPU instance in by
FLD_DESC_ENT(RDC_FI_GPU_MEMORY_TOTAL, "Total memory of the GPU instance", "GPU_MEMORY_TOTAL", true)
FLD_DESC_ENT(RDC_FI_GPU_MM_ENC_UTIL, "Mutilmedia encoder busy percentage", "GPU_MM_ENC_UTIL", true)
FLD_DESC_ENT(RDC_FI_GPU_MM_DEC_UTIL, "Mutilmedia decoder busy percentage", "GPU_MM_DEC_UTIL", true)
FLD_DESC_ENT(RDC_FI_GPU_MEMORY_ACTIVITY, "Memory busy percentage", "GPU_MEM_UTIL", true)

// ECC totals
FLD_DESC_ENT(RDC_FI_ECC_CORRECT_TOTAL, "Accumulated Single Error Correction", "ECC_CORRECT", true)
1 change: 1 addition & 0 deletions include/rdc/rdc.h
Original file line number Diff line number Diff line change
@@ -187,6 +187,7 @@ typedef enum {
RDC_FI_GPU_MEMORY_TOTAL, //!< Total memory of the GPU instance
RDC_FI_GPU_MM_ENC_UTIL, //!< Multimedia encoder busy percentage
RDC_FI_GPU_MM_DEC_UTIL, //!< Multimedia decoder busy percentage
RDC_FI_GPU_MEMORY_ACTIVITY, //!< Memory busy percentage

/**
* @brief ECC related fields
1 change: 1 addition & 0 deletions python_binding/RdcReader.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
rdc_field_t.RDC_FI_GPU_MEMORY_TOTAL,
rdc_field_t.RDC_FI_GPU_MM_ENC_UTIL,
rdc_field_t.RDC_FI_GPU_MM_DEC_UTIL,
rdc_field_t.RDC_FI_GPU_MEMORY_ACTIVITY,
rdc_field_t.RDC_FI_OAM_ID,
rdc_field_t.RDC_FI_POWER_USAGE,
rdc_field_t.RDC_FI_GPU_CLOCK,
1 change: 1 addition & 0 deletions python_binding/rdc_bootstrap.py
Original file line number Diff line number Diff line change
@@ -89,6 +89,7 @@ class rdc_field_t(c_int):
RDC_FI_GPU_MEMORY_TOTAL = 502
RDC_FI_GPU_MM_ENC_UTIL = 503
RDC_FI_GPU_MM_DEC_UTIL = 504
RDC_FI_GPU_MEMORY_ACTIVITY = 505
RDC_FI_ECC_CORRECT_TOTAL = 600
RDC_FI_ECC_UNCORRECT_TOTAL = 601
RDC_FI_ECC_SDMA_SEC = 602
9 changes: 9 additions & 0 deletions rdc_libs/rdc/src/RdcMetricFetcherImpl.cc
Original file line number Diff line number Diff line change
@@ -564,6 +564,15 @@ rdc_status_t RdcMetricFetcherImpl::fetch_smi_field(uint32_t gpu_index, rdc_field
}
break;
}
case RDC_FI_GPU_MEMORY_ACTIVITY: {
amdsmi_engine_usage_t engine_usage;
value->status = amdsmi_get_gpu_activity(processor_handle, &engine_usage);
value->type = INTEGER;
if (value->status == AMDSMI_STATUS_SUCCESS) {
value->value.l_int = static_cast<int64_t>(engine_usage.umc_activity);
}
break;
}
case RDC_FI_GPU_COUNT: {
uint32_t processor_count = 0;
// amdsmi is initialized in AMDSMI_INIT_AMD_GPUS mode -> returned sockets are GPUs
2 changes: 1 addition & 1 deletion rdc_libs/rdc/src/RdcSmiLib.cc
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ rdc_status_t RdcSmiLib::rdc_telemetry_fields_query(uint32_t field_ids[MAX_NUM_FI
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_FI_OAM_ID,
RDC_FI_GPU_MM_ENC_UTIL, RDC_FI_GPU_MM_DEC_UTIL,
RDC_FI_GPU_MM_ENC_UTIL, RDC_FI_GPU_MM_DEC_UTIL, RDC_FI_GPU_MEMORY_ACTIVITY,
};
std::copy(fields.begin(), fields.end(), field_ids);
*field_count = fields.size();

0 comments on commit 4bd31b6

Please sign in to comment.