[PATCH] drm/amdkfd: Add node_id to location_id generically

Zhang, Hawking Hawking.Zhang at amd.com
Thu Aug 8 01:41:04 UTC 2024


[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>

Regards,
Hawking
-----Original Message-----
From: Lazar, Lijo <Lijo.Lazar at amd.com>
Sent: Thursday, August 8, 2024 00:17
To: amd-gfx at lists.freedesktop.org; brahma_sw_dev <brahma_sw_dev at amd.com>
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Kim, Jonathan <Jonathan.Kim at amd.com>; Kasiviswanathan, Harish <Harish.Kasiviswanathan at amd.com>
Subject: [PATCH] drm/amdkfd: Add node_id to location_id generically

If there are multiple nodes per kfd device, add nodeid to location_id to differentiate.

Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index 40771f8752cb..e6caab75e863 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -2079,7 +2079,7 @@ int kfd_topology_add_device(struct kfd_node *gpu)
                        HSA_CAP_ASIC_REVISION_MASK);

        dev->node_props.location_id = pci_dev_id(gpu->adev->pdev);
-       if (KFD_GC_VERSION(dev->gpu->kfd) == IP_VERSION(9, 4, 3))
+       if (gpu->kfd->num_nodes > 1)
                dev->node_props.location_id |= dev->gpu->node_id;

        dev->node_props.domain = pci_domain_nr(gpu->adev->pdev->bus);
--
2.25.1



More information about the amd-gfx mailing list