[SWDEV-496693]GPU Metrics 1.7

Features added:
- [SWDEV-475244] Add new interface to get max memory bandwidth
Updated API: amdsmi_get_gpu_vram_info
Updated: struct amdsmi_vram_info_t to include vram_max_bandwidth
CLI: amd-smi static --vram

- [SWDEV-488349] Add new interface for XGMI link status
New API: amdsmi_get_gpu_xgmi_link_status
CLI: amd-smi xgmi --link-status

Signed-off-by: Juan Castillo <juan.castillo@amd.com>
Change-Id: I1aa35b741136eb4f02f7ea9a95b865886273eb72


[ROCm/amdsmi commit: f8b8347627]
Tento commit je obsažen v:
Juan Castillo
2024-11-07 16:35:17 -06:00
odevzdal Arif, Maisam
rodič 01d303806a
revize 2ddb2ef032
16 změnil soubory, kde provedl 1281 přidání a 63 odebrání
+38 -3
Zobrazit soubor
@@ -293,9 +293,11 @@ int main() {
CHK_AMDSMI_RET(ret)
printf(" Output of amdsmi_get_gpu_vram_info:\n");
printf("\tVRAM Size: 0x%lx (%ld) \n", vram_info.vram_size, vram_info.vram_size);
printf("\tBIT Width: 0x%x (%d) \n\n", vram_info.vram_bit_width, vram_info.vram_bit_width);
}
else {
printf("\tBIT Width: 0x%x (%d) \n\n", vram_info.vram_bit_width,
vram_info.vram_bit_width);
printf("\tVRAM max bandwidth: 0x%lx (%lu) \n\n", vram_info.vram_max_bandwidth,
vram_info.vram_max_bandwidth);
} else {
printf("\t**amdsmi_get_gpu_vram_info() not supported on this system.\n");
}
@@ -865,6 +867,18 @@ int main() {
++idx;
}
std::cout << std::dec << "\txgmi_link_status= [";
idx = 0;
for (const auto& temp : smu.xgmi_link_status) {
std::cout << temp;
if ((idx + 1) != std::size(smu.xgmi_link_status)) {
std::cout << ", ";
} else {
std::cout << "]\n";
}
++idx;
}
// Voltage (mV)
std::cout << "\tvoltage_soc = " << std::dec << smu.voltage_soc << "\n";
std::cout << "\tvoltage_gfx = " << std::dec << smu.voltage_gfx << "\n";
@@ -880,6 +894,9 @@ int main() {
std::cout << "\tpcie_bandwidth_acc=" << std::dec << smu.pcie_bandwidth_acc << "\n";
std::cout << "\tpcie_bandwidth_inst=" << std::dec << smu.pcie_bandwidth_inst << "\n";
// VRAM max bandwidth at max memory clock
std::cout << "\tvram_max_bandwidth=" << std::dec << smu.vram_max_bandwidth << "\n";
// Counts
std::cout << "\tpcie_l0_to_recov_count_acc= " << std::dec << smu.pcie_l0_to_recov_count_acc
<< "\n";
@@ -983,6 +1000,24 @@ int main() {
idx++;
}
idx = 0;
idy = 0;
std::cout << "\txcp_stats.gfx_below_host_limit_acc: " << "\n";
for (auto& row : smu.xcp_stats) {
std::cout << "\t XCP [" << idx << "] : [";
for (auto& col : row.gfx_below_host_limit_acc) {
if ((idy + 1) != static_cast<int>(std::size(row.gfx_below_host_limit_acc))) {
std::cout << col << ", ";
} else {
std::cout << col;
}
idy++;
}
std::cout << "]\n";
idy = 0;
idx++;
}
std::cout << "\n\n";
std::cout << "\t ** -> Checking metrics with constant changes ** " << "\n";
constexpr uint16_t kMAX_ITER_TEST = 10;