Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Offload][AMDGPU] LLVM_ENABLE_RUNTIMES=flang-rt for amdgpu-offload-* #129692

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Mar 4, 2025

Enable the LLVM_ENABLE_RUNTIMES=flang-rt build of the Fortran runtime for the amdgpu-offload-* buildbots. This pre-population cmake cache files is referred to by the llvm-zorg annotated builder factory script.

The corresponding change in llvm-zorg is llvm/llvm-zorg#402

@llvmbot
Copy link
Member

llvmbot commented Mar 4, 2025

@llvm/pr-subscribers-offload

@llvm/pr-subscribers-backend-amdgpu

Author: Michael Kruse (Meinersbur)

Changes

Enable the LLVM_ENABLE_RUNTIMES=flang-rt build of the Fortran runtime for the amdgpu-offload-* buildbots. This pre-population cmake cache files is referred to by the llvm-zorg annotated builder factory script.

The corresponding change in llvm-zorg is llvm/llvm-zorg#402


Full diff: https://github.com/llvm/llvm-project/pull/129692.diff

1 Files Affected:

  • (modified) offload/cmake/caches/AMDGPUBot.cmake (+1-1)
diff --git a/offload/cmake/caches/AMDGPUBot.cmake b/offload/cmake/caches/AMDGPUBot.cmake
index 521841166be82..0236f5f0b6987 100644
--- a/offload/cmake/caches/AMDGPUBot.cmake
+++ b/offload/cmake/caches/AMDGPUBot.cmake
@@ -10,7 +10,7 @@ set(CMAKE_C_COMPILER_LAUNCHER ccache CACHE STRING "")
 set(CMAKE_CXX_COMPILER_LAUNCHER ccache CACHE STRING "")
 
 set(LLVM_ENABLE_PROJECTS "clang;lld;mlir;flang" CACHE STRING "")
-set(LLVM_ENABLE_RUNTIMES "compiler-rt;openmp;offload" CACHE STRING "")
+set(LLVM_ENABLE_RUNTIMES "compiler-rt;openmp;offload;flang-rt" CACHE STRING "")
 
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
 set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")

Meinersbur added a commit to llvm/llvm-zorg that referenced this pull request Mar 5, 2025
Add `depends_on_projects=['flang-rt']`, to the amdgpu-offload-* builders. The prepares the removal of the "projects" build of the flang runtime in llvm/llvm-project#124126.

The corresponding change in the LLVM repository is
llvm/llvm-project#129692

Affected builders (production):
* [amdgpu-offload-ubuntu-22-cmake-build-only](https://lab.llvm.org/buildbot/#/builders/203)
* [amdgpu-offload-rhel-9-cmake-build-only](https://lab.llvm.org/buildbot/#/builders/205)
* [amdgpu-offload-rhel-8-cmake-build-only](https://lab.llvm.org/buildbot/#/builders/204)

Affected workers (production):
 * [rocm-docker-ubu-22](https://lab.llvm.org/buildbot/#/workers/162)
 * [rocm-docker-rhel-9](https://lab.llvm.org/buildbot/#/workers/163)
 * [rocm-docker-rhel-8](https://lab.llvm.org/buildbot/#/workers/164)
Copy link
Contributor

@jplehr jplehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Meinersbur Meinersbur merged commit 68578b3 into main Mar 7, 2025
14 checks passed
@Meinersbur Meinersbur deleted the users/meinersbur/flang_runtime_amdgpu-offload branch March 7, 2025 10:56
@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder amdgpu-offload-rhel-8-cmake-build-only running on rocm-docker-rhel-8 while building offload at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/204/builds/2696

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
-- Building offloading runtime library libomptarget.
CMake Error at /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/CMakeLists.txt:58 (enable_language):
  The Ninja generator does not support Fortran using Ninja version

    1.8.2

  due to lack of required features.  Ninja 1.10 or higher is required.


-- Configuring incomplete, errors occurred!
FAILED: runtimes/runtimes-stamps/runtimes-configure /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-stamps/runtimes-configure 
cd /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-bins && /usr/bin/cmake --no-warn-unused-cli -DCMAKE_C_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/clang -DCMAKE_CXX_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/clang++ -DCMAKE_ASM_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/clang -DCMAKE_Fortran_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/flang -DCMAKE_LINKER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/ld.lld -DCMAKE_AR=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-ar -DCMAKE_RANLIB=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-ranlib -DCMAKE_NM=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-nm -DCMAKE_OBJDUMP=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-objdump -DCMAKE_OBJCOPY=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-objcopy -DCMAKE_STRIP=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-strip -DCMAKE_READELF=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-readelf -DCMAKE_C_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_CXX_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_Fortran_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_ASM_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/tmp/llvm.install.test -DLLVM_BINARY_DIR=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build -DLLVM_CONFIG_PATH=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/bin/llvm-config -DLLVM_ENABLE_WERROR=OFF -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_HAVE_LINK_VERSION_SCRIPT=1 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=OFF -DLLVM_USE_RELATIVE_PATHS_IN_FILES=OFF "-DLLVM_LIT_ARGS=-v --show-unsupported --timeout 100 --show-xfail -j 32" -DLLVM_SOURCE_PREFIX= -DPACKAGE_VERSION=21.0.0git -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja-build -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=ON -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_ENABLE_PROJECTS_USED=ON -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_Fortran_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DHAVE_LLVM_LIT=ON -DCLANG_RESOURCE_DIR= "-DLLVM_ENABLE_RUNTIMES=compiler-rt;openmp;offload;flang-rt" -DFFI_INCLUDE_DIR= -DFFI_LIBRARY_DIR= -DFLANG_RUNTIME_F128_MATH_LIB= -DLIBOMP_FORTRAN_MODULES_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/bin/flang -DLIBOMP_MODULES_INSTALL_PATH=include/flang -GNinja -C/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/projects/runtimes/tmp/runtimes-cache-Release.cmake -S /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/runtimes/../../runtimes -B /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-bins && /usr/bin/cmake -E touch /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-stamps/runtimes-configure
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 50, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 41, in main
    run_command(["ninja"])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 63, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@
Step 7 (build cmake config) failure: build cmake config (failure)
...
-- Building the llvm-offload-device-info tool
-- Building the llvm-omp-kernel-replay tool
-- Building offloading runtime library libomptarget.
CMake Error at /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang-rt/CMakeLists.txt:58 (enable_language):
  The Ninja generator does not support Fortran using Ninja version

    1.8.2

  due to lack of required features.  Ninja 1.10 or higher is required.
-- Configuring incomplete, errors occurred!
FAILED: runtimes/runtimes-stamps/runtimes-configure /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-stamps/runtimes-configure 
cd /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-bins && /usr/bin/cmake --no-warn-unused-cli -DCMAKE_C_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/clang -DCMAKE_CXX_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/clang++ -DCMAKE_ASM_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/clang -DCMAKE_Fortran_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/flang -DCMAKE_LINKER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/ld.lld -DCMAKE_AR=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-ar -DCMAKE_RANLIB=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-ranlib -DCMAKE_NM=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-nm -DCMAKE_OBJDUMP=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-objdump -DCMAKE_OBJCOPY=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-objcopy -DCMAKE_STRIP=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-strip -DCMAKE_READELF=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/./bin/llvm-readelf -DCMAKE_C_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_CXX_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_Fortran_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_ASM_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/tmp/llvm.install.test -DLLVM_BINARY_DIR=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build -DLLVM_CONFIG_PATH=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/bin/llvm-config -DLLVM_ENABLE_WERROR=OFF -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_HAVE_LINK_VERSION_SCRIPT=1 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=OFF -DLLVM_USE_RELATIVE_PATHS_IN_FILES=OFF "-DLLVM_LIT_ARGS=-v --show-unsupported --timeout 100 --show-xfail -j 32" -DLLVM_SOURCE_PREFIX= -DPACKAGE_VERSION=21.0.0git -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja-build -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=ON -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_ENABLE_PROJECTS_USED=ON -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_Fortran_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DHAVE_LLVM_LIT=ON -DCLANG_RESOURCE_DIR= "-DLLVM_ENABLE_RUNTIMES=compiler-rt;openmp;offload;flang-rt" -DFFI_INCLUDE_DIR= -DFFI_LIBRARY_DIR= -DFLANG_RUNTIME_F128_MATH_LIB= -DLIBOMP_FORTRAN_MODULES_COMPILER=/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/bin/flang -DLIBOMP_MODULES_INSTALL_PATH=include/flang -GNinja -C/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/projects/runtimes/tmp/runtimes-cache-Release.cmake -S /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/runtimes/../../runtimes -B /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-bins && /usr/bin/cmake -E touch /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/runtimes/runtimes-stamps/runtimes-configure
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 50, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 41, in main
    run_command(["ninja"])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 63, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib64/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1.
program finished with exit code 0
elapsedTime=71.628970

Meinersbur added a commit that referenced this pull request Mar 7, 2025
…fload-*" (#130274)

Reverts #129692

The builder amdgpu-offload-rhel-8-cmake-build-only fails because its
version of Ninja is too old. At least Ninja 1.10 is required for its
support for dependencies between Fortran modules.

https://lab.llvm.org/buildbot/#/builders/204/builds/2696
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Mar 7, 2025
…r amdgpu-offload-*" (#130274)

Reverts llvm/llvm-project#129692

The builder amdgpu-offload-rhel-8-cmake-build-only fails because its
version of Ninja is too old. At least Ninja 1.10 is required for its
support for dependencies between Fortran modules.

https://lab.llvm.org/buildbot/#/builders/204/builds/2696
@llvm-ci
Copy link
Collaborator

llvm-ci commented Mar 7, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-libc-amdgpu-runtime running on omp-vega20-1 while building offload at step 7 "Add check check-offload".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/14167

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-offload) failure: 1200 seconds without output running [b'ninja', b'-j 32', b'check-offload'], attempting to kill
...
PASS: libomptarget :: x86_64-unknown-linux-gnu-LTO :: offloading/bug49779.cpp (998 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu-LTO :: offloading/bug47654.cpp (999 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu-LTO :: offloading/bug50022.cpp (1000 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu-LTO :: offloading/test_libc.cpp (1001 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu-LTO :: offloading/wtime.c (1002 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: offloading/bug49021.cpp (1003 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu-LTO :: offloading/complex_reduction.cpp (1004 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: offloading/std_complex_arithmetic.cpp (1005 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu-LTO :: offloading/bug49021.cpp (1006 of 1008)
PASS: libomptarget :: x86_64-unknown-linux-gnu-LTO :: offloading/std_complex_arithmetic.cpp (1007 of 1008)
command timed out: 1200 seconds without output running [b'ninja', b'-j 32', b'check-offload'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=1235.612142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants