Skip to content

[cmake][docs] Handle AMD code object ABI mismatch for ROCm < 6.3 - #757

Open
zjin-lcf wants to merge 1 commit into
uxlfoundation:developfrom
zjin-lcf:fix/rocm-code-object-version-687
Open

[cmake][docs] Handle AMD code object ABI mismatch for ROCm < 6.3#757
zjin-lcf wants to merge 1 commit into
uxlfoundation:developfrom
zjin-lcf:fix/rocm-code-object-version-687

Conversation

@zjin-lcf

Copy link
Copy Markdown
Contributor

Summary

Recent DPC++/LLVM defaults to AMD code object ABI version 6, which only ROCm 6.3+ supports, so building any domain against an older ROCm fails with cannot find ROCm device library for ABI version 6 (#687).

  • cmake/FindCompiler.cmake: auto-append -mcode-object-version=5 to the amdgcn compile/link options when ROCm < 6.3 is detected via .info/version (ROCM_PATH / HIPROOT / /opt/rocm), skipped if the user already set the flag.
  • docs/building_the_project_with_dpcpp.rst: document the toolchain issue and the manual -DCMAKE_CXX_FLAGS="-mcode-object-version=5" workaround.

Test plan

  • Reproduced the exact error targeting amdgcn against ROCm 6.2.4; confirmed -mcode-object-version=5 compiles cleanly (exit 0).
  • Exercised the real FindCompiler.cmake end-to-end: flag added for ROCm 6.2.4/6.0.3, absent for 6.3.4/7.2.4, opt-out honored when user sets the flag, safe fall-through when no version file is found.

Fixes #687

Recent DPC++/LLVM defaults to AMD code object ABI version 6, which is
only supported by ROCm 6.3+. Building any domain against an older ROCm
fails with "cannot find ROCm device library for ABI version 6".

Auto-append -mcode-object-version=5 to the amdgcn compile/link options
when ROCm < 6.3 is detected (and the user has not already set the flag),
and document the manual workaround in the ROCm build instructions.

Fixes uxlfoundation#687

Co-authored-by: Cursor <cursoragent@cursor.com>
@zjin-lcf
zjin-lcf requested a review from a team as a code owner August 11, 2026 15:29
@zjin-lcf

Copy link
Copy Markdown
Contributor Author

Hi @abagusetty, Could yo test again for #687 ? Thanks.

@abagusetty

Copy link
Copy Markdown
Contributor

Hi @zjin-lcf Sure, will give it a spin and let you know soon

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.

[roc*][DPC++] Build fails for rocm version < 6.3

2 participants