Fix metric type error output + re-align with ROCm SMI metrics

Changes:
* [CLI] Provide fix for "/opt/rocm/bin/amd-smi metric
TypeError: '>' not supported between instances of 'str' and 'i"
--> Python API was updated, CLI needed to reflect these changes
* [API] Updated amdsmi.h's with ROCm SMI
--> Incorrectly added mem_bandwidth_acc & mem_max_bandwidth
--> Realigned wrapper with updates
* [Test] Added metrics not shown in gpu_metrics_read.cc

Change-Id: Ia3a172377fd5a582254dd5a46d81dbec7e763cd9
Signed-off-by: Charis Poag <Charis.Poag@amd.com>
Этот коммит содержится в:
Charis Poag
2024-01-24 20:43:47 -06:00
коммит произвёл Maisam Arif
родитель 0b67c2ccc4
Коммит 34bd26c68e
7 изменённых файлов: 109 добавлений и 88 удалений
-2
Просмотреть файл
@@ -2136,8 +2136,6 @@ Output: Dictionary with fields
`current_socclks` | List of current soc clock frequencies | MHz
`current_vclk0s` | List of current v0 clock frequencies | MHz
`current_dclk0s` | List of current d0 clock frequencies | MHz
`mem_bandwidth_acc` | Memory bandwidth usage accumulated | GB/s
`mem_max_bandwidth` | Maximum memory bandwidth usage accumulated | GB/s
`pcie_nak_sent_count_acc` | PCIe NAC sent count accumulated |
`pcie_nak_rcvd_count_acc` | PCIe NAC received count accumulated |
`jpeg_activity` | List of JPEG engine activity | %
+4 -7
Просмотреть файл
@@ -3290,8 +3290,6 @@ def amdsmi_get_gpu_metrics_info(
"current_socclks": list(gpu_metrics.current_socclks),
"current_vclk0s": list(gpu_metrics.current_vclk0s),
"current_dclk0s": list(gpu_metrics.current_dclk0s),
"mem_bandwidth_acc": gpu_metrics.mem_bandwidth_acc,
"mem_max_bandwidth": gpu_metrics.mem_max_bandwidth,
"pcie_nak_sent_count_acc": gpu_metrics.pcie_nak_sent_count_acc,
"pcie_nak_rcvd_count_acc": gpu_metrics.pcie_nak_rcvd_count_acc,
"jpeg_activity": list(gpu_metrics.jpeg_activity),
@@ -3313,8 +3311,7 @@ def amdsmi_get_gpu_metrics_info(
if gpu_metrics_output[value] == 0xFFFF:
gpu_metrics_output[value] = "N/A"
uint_32_values = ['gfx_activity_acc', 'mem_activity_acc', 'mem_max_bandwidth',
'pcie_nak_sent_count_acc', 'pcie_nak_rcvd_count_acc']
uint_32_values = ['gfx_activity_acc','mem_activity_acc', 'pcie_nak_sent_count_acc', 'pcie_nak_rcvd_count_acc']
for value in uint_32_values:
if gpu_metrics_output[value] == 0xFFFFFFFF:
@@ -3323,7 +3320,7 @@ def amdsmi_get_gpu_metrics_info(
uint_64_values = ['energy_accumulator', 'system_clock_counter', 'firmware_timestamp',
'pcie_bandwidth_acc', 'pcie_bandwidth_inst',
'pcie_l0_to_recov_count_acc', 'pcie_replay_count_acc',
'pcie_replay_rover_count_acc', 'mem_bandwidth_acc']
'pcie_replay_rover_count_acc']
for value in uint_64_values:
if gpu_metrics_output[value] == 0xFFFFFFFFFFFFFFFF:
@@ -3345,7 +3342,7 @@ def amdsmi_get_gpu_metrics_info(
gpu_metrics_output['indep_throttle_status'] = bool(gpu_metrics_output['indep_throttle_status'])
for idx, activity in enumerate(gpu_metrics_output['vcn_activity']):
if activity == 0xFFFF:
if activity == 0xFFFF or activity > 100:
gpu_metrics_output['vcn_activity'][idx] = "N/A"
if gpu_metrics_output['gfxclk_lock_status'] == 0xFFFFFFFF:
@@ -3378,7 +3375,7 @@ def amdsmi_get_gpu_metrics_info(
gpu_metrics_output['current_dclk0s'][idx] = "N/A"
for idx, activity in enumerate(gpu_metrics_output['jpeg_activity']):
if activity == 0xFFFF:
if activity == 0xFFFF or activity > 100:
gpu_metrics_output['jpeg_activity'][idx] = "N/A"
return gpu_metrics_output
-3
Просмотреть файл
@@ -1620,11 +1620,8 @@ struct_amdsmi_gpu_metrics_t._fields_ = [
('current_vclk0s', ctypes.c_uint16 * 4),
('current_dclk0s', ctypes.c_uint16 * 4),
('jpeg_activity', ctypes.c_uint16 * 32),
('mem_bandwidth_acc', ctypes.c_uint64),
('mem_max_bandwidth', ctypes.c_uint32),
('pcie_nak_sent_count_acc', ctypes.c_uint32),
('pcie_nak_rcvd_count_acc', ctypes.c_uint32),
('PADDING_4', ctypes.c_ubyte * 4),
]
amdsmi_gpu_metrics_t = struct_amdsmi_gpu_metrics_t