Skip to content

fix: use correct GPU architecture list and HIP linker language - #45

Open
david-salinas wants to merge 1 commit into
ROCm:mainfrom
david-salinas:users/dsalinas/fix-hip-architectures
Open

david-salinas wants to merge 1 commit into
ROCm:mainfrom
david-salinas:users/dsalinas/fix-hip-architectures

Conversation

@david-salinas

@david-salinas david-salinas commented Nov 26, 2026 •

Copy link
Copy Markdown

HIP_ARCHITECTURES was set to "${DEFAULT_AMDGPU_TARGETS}", which is undefined, leaving the property empty. This was harmless with the legacy hipcc-based FindHIP but causes a CMake generate error with the new FindHIP.cmake compatibility shim that tags sources as LANGUAGE HIP:

CMake Error: HIP_ARCHITECTURES is empty for target "rochpl".

Replace with "${TARGETS}", the arch list already built at lines 91-110 and used to populate HIP_HIPCC_FLAGS.

Also set LINKER_LANGUAGE to HIP when CMAKE_HIP_COMPILER is available, since the shim-built target needs --hip-link which GCC does not recognize.

Fixes: ROCM-34604

Motivation

ROCm 10.3.0-20261116 and later ship a FindHIP.cmake compatibility shim (rocm-systems #15363) that enables CMake's native HIP language for hip_add_executable / hip_add_library callers. This makes CMake enforce non-empty HIP_ARCHITECTURES on targets with HIP sources. rocHPL's CMakeLists.txt has used the undefined variable DEFAULT_AMDGPU_TARGETS since 2022, which is now fatal. The build fails at generate time and no rochpl binary is produced, blocking rocHPL and rocHPL-MxP test suites on very nightly since 10.3.0-20261116.

Technical Details

Two changes in CMakeLists.txt:

  1. HIP_ARCHITECTURES (line 179): Replace "${DEFAULT_AMDGPU_TARGETS}" (undefined, always empty) with "${TARGETS}" — the architecture list rocHPL already builds at lines 91-110 based on HIP_VERSION and uses to populate HIP_HIPCC_FLAGS with --offload-arch flags.
  2. LINKER_LANGUAGE (line 170): When CMAKE_HIP_COMPILER is available (shim-enabled builds), set LINKER_LANGUAGE HIP so CMake links with amdclang++ using --hip-link. Without this, CMake tries to link with GCC, which rejects --hip-link. The CXX fallback is preserved for the legacy path.

Both changes are backward-compatible with the legacy (non-shim) FindHIP.

Related: rocm-systems #15363 (FindHIP shim change that exposed this issue)

Test Plan

  • Validated on mkm-ubb4-3 (MI200, gfx90a, RHEL 10.1) with the 10.3.0-20261118 shim FindHIP (per ROCM-34604 triage)
  • Before fix: cmake fails with HIP_ARCHITECTURES is empty for target "rochpl" (exit 1)
  • After fix: cmake generates successfully, make -j64 builds bin/rochpl (Linking HIP executable bin/rochpl, exit 0)
  • The same patched tree also builds with the legacy FindHIP

Test Result

Build succeeds on the shim path and the legacy path. Full numerical validation (rochpl -P 1 -Q 1 -N 8192 --NB 512, expect PASSED residual) requires the updated FindHIP.cmake shim from rocm-systems #15762 which applies HIP_HIPCC_FLAGS selectively to HIP sources only.

Submission Checklist

HIP_ARCHITECTURES was set to "${DEFAULT_AMDGPU_TARGETS}", which is
undefined, leaving the property empty. This was harmless with the
legacy hipcc-based FindHIP but causes a CMake generate error with
the new FindHIP.cmake compatibility shim that tags sources as
LANGUAGE HIP:

  CMake Error: HIP_ARCHITECTURES is empty for target "rochpl".

Replace with "${TARGETS}", the arch list already built at lines
91-110 and used to populate HIP_HIPCC_FLAGS.

Also set LINKER_LANGUAGE to HIP when CMAKE_HIP_COMPILER is
available, since the shim-built target needs --hip-link which GCC
does not recognize.

Fixes: ROCM-34604

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant