[SWDEV-422195/SWDEV-440985] GPU metrics 1.6 + --showmetrics
Changes: - Added new GPU metrics: 1) Violation status' (ex. PVIOL/TVIOL) accumulators 2) XCP (Graphics Compute Partitions) statistics 3) pcie other end recovery counter - Added rocm-smi --showmetrics Units/values reflect as indicated by driver, may differ from AMD SMI or other ROCm SMI interfaces which use these fields. - N/A fields means the device does not support providing this data. Change-Id: Ia2cd3bb65c4f474ebdb39db8062ea716f2b4d8ee Signed-off-by: Charis Poag <Charis.Poag@amd.com>
This commit is contained in:
@@ -642,3 +642,102 @@ rsmi_power_type_dict = {
|
||||
1: 'CURRENT SOCKET',
|
||||
0xFFFFFFFF: 'INVALID_POWER_TYPE'
|
||||
}
|
||||
|
||||
class metrics_table_header_t(Structure):
|
||||
pass
|
||||
|
||||
# metrics_table_header_t._pack_ = 1 # source:False
|
||||
metrics_table_header_t._fields_ = [
|
||||
('structure_size', c_uint16),
|
||||
('format_revision', c_uint8),
|
||||
('content_revision', c_uint8),
|
||||
]
|
||||
amd_metrics_table_header_t = metrics_table_header_t
|
||||
|
||||
class amdgpu_xcp_metrics_t(Structure):
|
||||
pass
|
||||
|
||||
# amdgpu_xcp_metrics_t._pack_ = 1 # source:False
|
||||
amdgpu_xcp_metrics_t._fields_ = [
|
||||
('gfx_busy_inst', c_uint32 * 8),
|
||||
('jpeg_busy', c_uint16 * 32),
|
||||
('vcn_busy', c_uint16 * 4),
|
||||
('gfx_busy_acc', c_uint64 * 8),
|
||||
]
|
||||
xcp_stats_t = amdgpu_xcp_metrics_t
|
||||
|
||||
class rsmi_gpu_metrics_t(Structure):
|
||||
pass
|
||||
|
||||
|
||||
# rsmi_gpu_metrics_t._pack_ = 1 # source:False
|
||||
rsmi_gpu_metrics_t._fields_ = [
|
||||
('common_header', amd_metrics_table_header_t),
|
||||
('temperature_edge', c_uint16),
|
||||
('temperature_hotspot', c_uint16),
|
||||
('temperature_mem', c_uint16),
|
||||
('temperature_vrgfx', c_uint16),
|
||||
('temperature_vrsoc', c_uint16),
|
||||
('temperature_vrmem', c_uint16),
|
||||
('average_gfx_activity', c_uint16),
|
||||
('average_umc_activity', c_uint16),
|
||||
('average_mm_activity', c_uint16),
|
||||
('average_socket_power', c_uint16),
|
||||
('energy_accumulator', c_uint64),
|
||||
('system_clock_counter', c_uint64),
|
||||
('average_gfxclk_frequency', c_uint16),
|
||||
('average_socclk_frequency', c_uint16),
|
||||
('average_uclk_frequency', c_uint16),
|
||||
('average_vclk0_frequency', c_uint16),
|
||||
('average_dclk0_frequency', c_uint16),
|
||||
('average_vclk1_frequency', c_uint16),
|
||||
('average_dclk1_frequency', c_uint16),
|
||||
('current_gfxclk', c_uint16),
|
||||
('current_socclk', c_uint16),
|
||||
('current_uclk', c_uint16),
|
||||
('current_vclk0', c_uint16),
|
||||
('current_dclk0', c_uint16),
|
||||
('current_vclk1', c_uint16),
|
||||
('current_dclk1', c_uint16),
|
||||
('throttle_status', c_uint32),
|
||||
('current_fan_speed', c_uint16),
|
||||
('pcie_link_width', c_uint16),
|
||||
('pcie_link_speed', c_uint16),
|
||||
('gfx_activity_acc', c_uint32),
|
||||
('mem_activity_acc', c_uint32),
|
||||
('temperature_hbm', c_uint16 * 4),
|
||||
('firmware_timestamp', c_uint64),
|
||||
('voltage_soc', c_uint16),
|
||||
('voltage_gfx', c_uint16),
|
||||
('voltage_mem', c_uint16),
|
||||
('indep_throttle_status', c_uint64),
|
||||
('current_socket_power', c_uint16),
|
||||
('vcn_activity', c_uint16 * 4),
|
||||
('gfxclk_lock_status', c_uint32),
|
||||
('xgmi_link_width', c_uint16),
|
||||
('xgmi_link_speed', c_uint16),
|
||||
('pcie_bandwidth_acc', c_uint64),
|
||||
('pcie_bandwidth_inst', c_uint64),
|
||||
('pcie_l0_to_recov_count_acc', c_uint64),
|
||||
('pcie_replay_count_acc', c_uint64),
|
||||
('pcie_replay_rover_count_acc', c_uint64),
|
||||
('xgmi_read_data_acc', c_uint64 * 8),
|
||||
('xgmi_write_data_acc', c_uint64 * 8),
|
||||
('current_gfxclks', c_uint16 * 8),
|
||||
('current_socclks', c_uint16 * 4),
|
||||
('current_vclk0s', c_uint16 * 4),
|
||||
('current_dclk0s', c_uint16 * 4),
|
||||
('jpeg_activity', c_uint16 * 32),
|
||||
('pcie_nak_sent_count_acc', c_uint32),
|
||||
('pcie_nak_rcvd_count_acc', c_uint32),
|
||||
('accumulation_counter', c_uint64),
|
||||
('prochot_residency_acc', c_uint64),
|
||||
('ppt_residency_acc', c_uint64),
|
||||
('socket_thm_residency_acc', c_uint64),
|
||||
('vr_thm_residency_acc', c_uint64),
|
||||
('hbm_thm_residency_acc', c_uint64),
|
||||
('num_partition', c_uint16),
|
||||
('xcp_stats', xcp_stats_t * 8),
|
||||
('pcie_lc_perf_other_end_recovery', c_uint32),
|
||||
]
|
||||
amdsmi_gpu_metrics_t = rsmi_gpu_metrics_t
|
||||
|
||||
Referens i nytt ärende
Block a user