Skip to content

Commit d05934e

Browse files
committed
[Offload] Adds buildbot for CMake cache file
The buildbot uses the offload/cmake/cache/AMDGPUBot.cmake file to create the build config. It uses an annotated builder for that and only performs the build step as most of the post-commit issues are build problems and not test errors.
1 parent b09e34a commit d05934e

File tree

3 files changed

+71
-34
lines changed

3 files changed

+71
-34
lines changed

buildbot/osuosl/master/config/builders.py

+12-32
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
'libunwind',
198198
'libcxx',
199199
'libcxxabi',
200-
'lld',
200+
'lld',
201201
],
202202
vs="autodetect",
203203
clean=True,
@@ -248,7 +248,7 @@
248248
'libunwind',
249249
'libcxx',
250250
'libcxxabi',
251-
'lld',
251+
'lld',
252252
],
253253
vs = "autodetect",
254254
clean = True,
@@ -1932,35 +1932,15 @@
19321932
add_openmp_lit_args=["--time-tests", "--timeout 100"],
19331933
)},
19341934

1935-
{'name' : "offload-runtime-openmp-amdgpu",
1935+
{'name' : "amdgpu-offload-ubuntu-22-cmake-build-only",
19361936
'tags' : ["openmp"],
1937-
'workernames' : ["rocm-worker-hw-03"],
1938-
'builddir': "offload-runtime-openmp-amdgpu",
1939-
'factory' : OpenMPBuilder.getOpenMPCMakeBuildFactory(
1940-
clean=True,
1941-
enable_runtimes=['openmp', 'offload'],
1942-
depends_on_projects=['llvm', 'clang', 'flang', 'lld', 'offload', 'openmp'],
1943-
extraCmakeArgs=[
1944-
"-DCMAKE_BUILD_TYPE=Release",
1945-
"-DCLANG_DEFAULT_LINKER=lld",
1946-
"-DLLVM_TARGETS_TO_BUILD=X86;AMDGPU",
1947-
"-DLLVM_ENABLE_ASSERTIONS=ON",
1948-
"-DCMAKE_C_COMPILER_LAUNCHER=ccache",
1949-
"-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",
1950-
],
1951-
env={
1952-
'HSA_ENABLE_SDMA':'0',
1953-
},
1954-
install=True,
1955-
testsuite=False,
1956-
testsuite_sollvevv=False,
1957-
extraTestsuiteCmakeArgs=[
1958-
"-DTEST_SUITE_SOLLVEVV_OFFLOADING_CFLAGS=-fopenmp-targets=amdgcn-amd-amdhsa;-Xopenmp-target=amdgcn-amd-amdhsa",
1959-
"-DTEST_SUITE_SOLLVEVV_OFFLOADING_LDLAGS=-fopenmp-targets=amdgcn-amd-amdhsa;-Xopenmp-target=amdgcn-amd-amdhsa",
1960-
],
1961-
add_lit_checks=["check-clang", "check-flang", "check-offload"],
1962-
add_openmp_lit_args=["--time-tests", "--timeout 100"],
1963-
)},
1937+
'workernames' : ["rocm-docker-ubu-22"],
1938+
'builddir': "bbot-build",
1939+
'factory' : AnnotatedBuilder.getAnnotatedBuildFactory(
1940+
script="amdgpu-offload-cmake.py",
1941+
checkout_llvm_sources=True,
1942+
script_interpreter=None
1943+
)},
19641944

19651945
{'name' : "openmp-offload-libc-amdgpu-runtime",
19661946
'tags' : ["openmp"],
@@ -3390,7 +3370,7 @@
33903370

33913371
all += [
33923372
# LLDB remote-linux builders.
3393-
3373+
33943374
# LLDB remote-linux on Ubuntu Linux host.
33953375
# The first stage uses pre-installed latest released Clang (see apt.llvm.org for details).
33963376
# The second stage uses pre-built cross Aarch64 Clang toolchain from the latest release branch
@@ -3518,7 +3498,7 @@
35183498
env = lldb_remote_linux_env.copy(),
35193499
)
35203500
},
3521-
3501+
35223502
# LLDB remote-linux on Windows host.
35233503
# The first stage builds the latest cross Aarch64 toolchain.
35243504
# The second stage uses just-built cross Aarch64 Clang toolchain

