Commit 0f28cca8 authored by Ramesh Errabolu's avatar Ramesh Errabolu Committed by Alex Deucher

drm/amdkfd: Extend KFD device topology to surface peer-to-peer links

Extend KFD device topology to surface peer-to-peer links among
GPU devices connected over PCIe or xGMI. Enabling HSA_AMD_P2P is
REQUIRED to surface peer-to-peer links.

Prior to this KFD did not expose to user mode any P2P links or
indirect links that go over two or more direct hops. Old versions
of the Thunk used to make up their own P2P and indirect links without
the information about peer-accessibility and chipset support available
to the kernel mode driver. In this patch we expose P2P links in a new
sysfs directory to provide more reliable P2P link information to user
mode.

Old versions of the Thunk will continue to work as before and ignore
the new directory. This avoids conflicts between P2P links exposed by
KFD and P2P links created by the Thunk itself. New versions of the Thunk
will use only the P2P links provided in the new p2p_links directory, if
it exists, or fall back to the old code path on older KFDs that don't
expose p2p_links.
Signed-off-by: default avatarRamesh Errabolu <Ramesh.Errabolu@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent feb54650
This diff is collapsed.
...@@ -38,6 +38,7 @@ struct kfd_node_properties { ...@@ -38,6 +38,7 @@ struct kfd_node_properties {
uint32_t mem_banks_count; uint32_t mem_banks_count;
uint32_t caches_count; uint32_t caches_count;
uint32_t io_links_count; uint32_t io_links_count;
uint32_t p2p_links_count;
uint32_t cpu_core_id_base; uint32_t cpu_core_id_base;
uint32_t simd_id_base; uint32_t simd_id_base;
uint32_t capability; uint32_t capability;
...@@ -131,12 +132,14 @@ struct kfd_topology_device { ...@@ -131,12 +132,14 @@ struct kfd_topology_device {
struct list_head cache_props; struct list_head cache_props;
uint32_t io_link_count; uint32_t io_link_count;
struct list_head io_link_props; struct list_head io_link_props;
struct list_head p2p_link_props;
struct list_head perf_props; struct list_head perf_props;
struct kfd_dev *gpu; struct kfd_dev *gpu;
struct kobject *kobj_node; struct kobject *kobj_node;
struct kobject *kobj_mem; struct kobject *kobj_mem;
struct kobject *kobj_cache; struct kobject *kobj_cache;
struct kobject *kobj_iolink; struct kobject *kobj_iolink;
struct kobject *kobj_p2plink;
struct kobject *kobj_perf; struct kobject *kobj_perf;
struct attribute attr_gpuid; struct attribute attr_gpuid;
struct attribute attr_name; struct attribute attr_name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment