drm/amdkfd: set uuid for each partition in topology
authorEric Huang <jinhuieric.huang@amd.com>
Thu, 7 Aug 2025 18:23:11 +0000 (14:23 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 15 Aug 2025 17:04:02 +0000 (13:04 -0400)
Currently each kfd compute partition/node is sharing
the same uuid of AID, which doen't meet the CUDA spec
for visible device, so corresponding XCD id for each
partition in smu has been assigned to xcp, and exposed
to kfd topology.

v2: add NULL check (Lijo)

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c

index 4ec73f3..82dbd68 100644 (file)
@@ -530,6 +530,8 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
                sysfs_show_32bit_prop(buffer, offs, "sdma_fw_version",
                                      dev->gpu->kfd->sdma_fw_version);
                sysfs_show_64bit_prop(buffer, offs, "unique_id",
+                                     dev->gpu->xcp ?
+                                     dev->gpu->xcp->unique_id :
                                      dev->gpu->adev->unique_id);
                sysfs_show_32bit_prop(buffer, offs, "num_xcc",
                                      NUM_XCC(dev->gpu->xcc_mask));