Skip to content

Conversation

HereThereBeDragons
Copy link

Motivation

Commit ROCm/TheRock@267c4d9 enabled to build hostexec but it does not build with cmake 4. However, TheRock promises since ROCm/TheRock#1440 to build with cmake 4 and as such this needs to be fixed.

Technical Details

Bump the minimum required cmake version for hostexec from 3.0 to 3.20.0 to enable building with cmake4. This is the same minimum required version as the parent directory "offload" uses.

Bump the minimum required cmake version from 3.0 to 3.20.0 to enable
building with cmake4. This is the same minimum required version as the
parent directory "offload" uses.
@lamikr
Copy link

lamikr commented Sep 25, 2025

I tested with the amd-llvm version and without this patch the build with cmake 4.1.0 would produce a following error:

0.8     -- Building the llvm-omp-kernel-replay tool
0.8     CMake Error at /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/compiler/amd-llvm/offload/hostexec/CMakeLists.txt:13 (cmake_minimum_required):
0.8       Compatibility with CMake < 3.5 has been removed from CMake.
0.8
0.8       Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
0.8       to tell CMake that the project requires at least <min> but has been updated
0.8       to work with policies introduced by <max> or earlier.
0.8
0.8       Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
0.8
0.8
0.8     -- Configuring incomplete, errors occurred!
0.9     FAILED: runtimes/runtimes-stamps/runtimes-configure /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/build/compiler/amd-llvm/build/runtimes/runtimes-stamps/runtimes-configure

When this patch is applied, llvm-build worked both with the cmake 3.28.3 and with the cmake 4.1.0.

226.9   -- Building the llvm-omp-kernel-replay tool
226.9   -- Building hostexec for AMDGCN linked against libhsa
226.9   -- HSA Runtime found: /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/build/compiler/amd-llvm/build/runtimes/rocr-runtime-prefix/src/rocr-runtime-build/rocr/lib/libhsa-runtime64.so
226.9   -- HSA Runtime include: /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/rocm-systems/projects/rocr-runtime/ annruntime/hsa-runtime/inc
226.9   -- Not building hostexec for NVPTX because cuda not found
226.9      -- Building hostexec with LLVM 20.0.0git found with CLANG_TOOL /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/build/compiler/amd-llvm/build/bin/clang
226.9   -- Building DeviceRTL. Using clang: /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/build/compiler/amd-llvm/build/bin/clang, llvm-link: /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/build/compiler/amd-llvm/build/bin/llvm-link and opt: /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/build/compiler/amd-llvm/build/bin/opt
226.9   -- Building offloading runtime library libomptarget.
226.9   -- Configuring done (0.5s)
227.2   -- Generating done (0.3s)
227.2   -- Build files have been written to: /home/lamikr/own/rock/src/sdk/therock_gfx1100_v2/build/compiler/amd-llvm/build/runtimes/runtimes-bins

After that I tested the the llvm-version build both with the cmake 3.28.3 and 4.1.0 to build the rest of the rocm-stack and pytorch and kernel loading to AMD gpu's worked ok with my pytorch and triton test spps.

cmake version does not probably affect to lit-test, so they are relevant for this. They passed anyway for command:

lit amd-llvm/openmp/runtime/test/ompt

Not sure how to do more testing for this one.

@marbre
Copy link
Member

marbre commented Sep 25, 2025

Not sure how to do more testing for this one.

There is no need for further testing on our side. The LLVM team has picked this up and are on it but this will go to an internal repo first.

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.

3 participants