diff options
author | Jonathan Kim <jonathan.kim@amd.com> | 2023-02-02 11:10:08 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-06-09 09:52:36 -0400 |
commit | 1698e200e88db96aef7d16aa3d63df68a209ffbd (patch) | |
tree | ababb74dff9567724babc5ef5684097e73ee4569 /drivers | |
parent | 8c45a8340dd097ea0d6be6f718c4882283d9645d (diff) | |
download | linux-stable-1698e200e88db96aef7d16aa3d63df68a209ffbd.tar.gz linux-stable-1698e200e88db96aef7d16aa3d63df68a209ffbd.tar.bz2 linux-stable-1698e200e88db96aef7d16aa3d63df68a209ffbd.zip |
drm/amdkfd: bind cpu and hiveless gpu to a hive if xgmi connected
If a CPU and GPU are xGMI connected but the GPU is hiveless with
respect to other GPUs, create a new CPU-GPU hive using the GPU's PCI
device location ID as the new hive ID to maintain fine grain memory
access usage.
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 5373a79ac6a1..c7072fff778e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -1328,8 +1328,15 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev) /* Include the CPU peer in GPU hive if connected over xGMI. */ if (!peer_dev->gpu && - link->iolink_type == CRAT_IOLINK_TYPE_XGMI) + link->iolink_type == CRAT_IOLINK_TYPE_XGMI) { + /* + * If the GPU is not part of a GPU hive, use its pci + * device location as the hive ID to bind with the CPU. + */ + if (!dev->node_props.hive_id) + dev->node_props.hive_id = pci_dev_id(dev->gpu->adev->pdev); peer_dev->node_props.hive_id = dev->node_props.hive_id; + } list_for_each_entry(inbound_link, &peer_dev->io_link_props, list) { |