[offload-arch] Print Intel GPU architecture names instead of device names - #23048
Open
KornevNikita wants to merge 3 commits into
Open
[offload-arch] Print Intel GPU architecture names instead of device names#23048KornevNikita wants to merge 3 commits into
KornevNikita wants to merge 3 commits into
Conversation
…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)
Contributor
Author
|
@intel/dpcpp-cfe-reviewers could you please review this draft before I open a PR to llvm-project? UPD. we decided to start with intel/llvm first. |
tahonermann
reviewed
Aug 28, 2026
| // 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; |
Contributor
There was a problem hiding this comment.
The remaining 10 bits are all reserved for the architecture?
Contributor
Author
There was a problem hiding this comment.
Yeah, IIUC 6 first bits for revision, 8 unusued bits, 8 bits for release, 10 bits for arch.
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. |
dm-vodopyanov
approved these changes
Aug 31, 2026
KornevNikita
marked this pull request as ready for review
August 31, 2026 12:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The output of
offload-archis expected to be a list of names that are legal--offload-archparameters, because the driver runs the utility for--offload-arch=nativeand feeds every line it prints toStringToOffloadArch. 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
zeDeviceGetPropertiesand 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:IntelGPUArch.defgets 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.xe_40.11.0, so that a GPU newer than the compiler is still usable.The table lives in its own
.deffile so that it can later be generated from the data published by the GPU driver —ocloc query SUPPORTED_DEVICESreports 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-archprintsxe-pvcwhere it used to print the device name.Note that the driver does not accept these names yet:
StringToOffloadArchcurrently knows onlybmg_g21among Intel GPUs, andOffloadArchToTriplereturns an empty triple for Intel, so--offload-arch=nativestill fails after the utility prints a correct name. Wiring that up is separate work.🤖 Generated with Claude Code