Fix ROCm EP build for gfx1152, add Docker build recipe - #1
Open
zetyquickly wants to merge 1 commit into
Open
Conversation
GPU_WARP_SIZE (onnxruntime/core/providers/rocm/cu_inc/common.cuh): `constexpr int GPU_WARP_SIZE = warpSize;` fails to compile on this ROCm's bundled clang (23.0.0git) on both the host and device compilation passes of this dual-compiled header -- warpSize's host-visible form has a non-constexpr operator int(). Device pass now derives the value from __AMDGCN_CUMODE__ (0 = WGP/wave32 for RDNA chips like gfx1152, 1 = CU/ wave64 for CDNA/GCN); host pass uses a fixed literal, since that value is never used for actual kernel execution there -- genuinely dynamic runtime code already uses GPU_WARP_SIZE_HOST a few lines below. optimizer_api.h: adds a missing `#include <cstdint>` -- this GCC's libstdc++ dropped an implicit transitive include the file relied on. docker/gfx1152/: a Dockerfile (ROCm 7.14 + full build toolchain on ubuntu:26.04, matching this chip's actual ROCm install) plus a README documenting the full build recipe, why this branch targets the v1.22.2 tag rather than main (ROCm EP was deleted from main in PR microsoft#25181, no active development, Microsoft's stated direction is the MIGraphX EP instead), the two build flags needed to route around unrelated dead ends (onnxruntime_USE_COMPOSABLE_KERNEL=OFF, --disable_contrib_ops), and every environment gotcha hit along the way (cert ordering, missing -dev packages, a dangling Python symlink across a bind mount, wheel Python-tag mismatches, missing setuptools in the build venv). Verified end-to-end: installed the resulting wheel and ran Docling's ONNX-backed layout model (RT-DETR) through ROCMExecutionProvider on a real AMD Ryzen AI 7 PRO 350 (Radeon 860M, gfx1152) GPU -- correct output, no crash. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
GPU_WARP_SIZEinonnxruntime/core/providers/rocm/cu_inc/common.cuh:constexpr int GPU_WARP_SIZE = warpSize;doesn't compile on this ROCm's bundled clang (23.0.0git) on either the host or device pass of this dual-compiled header —warpSize's host-visible form has a non-constexpr operator int(). Device pass now derives the value from__AMDGCN_CUMODE__(0 = WGP/wave32 for RDNA chips likegfx1152, 1 = CU/wave64 for CDNA/GCN); host pass uses a fixed literal, since that value is never used for actual kernel execution there — genuinely dynamic runtime code already usesGPU_WARP_SIZE_HOSTa few lines below.#include <cstdint>tooptimizer_api.h(this GCC's libstdc++ dropped an implicit transitive include the file relied on).docker/gfx1152/: a Dockerfile (ROCm 7.14 + full build toolchain onubuntu:26.04) and a README with the full build recipe, why this is based on thev1.22.2tag rather thanmain(ROCm EP was deleted frommainin microsoft#25181 — no active development, Microsoft's stated direction is the MIGraphX EP instead), the two build flags needed to route around unrelated dead ends (onnxruntime_USE_COMPOSABLE_KERNEL=OFF,--disable_contrib_ops), and every environment gotcha hit along the way.This branch has no realistic merge target upstream (
mainno longer has this code at all), so this base branch (v1.22.2-base, pointing at thev1.22.2tag) exists purely so this PR's diff shows only the actual changes instead of the full divergence betweenv1.22.2andmain.Test plan
docker/gfx1152/ROCMExecutionProvideron a real AMD Ryzen AI 7 PRO 350 (Radeon 860M,gfx1152) GPU — correct output, no crash🤖 Generated with Claude Code