Skip to content

Conversation

RossBrunton
Copy link
Contributor

On my system, this causes the device to now identify as "Radeon RX 7900
GRE" rather than "gfx1100". This matches Nvidia, which identifies as
(for example) "NVIDIA GeForce GT 1030".

On my system, this causes the device to now identify as "Radeon RX 7900
GRE" rather than "gfx1100". This matches Nvidia, which identifies as
(for example) "NVIDIA GeForce GT 1030".
@llvmbot
Copy link
Member

llvmbot commented Aug 27, 2025

@llvm/pr-subscribers-offload

@llvm/pr-subscribers-backend-amdgpu

Author: Ross Brunton (RossBrunton)

Changes

On my system, this causes the device to now identify as "Radeon RX 7900
GRE" rather than "gfx1100". This matches Nvidia, which identifies as
(for example) "NVIDIA GeForce GT 1030".


Full diff: https://github.com/llvm/llvm-project/pull/155632.diff

1 Files Affected:

  • (modified) offload/plugins-nextgen/amdgpu/src/rtl.cpp (+2-2)
diff --git a/offload/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
index 5f397436dffd1..a90bd65a9d908 100644
--- a/offload/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -2807,11 +2807,11 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
 
     Status = getDeviceAttrRaw(HSA_AMD_AGENT_INFO_PRODUCT_NAME, TmpChar);
     if (Status == HSA_STATUS_SUCCESS)
-      Info.add("Product Name", TmpChar);
+      Info.add("Product Name", TmpChar, "", DeviceInfo::NAME);
 
     Status = getDeviceAttrRaw(HSA_AGENT_INFO_NAME, TmpChar);
     if (Status == HSA_STATUS_SUCCESS)
-      Info.add("Device Name", TmpChar, "", DeviceInfo::NAME);
+      Info.add("Device Name", TmpChar);
 
     Status = getDeviceAttrRaw(HSA_AGENT_INFO_VENDOR_NAME, TmpChar);
     if (Status == HSA_STATUS_SUCCESS)

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this still prints both, because users definitely want to know what to pass to --offload-arch

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds counterproductive. The product name is not really actionable information

@jhuber6
Copy link
Contributor

jhuber6 commented Aug 27, 2025

This sounds counterproductive. The product name is not really actionable information

As long as we print the actually useful part we can include the marketing name, sometimes good to know. That's what rocminfo does as well.

@arsenm
Copy link
Contributor

arsenm commented Aug 27, 2025

What's the sample output with and without this patch, for both fields?

@jhuber6
Copy link
Contributor

jhuber6 commented Aug 27, 2025

To clarify, code name is the useful part. If the NVIDIA portion doesn't print that then it should be changed.

@RossBrunton
Copy link
Contributor Author

I've pushed up a change which leaves NAME as is, but adds PRODUCT_NAME as a new property.

For my AMD device, NAME will be gfx1100 while PRODUCT_NAME will be "Radeon RX 7900
GRE". On Nvidia, both NAME and PRODUCT_NAME will be something like "NVIDIA GeForce GT 1030" and the host device will have both values as "Virtual Host Device".

Although, would ARCH be a better name than NAME?

@RossBrunton RossBrunton requested a review from jhuber6 August 27, 2025 15:24
@jhuber6
Copy link
Contributor

jhuber6 commented Aug 27, 2025

I've pushed up a change which leaves NAME as is, but adds PRODUCT_NAME as a new property.

For my AMD device, NAME will be gfx1100 while PRODUCT_NAME will be "Radeon RX 7900 GRE". On Nvidia, both NAME and PRODUCT_NAME will be something like "NVIDIA GeForce GT 1030" and the host device will have both values as "Virtual Host Device".

Although, would ARCH be a better name than NAME?

rocminfo calls it name so it should be fine.

@shiltian
Copy link
Contributor

IMHO if both product name and code name are shown, then it'd be fine.

@RossBrunton
Copy link
Contributor Author

@shiltian This PR doesn't affect anything being printed (this is the liboffload interface). #155626 adds a tool that prints device information, and I'll update that when this is merged (or this when that is merged).

@RossBrunton RossBrunton merged commit 41fed2d into llvm:main Aug 28, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants