On Wed, Feb 11, 2026 at 5:14 PM Mario Limonciello <[email protected]> wrote: > > Add a new 'gpu_family' property to the KFD topology sysfs interface that > exposes the GPU family name in ROCm TheRock format (e.g., gfx110X, gfx90X). > > The property is algorithmically derived from gfx_target_version, which > encodes the version as MMMNNRR (major.minor.revision). The family name > follows the pattern "gfx{major}{minor}X", making it easy for users and > tools to identify which ROCm compiler target to use. > > The property only appears for GFX9 and newer GPUs, as older generations > predate TheRock targets. Unknown or unsupported GPUs will not display > the property. > > Example usage: > $ cat /sys/class/kfd/kfd/topology/nodes/1/properties | grep gpu_family > gpu_family gfx115X
I would call this isa_version or isa_family. gfx_target_version is the ISA version of a chip (i.e., the compiler target). It's not the same as the GC IP version or the chip family. That should help differentiate it and avoid confusion. Alex > > Signed-off-by: Mario Limonciello <[email protected]> > --- > The idea is that this can help a user figure out which wheels they need > for their hardware. > > Cc: [email protected] > Cc: [email protected] > Cc: [email protected] > drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 37 +++++++++++++++++++++++ > drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 1 + > 2 files changed, 38 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > index 08c63b4cc9a5f..ab029d87eb9ea 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c > @@ -471,6 +471,9 @@ static ssize_t node_show(struct kobject *kobj, struct > attribute *attr, > dev->node_props.max_slots_scratch_cu); > sysfs_show_32bit_prop(buffer, offs, "gfx_target_version", > dev->node_props.gfx_target_version); > + if (dev->node_props.gpu_family[0]) > + sysfs_show_gen_prop(buffer, offs, "gpu_family %s\n", > + dev->node_props.gpu_family); > sysfs_show_32bit_prop(buffer, offs, "vendor_id", > dev->node_props.vendor_id); > sysfs_show_32bit_prop(buffer, offs, "device_id", > @@ -2048,6 +2051,37 @@ static void kfd_topology_set_capabilities(struct > kfd_topology_device *dev) > kfd_topology_set_dbg_firmware_support(dev); > } > > +/** > + * kfd_get_gpu_family_name - Get GPU family name from gfx_target_version > + * @gfx_target_version: Numeric GPU target version > + * @family_name: Output buffer for family name > + * @size: Size of output buffer > + * > + * Converts gfx_target_version to TheRock family format (e.g., "gfx110X"). > + * The gfx_target_version encodes version as MMMNNRR where: > + * MMM = major version > + * NN = minor version > + * RR = revision > + * Family format is "gfx{major}{minor}X", e.g., 110501 (11.5.01) -> "gfx115X" > + * If the version is not recognized, family_name is set to empty string. > + */ > +static void kfd_get_gpu_family_name(uint32_t gfx_target_version, > + char *family_name, size_t size) > +{ > + int major, minor; > + > + /* Only support TheRock GPU families (GFX9 and newer) */ > + if (gfx_target_version < 90000) { > + family_name[0] = '\0'; > + return; > + } > + > + major = gfx_target_version / 10000; > + minor = (gfx_target_version / 100) % 100; > + > + snprintf(family_name, size, "gfx%d%dX", major, minor); > +} > + > int kfd_topology_add_device(struct kfd_node *gpu) > { > uint32_t gpu_id; > @@ -2105,6 +2139,9 @@ int kfd_topology_add_device(struct kfd_node *gpu) > > dev->node_props.gfx_target_version = > gpu->kfd->device_info.gfx_target_version; > + kfd_get_gpu_family_name(dev->node_props.gfx_target_version, > + dev->node_props.gpu_family, > + sizeof(dev->node_props.gpu_family)); > dev->node_props.vendor_id = gpu->adev->pdev->vendor; > dev->node_props.device_id = gpu->adev->pdev->device; > dev->node_props.capability |= > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h > b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h > index 3de8ec0043bb4..8e52dd59b53dd 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h > @@ -81,6 +81,7 @@ struct kfd_node_properties { > uint32_t eop_buffer_size; > uint32_t debug_memory_size; > char name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE]; > + char gpu_family[8]; /* GPU family name in TheRock format (e.g., > gfx110X) */ > }; > > struct kfd_mem_properties { > -- > 2.53.0 >
