* [RFC] amdkfd: Add GPU family name property to KFD topology
@ 2026-02-11 22:13 Mario Limonciello
2026-02-11 22:25 ` Alex Deucher
0 siblings, 1 reply; 3+ messages in thread
From: Mario Limonciello @ 2026-02-11 22:13 UTC (permalink / raw)
To: amd-gfx; +Cc: Mario Limonciello, Stella.Laurenzo, Slobodan.Josic,
Filip.Jankovic
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
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
The idea is that this can help a user figure out which wheels they need
for their hardware.
Cc: Stella.Laurenzo@amd.com
Cc: Slobodan.Josic@amd.com
Cc: Filip.Jankovic@amd.com
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC] amdkfd: Add GPU family name property to KFD topology
2026-02-11 22:13 [RFC] amdkfd: Add GPU family name property to KFD topology Mario Limonciello
@ 2026-02-11 22:25 ` Alex Deucher
2026-02-13 0:22 ` Mario Limonciello
0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2026-02-11 22:25 UTC (permalink / raw)
To: Mario Limonciello
Cc: amd-gfx, Stella.Laurenzo, Slobodan.Josic, Filip.Jankovic
On Wed, Feb 11, 2026 at 5:14 PM Mario Limonciello
<mario.limonciello@amd.com> 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 <mario.limonciello@amd.com>
> ---
> The idea is that this can help a user figure out which wheels they need
> for their hardware.
>
> Cc: Stella.Laurenzo@amd.com
> Cc: Slobodan.Josic@amd.com
> Cc: Filip.Jankovic@amd.com
> 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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC] amdkfd: Add GPU family name property to KFD topology
2026-02-11 22:25 ` Alex Deucher
@ 2026-02-13 0:22 ` Mario Limonciello
0 siblings, 0 replies; 3+ messages in thread
From: Mario Limonciello @ 2026-02-13 0:22 UTC (permalink / raw)
To: Alex Deucher; +Cc: amd-gfx, Stella.Laurenzo, Slobodan.Josic, Filip.Jankovic
On 2/11/2026 4:25 PM, Alex Deucher wrote:
> On Wed, Feb 11, 2026 at 5:14 PM Mario Limonciello
> <mario.limonciello@amd.com> 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
>
Thanks, I guess of those options I would say based on how things are
named in TheRock isa_family feels more logical.
But now I'm not sure if directionally this property will really be
useful or not. I noticed that the apt packages and wheels aren't
actually split
up this way anymore.
>>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>> The idea is that this can help a user figure out which wheels they need
>> for their hardware.
>>
>> Cc: Stella.Laurenzo@amd.com
>> Cc: Slobodan.Josic@amd.com
>> Cc: Filip.Jankovic@amd.com
>> 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
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-13 0:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-11 22:13 [RFC] amdkfd: Add GPU family name property to KFD topology Mario Limonciello
2026-02-11 22:25 ` Alex Deucher
2026-02-13 0:22 ` Mario Limonciello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox