Unify the amdsmi_get_pcie_info python interface

Make the python interface consistent with the C interface.

Change-Id: Idda08f888947c757e475d5a024b0ec3d8e1d846a
This commit is contained in:
Bill(Shuzhou) Liu
2024-02-15 12:41:50 -06:00
committed by Maisam Arif
parent f58613561c
commit db33cda0c1
7 changed files with 36 additions and 22 deletions
+2 -2
View File
@@ -1964,7 +1964,7 @@ amdsmi_status_t amdsmi_get_pcie_info(amdsmi_processor_handle processor_handle, a
printf("Failed to open file: %s \n", path_max_link_width.c_str());
return AMDSMI_STATUS_API_FAILED;
}
info->pcie_static.max_pcie_lanes = (uint16_t)pcie_width;
info->pcie_static.max_pcie_width = (uint16_t)pcie_width;
std::string path_max_link_speed = "/sys/class/drm/" +
gpu_device->get_gpu_path() + "/device/max_link_speed";
@@ -2028,7 +2028,7 @@ amdsmi_status_t amdsmi_get_pcie_info(amdsmi_processor_handle processor_handle, a
if (status != AMDSMI_STATUS_SUCCESS)
return status;
info->pcie_metric.pcie_lanes = metric_info.pcie_link_width;
info->pcie_metric.pcie_width = metric_info.pcie_link_width;
// gpu metrics is inconsistent with pcie_speed values, if 0-6 then it needs to be translated
if (metric_info.pcie_link_speed <= 6) {
status = smi_amdgpu_get_pcie_speed_from_pcie_type(metric_info.pcie_link_speed, &info->pcie_metric.pcie_speed); // mapping to MT/s