buildbot/osuosl/master/config/workers.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,16 @@ def get_all():
354354

355355
# OpenMP on AMDGPU, Ubuntu 18.04.5, Intel(R) Xeon(R) Gold 5218 @ 2.30GHz with 64GB Memory, 1 Vega20 GPU with 16GB Memory
356356
create_worker("omp-vega20-0", properties={'jobs': 32}, max_builds=1),
357+
# OpenMP / Offload / libc on AMDGPU
357358
create_worker("omp-vega20-1", properties={'jobs': 32}, max_builds=1),
358-
359359
# Flang OpenMP on AMDGPU, Ubuntu 22.04.3, AMD(R) EPYC 9354 @ 2.5GHz with 512GB Memory, 1 MI210 GPU with 64GB Memory
360360
create_worker("rocm-worker-hw-01", properties={'jobs': 64}, max_builds=1),
361361
create_worker("rocm-worker-hw-02", properties={'jobs': 64}, max_builds=1),
362-
create_worker("rocm-worker-hw-03", properties={'jobs': 64}, max_builds=1),
363362
create_worker("rocm-worker-hw-04-sles", properties={'jobs': 32}, max_builds=1),
364363
create_worker("rocm-worker-hw-04-rhel-9_4", properties={'jobs': 32}, max_builds=1),
365364
create_worker("rocm-worker-hw-04-rhel-8_8", properties={'jobs': 32}, max_builds=1),
365+
# Containerized build-only, using llvm-project/offload/cmake/caches/AMDGPUbot.cmake
366+
create_worker("rocm-docker-ubu-22", properties={'jobs': 32}, max_builds=1),
366367

367368
# AMD ROCm support, Ubuntu 18.04.6, AMD Ryzen @ 1.5 GHz, MI200 GPU
368369
create_worker("mi200-buildbot", max_builds=1),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/python
2+
3+
import argparse
4+
import os
5+
import subprocess
6+
import sys
7+
import traceback
8+
import util
9+
from contextlib import contextmanager
10+
11+
12+
def main(argv):
13+
source_dir = os.path.join("..", "llvm-project")
14+
offload_base_dir = os.path.join(source_dir, "offload")
15+
of_cmake_cache_base_dir = os.path.join(offload_base_dir, "cmake/caches")
16+
17+
with step("cmake", halt_on_fail=True):
18+
# TODO make the name of the cache file an argument to the script.
19+
cmake_cache_file = os.path.join(of_cmake_cache_base_dir, "AMDGPUBot.cmake")
20+
21+
# Use Ninja as the generator.
22+
# The other important settings alrady come from the CMake CMake
23+
# cache file inside LLVM
24+
cmake_args = ["-GNinja", "-C %s" % cmake_cache_file]
25+
26+
run_command(["cmake", os.path.join(source_dir, "llvm")] + cmake_args)
27+
28+
with step("build cmake config"):
29+
run_command(["ninja"])
30+
31+
32+
@contextmanager
33+
def step(step_name, halt_on_fail=False):
34+
util.report("@@@BUILD_STEP {}@@@".format(step_name))
35+
if halt_on_fail:
36+
util.report("@@@HALT_ON_FAILURE@@@")
37+
try:
38+
yield
39+
except Exception as e:
40+
if isinstance(e, subprocess.CalledProcessError):
41+
util.report("{} exited with return code {}.".format(e.cmd, e.returncode))
42+
util.report("The build step threw an exception...")
43+
traceback.print_exc()
44+
45+
util.report("@@@STEP_FAILURE@@@")
46+
finally:
47+
sys.stdout.flush()
48+
49+
50+
def run_command(cmd, directory="."):
51+
util.report_run_cmd(cmd, cwd=directory)
52+
53+
54+
if __name__ == "__main__":
55+
sys.path.append(os.path.dirname(__file__))
56+
sys.exit(main(sys.argv))

0 commit comments

Comments
 (0)