Skip to content

[offload-arch] Print Intel GPU architecture names instead of device names - #23048

Open
KornevNikita wants to merge 3 commits into
intel:syclfrom
KornevNikita:upd-offload-arch
Open

[offload-arch] Print Intel GPU architecture names instead of device names#23048
KornevNikita wants to merge 3 commits into
intel:syclfrom
KornevNikita:upd-offload-arch

Conversation

@KornevNikita

@KornevNikita KornevNikita commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The output of offload-arch is expected to be a list of names that are legal --offload-arch parameters, because the driver runs the utility for --offload-arch=native and feeds every line it prints to StringToOffloadArch. For Intel GPUs the utility printed the name of the device instead, e.g. Intel(R) Data Center GPU Max 1100, which is not a legal parameter.

The utility now queries the GMDID of each device with zeDeviceGetProperties and the device IP version extension (ZE_STRUCTURE_TYPE_DEVICE_IP_VERSION_EXT), and translates the architecture and release components of it into an architecture name:

  • A device listed in the new IntelGPUArch.def gets a human-friendly name, which covers almost every device a user is likely to have. The revision is deliberately not part of the lookup, so a new stepping of a known architecture keeps the same name.
  • Anything else is named after all three components of its GMDID, e.g. xe_40.11.0, so that a GPU newer than the compiler is still usable.

The table lives in its own .def file so that it can later be generated from the data published by the GPU driver — ocloc query SUPPORTED_DEVICES reports exactly these pairs. Where several devices share an architecture and a release, the first entry in the file names the whole group, which keeps the generator from having to pick a representative device.

Verified on an Intel Data Center GPU Max 1100 (GMDID 12.60.7): offload-arch prints xe-pvc where it used to print the device name.

Note that the driver does not accept these names yet: StringToOffloadArch currently knows only bmg_g21 among Intel GPUs, and OffloadArchToTriple returns an empty triple for Intel, so --offload-arch=native still fails after the utility prints a correct name. Wiring that up is separate work.

🤖 Generated with Claude Code

…ames

The output of this utility is expected to be a list of names that are legal
--offload-arch parameters, but for Intel GPUs it printed the name of the
device, e.g. "Intel(R) Data Center GPU Max 1100", which is not one.

Query the GMDID of each device with zeDeviceGetProperties and the device IP
version extension, and translate its architecture and release components into
an architecture name using the table in IntelGPUArch.def, which is meant to be
generated from the data published by the GPU driver.  A device that has no
entry in the table is named after all three components of its GMDID, e.g.
xe_40.11.0, so that a GPU newer than the compiler is still usable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit a7e6682f197f7603915e5de75bc17683f8be6455)
@KornevNikita

KornevNikita commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@intel/dpcpp-cfe-reviewers could you please review this draft before I open a PR to llvm-project?
Also pinging @adurang @hansangbae as they're familiar with this tool, although both are OOO.

UPD. we decided to start with intel/llvm first.

@tahonermann tahonermann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

// almost every device a user is likely to have; anything else gets a numeric
// name built from all three components of the GMDID.
std::string getIntelGPUArchName(uint32_t IPVersion) {
uint32_t Architecture = IPVersion >> GMDIDArchitectureShift;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The remaining 10 bits are all reserved for the architecture?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, IIUC 6 first bits for revision, 8 unusued bits, 8 bits for release, 10 bits for arch.

Comment thread clang/unittests/offload-arch/OffloadArchTest.cpp Outdated
@dm-vodopyanov

Copy link
Copy Markdown
Contributor

I believe we need to merge all the patches to intel/llvm first: we don't have too much time in this release, so the 1st priority - is to deliver the feature, 2nd priority - upstream FE/etc patches.

@gmlueck @tahonermann

@KornevNikita
KornevNikita marked this pull request as ready for review August 31, 2026 12:54
@KornevNikita
KornevNikita requested a review from a team as a code owner August 31, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants