[SWDEV-463402] - Support retrieving connection type and P2P capabilities between two GPUs
1. Add a API interface amdsmi_topo_get_p2p_status to retrieve connection type and P2P capabilities between 2 GPUs. 2. Add getting p2p status test in hw_topology_read to print P2P capability information. 3. Add below tables for cli topology sub commands: - CACHE COHERANCY TABLE - ATOMICS TABLE - DMA TABLE - BI-DIRECTIONAL TABLE Change-Id: I199173030d4170115cea27c472958a4826e4e1bf Signed-off-by: Tim Huang <tim.huang@amd.com>
This commit is contained in:
@@ -1053,6 +1053,26 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src,
|
||||
return amd::smi::rsmi_to_amdsmi_status(rstatus);
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_topo_get_p2p_status(amdsmi_processor_handle processor_handle_src,
|
||||
amdsmi_processor_handle processor_handle_dst,
|
||||
amdsmi_io_link_type_t *type, amdsmi_p2p_capability_t *cap) {
|
||||
AMDSMI_CHECK_INIT();
|
||||
|
||||
amd::smi::AMDSmiGPUDevice* src_device = nullptr;
|
||||
amd::smi::AMDSmiGPUDevice* dst_device = nullptr;
|
||||
amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device);
|
||||
if (r != AMDSMI_STATUS_SUCCESS)
|
||||
return r;
|
||||
r = get_gpu_device_from_handle(processor_handle_dst, &dst_device);
|
||||
if (r != AMDSMI_STATUS_SUCCESS)
|
||||
return r;
|
||||
auto rstatus = rsmi_topo_get_p2p_status(src_device->get_gpu_id(), dst_device->get_gpu_id(),
|
||||
reinterpret_cast<RSMI_IO_LINK_TYPE*>(type),
|
||||
reinterpret_cast<rsmi_p2p_capability_t*>(cap));
|
||||
return amd::smi::rsmi_to_amdsmi_status(rstatus);
|
||||
}
|
||||
|
||||
// Compute Partition functions
|
||||
amdsmi_status_t
|
||||
amdsmi_get_gpu_compute_partition(amdsmi_processor_handle processor_handle,
|
||||
|
||||
مرجع در شماره جدید
Block a user