Added workaround for inconsistent current pcie speed from gpumetrics
Change-Id: If8404d21341cd15eb4d0221ab92cb0b351bbdf3e
Signed-off-by: Maisam Arif <maisarif@amd.com>
[ROCm/amdsmi commit: b14da692eb]
Этот коммит содержится в:
@@ -1105,8 +1105,8 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint16_t pcie_lanes;
|
||||
uint32_t pcie_speed;
|
||||
uint32_t reserved[5];
|
||||
uint32_t pcie_interface_version;
|
||||
uint32_t reserved[5];
|
||||
} amdsmi_pcie_info_t;
|
||||
/**
|
||||
* @brief This structure contains information specific to a process.
|
||||
|
||||
@@ -1368,8 +1368,8 @@ struct_c__SA_amdsmi_pcie_info_t._fields_ = [
|
||||
('pcie_lanes', ctypes.c_uint16),
|
||||
('PADDING_0', ctypes.c_ubyte * 2),
|
||||
('pcie_speed', ctypes.c_uint32),
|
||||
('reserved', ctypes.c_uint32 * 5),
|
||||
('pcie_interface_version', ctypes.c_uint32),
|
||||
('reserved', ctypes.c_uint32 * 5),
|
||||
]
|
||||
|
||||
amdsmi_pcie_info_t = struct_c__SA_amdsmi_pcie_info_t
|
||||
|
||||
@@ -1694,8 +1694,13 @@ amdsmi_get_pcie_link_status(amdsmi_processor_handle processor_handle, amdsmi_pci
|
||||
return status;
|
||||
|
||||
info->pcie_lanes = metric_info.pcie_link_width;
|
||||
// gpu metrics returns pcie link speed in .1 GT/s ex. 160 vs 16
|
||||
info->pcie_speed = (metric_info.pcie_link_speed / 10) * 1000;
|
||||
// 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_speed); // mapping to MT/s
|
||||
} else {
|
||||
// gpu metrics returns pcie link speed in .1 GT/s ex. 160 vs 16
|
||||
info->pcie_speed = metric_info.pcie_link_speed * 100;
|
||||
}
|
||||
|
||||
switch (info->pcie_speed) {
|
||||
case 2500:
|
||||
|
||||
@@ -468,6 +468,9 @@ amdsmi_status_t smi_amdgpu_get_pcie_speed_from_pcie_type(uint16_t pcie_type, uin
|
||||
case 5:
|
||||
*pcie_speed = 32000;
|
||||
break;
|
||||
case 6:
|
||||
*pcie_speed = 64000;
|
||||
break;
|
||||
default:
|
||||
return AMDSMI_STATUS_API_FAILED;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user