[PATCH] drm/amdkfd:Check use_xgmi_p2p before reporting hive_id

Divya Shikre DivyaUday.Shikre at amd.com
Tue Mar 22 19:23:26 UTC 2022


XGMI iolinks will not be created in KFD topology when use_xgmi_p2p module parameter
is disabled in a dGPU.
In this case PCIe p2p links will be used instead.

Signed-off-by: Divya Shikre <DivyaUday.Shikre at amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 339e12c94cff..d5536e33b3d8 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -536,7 +536,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 		goto kfd_doorbell_error;
 	}
 
-	kfd->hive_id = kfd->adev->gmc.xgmi.hive_id;
+	if (amdgpu_use_xgmi_p2p)
+		kfd->hive_id = kfd->adev->gmc.xgmi.hive_id;
 
 	kfd->noretry = kfd->adev->gmc.noretry;
 
-- 
2.25.1



More information about the amd-gfx mailing list