Skip to content

ROCm versioning fix#215

Merged
liuyangzhuan merged 2 commits intoxiaoyeli:masterfrom
Heinrich-BR:HenriqueBR/hip_fix
Apr 10, 2026
Merged

ROCm versioning fix#215
liuyangzhuan merged 2 commits intoxiaoyeli:masterfrom
Heinrich-BR:HenriqueBR/hip_fix

Conversation

@Heinrich-BR
Copy link
Copy Markdown
Contributor

For certain HIP-enabled builds (in my case, I have been testing this on MI300x GPUs), SuperLU_DIST's CMake system fails to correctly find ROCm and as a result one gets a flurry of compiler errors as some kernel objects (threadIdx_x, blockIdx_x, __syncthreads etc) don't get correctly substituted.

In this PR, the HIP build path in SuperLU_DIST was updated to support modern ROCm (≥ ~4.5) and CMake (≥ 3.21). However, I have used branching to maintain the older path in order to keep backwards compatibility.

  • Modern path (default): Uses CMake's first-class HIP language support (find_package(hip CONFIG), enable_language(HIP), add_library() with LANGUAGE HIP). GPU architecture is selected via the standard -DCMAKE_HIP_ARCHITECTURES=<gfxNNN> variable. Links hip::device alongside roc::hipblas, roc::rocblas, and roc::rocsolver.
  • Legacy path (deprecated): The original FindHIP MODULE + hip_add_library() path is preserved behind a new option -DTPL_HIP_USE_LEGACY_FINDHIP=ON. If CMake < 3.21 is detected, this path is activated automatically. In both cases a deprecation warning is emitted at configure time.
    What changed
    CMakeLists.txt: For CMake < 3.21 there is an auto-fallback to the legacy FindHIP path plus a deprecation warning. Added TPL_HIP_USE_LEGACY_FINDHIP option to let users opt in explicitly. Branched the HIP_LIB target list and HIP_HIPCC_FLAGS handling by path.
    SRC/CMakeLists.txt: Branched the library creation between hip_add_library() (legacy) and add_library() + set_source_files_properties(... LANGUAGE HIP) (modern).

From the user's perspective, the only difference with the new path is that the way to let the build system know about the HIP target architecture is by using the option -DCMAKE_HIP_ARCHITECTURES=gfxNNN instead of -DHIP_HIPCC_FLAGS="--offload-arch=gfxNNN". In the modern path, the latter will be silently ignored.

@liuyangzhuan liuyangzhuan merged commit 68741f3 into xiaoyeli:master Apr 10, 2026
15 of 16 checks passed
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.

2 participants