Skip to content

Commit 281cfbb

Browse files
derobinsclaude
andcommitted
Focus CI on the latest ROCm and amdclang
hipObject will be built with the latest ROCm's amdclang in rocm-systems and TheRock, so CI now builds with that unless a job exists to try something else. Every CI build uses ROCm 10.1.0, apart from the hardware tests, whose guests run ROCm 10.0, and the nightly packages. The Build workflow's jobs are listed one by one rather than made by crossing axes. All of them use HIPOBJ_WERROR: - Core jobs, amdclang on Ubuntu 26.04: RelWithDebInfo; Debug with HIPOBJ_USE_SANITIZERS; RelWithDebInfo with HIPOBJ_USE_THREAD_SANITIZER, as TheRock's TSan builds are; and Debug with code coverage. - Smoke tests with amdclang: a static Release build (TheRock builds only shared libraries, and Release is its default), both NIC backends off, C++23, and C++26. - Upstream Clang 21, and GCC 15 with and without HIPOBJ_USE_SANITIZERS, for the problems amdclang misses. - Ubuntu 24.04's GCC 13 and Clang 18, with its CMake 3.28. Other workflows: - The nightly builds its packages with each ROCm version's amdclang. - clang-tidy, IWYU, and the MinIO integration check use the Ubuntu 26.04 and ROCm 10.1.0 image. clang-tidy stays at LLVM 23, the newest release on apt.llvm.org, since ROCm 10.1's LLVM 24 only has snapshots there. - IWYU, the MinIO integration check, the hardware tests, and ci/ernic/run-local.sh build with amdclang. run-local.sh sets the compiler on the cmake command line, so a build directory left from an earlier run with GCC is reconfigured. IWYU parses with the clang it was built with (Clang 19 on Ubuntu 26.04), which rejects flags newer than itself, such as amdclang's -fno-strict-bool. HIPOBJIWYU.cmake now reads that clang's version, and a Clang build with HIPOBJ_USE_IWYU uses only the flags both compilers have, hardening flags included. Builds without HIPOBJ_USE_IWYU are unchanged. iwyu-wrapper.sh passes a lone --version straight to IWYU, without recording it as a run. applyVendorQpAttrs()'s attr parameter is [[maybe_unused]], since nothing uses it when HIPOBJ_BNXT and HIPOBJ_IONIC are both off, which made HIPOBJ_WERROR fail the build. AGENTS.md, docs/building.rst, and CHANGELOG.md describe the new CI coverage, the nightly's compiler, and what HIPOBJ_USE_IWYU leaves out. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5657f56 commit 281cfbb

18 files changed

Lines changed: 268 additions & 86 deletions

‎.github/workflows/hipobject-build.yml‎

Lines changed: 119 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -52,54 +52,125 @@ defaults:
5252

5353
jobs:
5454
build:
55-
name: >-
56-
Build (${{ matrix.shared_libs == 'ON' && 'shared' || 'static' }}${{ matrix.sanitizer == 'asan' && ', ASan and UBSan' || matrix.sanitizer == 'tsan' && ', TSan' || '' }}${{ matrix.coverage == 'ON' && ', coverage' || '' }}${{ matrix.build_type && format(', {0}', matrix.build_type) || '' }})
55+
name: Build (${{ matrix.label }})
5756
runs-on: ubuntu-latest
5857
strategy:
59-
# Every other workflow builds the default configuration (shared
60-
# library, no sanitizers), so this is the only place the static,
61-
# sanitizer, and code coverage configurations get compiled and tested.
6258
# Let every job finish so a failure in one doesn't hide the state of
6359
# the others.
6460
fail-fast: false
61+
# The jobs are listed one by one rather than made by crossing axes,
62+
# since most of them change one thing from the first job, and
63+
# crossing would build combinations nobody needs. Every job sets
64+
# label, ubuntu, cc, cxx, and build_type. A job that leaves out one
65+
# of the other keys gets its default:
66+
#
67+
# shared_libs ON. TheRock only builds shared libraries.
68+
# sanitizer None. asan is HIPOBJ_USE_SANITIZERS (ASan, UBSan,
69+
# and the compiler's other checks), and tsan is
70+
# HIPOBJ_USE_THREAD_SANITIZER.
71+
# coverage OFF
72+
# cxx_standard 20
73+
# backends ON, which turns on both HIPOBJ_BNXT and
74+
# HIPOBJ_IONIC
75+
# packages None. Extra apt packages, such as a compiler.
76+
#
77+
# Every job uses ROCm 10.1.0, the latest ROCm (see the image below).
6578
matrix:
66-
shared_libs: [ON, OFF]
67-
# asan is HIPOBJ_USE_SANITIZERS, tsan is HIPOBJ_USE_THREAD_SANITIZER,
68-
# and empty is neither
69-
sanitizer: ['']
70-
coverage: [OFF]
71-
# Empty means the CMakeLists.txt default (RelWithDebInfo)
72-
build_type: ['']
7379
include:
74-
# Two sanitizer jobs with the default configuration: one with
75-
# every sanitizer except ThreadSanitizer, and one with
76-
# ThreadSanitizer. They build with ROCm's Clang, which has more
77-
# checks than GCC. They build Debug, so they're also where the
78-
# library's assert()s are checked, and sanitizer reports aren't
79-
# muddied by optimization.
80-
- shared_libs: ON
81-
sanitizer: asan
82-
coverage: OFF
80+
# The core jobs build with ROCm's amdclang on the newest Ubuntu
81+
# release, as TheRock will build hipObject.
82+
- label: amdclang, RelWithDebInfo
83+
ubuntu: '26.04'
84+
cc: /opt/rocm/llvm/bin/amdclang
85+
cxx: /opt/rocm/llvm/bin/amdclang++
86+
build_type: RelWithDebInfo
87+
# Debug, so the library's assert()s are checked with the
88+
# sanitizers on, and the reports aren't muddied by optimization
89+
- label: amdclang, Debug, ASan and UBSan
90+
ubuntu: '26.04'
91+
cc: /opt/rocm/llvm/bin/amdclang
92+
cxx: /opt/rocm/llvm/bin/amdclang++
8393
build_type: Debug
94+
sanitizer: asan
95+
# RelWithDebInfo, as TheRock's ThreadSanitizer builds are, so the
96+
# threads' timing is closer to a normal build's
97+
- label: amdclang, RelWithDebInfo, TSan
98+
ubuntu: '26.04'
8499
cc: /opt/rocm/llvm/bin/amdclang
85100
cxx: /opt/rocm/llvm/bin/amdclang++
86-
- shared_libs: ON
101+
build_type: RelWithDebInfo
87102
sanitizer: tsan
88-
coverage: OFF
89-
build_type: Debug
103+
# Debug, so the report's lines match the source. Coverage needs
104+
# Clang.
105+
- label: amdclang, Debug, coverage
106+
ubuntu: '26.04'
90107
cc: /opt/rocm/llvm/bin/amdclang
91108
cxx: /opt/rocm/llvm/bin/amdclang++
92-
# One code coverage job with the default configuration. Coverage
93-
# needs Clang, so it builds with ROCm's, too. It builds Debug, so
94-
# the report's lines match the source.
95-
- shared_libs: ON
96-
sanitizer: ''
97-
coverage: ON
98109
build_type: Debug
110+
coverage: ON
111+
# Smoke tests of what the core jobs don't build. Release is
112+
# TheRock's default build type.
113+
- label: amdclang, Release, static
114+
ubuntu: '26.04'
115+
cc: /opt/rocm/llvm/bin/amdclang
116+
cxx: /opt/rocm/llvm/bin/amdclang++
117+
build_type: Release
118+
shared_libs: OFF
119+
- label: amdclang, no NIC backends
120+
ubuntu: '26.04'
121+
cc: /opt/rocm/llvm/bin/amdclang
122+
cxx: /opt/rocm/llvm/bin/amdclang++
123+
build_type: RelWithDebInfo
124+
backends: OFF
125+
- label: amdclang, C++23
126+
ubuntu: '26.04'
99127
cc: /opt/rocm/llvm/bin/amdclang
100128
cxx: /opt/rocm/llvm/bin/amdclang++
129+
build_type: RelWithDebInfo
130+
cxx_standard: 23
131+
# C++26 needs CMake 3.30 or later, which Ubuntu 24.04 doesn't have
132+
- label: amdclang, C++26
133+
ubuntu: '26.04'
134+
cc: /opt/rocm/llvm/bin/amdclang
135+
cxx: /opt/rocm/llvm/bin/amdclang++
136+
build_type: RelWithDebInfo
137+
cxx_standard: 26
138+
# Upstream Clang, the version Ubuntu installs as clang
139+
- label: Clang 21
140+
ubuntu: '26.04'
141+
cc: clang-21
142+
cxx: clang++-21
143+
build_type: RelWithDebInfo
144+
packages: clang-21
145+
# GCC is a second set of eyes: its warnings and sanitizers find
146+
# problems that Clang's don't. The sanitizer job builds
147+
# RelWithDebInfo, since the amdclang one builds Debug.
148+
- label: GCC 15
149+
ubuntu: '26.04'
150+
cc: gcc-15
151+
cxx: g++-15
152+
build_type: RelWithDebInfo
153+
- label: GCC 15, ASan and UBSan
154+
ubuntu: '26.04'
155+
cc: gcc-15
156+
cxx: g++-15
157+
build_type: RelWithDebInfo
158+
sanitizer: asan
159+
# The oldest supported Ubuntu release, with older compilers and
160+
# an older CMake (3.28)
161+
- label: Ubuntu 24.04, GCC 13
162+
ubuntu: '24.04'
163+
cc: gcc-13
164+
cxx: g++-13
165+
build_type: RelWithDebInfo
166+
- label: Ubuntu 24.04, Clang 18
167+
ubuntu: '24.04'
168+
cc: clang-18
169+
cxx: clang++-18
170+
build_type: RelWithDebInfo
171+
packages: clang-18
101172
container:
102-
image: rocm/dev-ubuntu-24.04:10.0.0-full
173+
image: rocm/dev-ubuntu-${{ matrix.ubuntu }}:10.1.0-full
103174
options: --user root
104175
env:
105176
ROCM_PATH: /opt/rocm
@@ -119,8 +190,14 @@ jobs:
119190
#
120191
# The MinIO bridge needs nlohmann-json3-dev and libpugixml-dev.
121192
# libcurlpp-dev saves downloading and building curlpp.
193+
#
194+
# A job's packages (EXTRA_PACKAGES) are separated by spaces, so read
195+
# splits them into an array with one package in each element.
122196
- name: Install dependencies
197+
env:
198+
EXTRA_PACKAGES: ${{ matrix.packages }}
123199
run: |
200+
read -ra extra_packages <<< "${EXTRA_PACKAGES}"
124201
apt-get update
125202
apt-get install -y \
126203
cmake \
@@ -131,18 +208,18 @@ jobs:
131208
libpugixml-dev \
132209
libssl-dev \
133210
nlohmann-json3-dev \
134-
rpm
211+
rpm \
212+
"${extra_packages[@]}"
135213
136214
# HIPOBJ_WERROR makes a new warning fail the build. It only
137215
# covers hipObject's own targets, not the code FetchContent pulls in.
138216
#
139217
# Every job but the coverage job builds the MinIO bridge, so it's
140-
# compiled with GCC's warnings in each configuration and ctest's
141-
# install and package tests include it. The coverage report only
142-
# measures src/, so the bridge would only slow that job down.
218+
# compiled with each compiler's warnings and ctest's install and
219+
# package tests include it. The coverage report only measures src/,
220+
# so the bridge would only slow that job down.
143221
#
144-
# CMake picks the compilers up from CC and CXX, and ignores them when
145-
# they're empty, as they are for the jobs that don't set cc and cxx.
222+
# CMake picks the compilers up from CC and CXX.
146223
- name: Configure
147224
env:
148225
CC: ${{ matrix.cc }}
@@ -152,13 +229,14 @@ jobs:
152229
-DCMAKE_PREFIX_PATH=/opt/rocm \
153230
-DBUILD_TESTING=ON \
154231
-DHIPOBJ_WERROR=ON \
155-
-DHIPOBJ_BNXT=ON \
156-
-DHIPOBJ_IONIC=ON \
232+
-DHIPOBJ_BNXT=${{ matrix.backends || 'ON' }} \
233+
-DHIPOBJ_IONIC=${{ matrix.backends || 'ON' }} \
157234
-DHIPOBJ_MINIO_CLIENT=${{ matrix.coverage == 'ON' && 'OFF' || 'ON' }} \
158-
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} \
235+
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs || 'ON' }} \
236+
-DHIPOBJ_CXX_STANDARD=${{ matrix.cxx_standard || '20' }} \
159237
-DHIPOBJ_USE_SANITIZERS=${{ matrix.sanitizer == 'asan' && 'ON' || 'OFF' }} \
160238
-DHIPOBJ_USE_THREAD_SANITIZER=${{ matrix.sanitizer == 'tsan' && 'ON' || 'OFF' }} \
161-
-DHIPOBJ_USE_CODE_COVERAGE=${{ matrix.coverage }} \
239+
-DHIPOBJ_USE_CODE_COVERAGE=${{ matrix.coverage || 'OFF' }} \
162240
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
163241
164242
- name: Build

‎.github/workflows/hipobject-clang-tidy.yml‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ name: hipObject - clang-tidy
88
# This uses upstream clang-tidy rather than ROCm's, which is built
99
# without the clang-analyzer-* checks, as hipFile's clang-tidy workflow
1010
# does. The compiler is still ROCm's amdclang++. Keep LLVM_VERSION at
11-
# the LLVM major version of the image's ROCm (ROCm 10.0 is LLVM 23), so
12-
# clang-tidy understands the compiler's flags.
11+
# the LLVM major version of the image's ROCm where apt.llvm.org has a
12+
# release of it, so clang-tidy understands the compiler's flags. ROCm
13+
# 10.1 is LLVM 24, which only has snapshot builds, so this uses LLVM 23,
14+
# the newest release. That works while the build uses no warning flag
15+
# newer than Clang 23 (see HIPOBJClangCompilerOptions.cmake).
1316

1417
on:
1518
# The same triggers and paths as the Build workflow, since anything that
@@ -58,13 +61,13 @@ jobs:
5861
name: clang-tidy
5962
runs-on: ubuntu-latest
6063
container:
61-
image: rocm/dev-ubuntu-24.04:10.0.0-full
64+
image: rocm/dev-ubuntu-26.04:10.1.0-full
6265
options: --user root
6366
env:
6467
ROCM_PATH: /opt/rocm
6568
LLVM_VERSION: 23
6669
# The Ubuntu release of the image, for apt.llvm.org
67-
UBUNTU_CODENAME: noble
70+
UBUNTU_CODENAME: resolute
6871
# The fingerprint of apt.llvm.org's signing key, which is public
6972
LLVM_SIGNER_FINGERPRINT: 6084F3CF814B57C1CF12EFD515CF4D18AF4F7421
7073
steps:
@@ -125,9 +128,8 @@ jobs:
125128
# installed above, rather than whatever HIPOBJClangTidy.cmake's
126129
# search finds first.
127130
#
128-
# This builds the MinIO bridge, which the Build workflow's Clang
129-
# job (code coverage) doesn't, so HIPOBJ_WERROR is on to make this
130-
# the job that fails on Clang's warnings in the bridge.
131+
# HIPOBJ_WERROR is on, so a compiler warning fails this job too, as
132+
# it does the Build workflow's jobs.
131133
- name: Configure
132134
env:
133135
CC: /opt/rocm/llvm/bin/amdclang

‎.github/workflows/hipobject-hardware-test-gpu-direct.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ jobs:
225225
-v "${{ github.workspace }}:/hipobject:ro" \
226226
-v "${{ github.workspace }}/ernic-build-gpu:/hipobject-build" \
227227
-e ROCM_PATH=/opt/rocm \
228+
-e CC=/opt/rocm/llvm/bin/amdclang \
229+
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
228230
"$ROCM_IMAGE" \
229231
bash -c "
230232
apt-get update -qq && \

‎.github/workflows/hipobject-hardware-test-minio-bridge.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ jobs:
169169
-v "${{ github.workspace }}:/hipobject:ro" \
170170
-v "${{ github.workspace }}/ernic-build:/hipobject-build" \
171171
-e ROCM_PATH=/opt/rocm \
172+
-e CC=/opt/rocm/llvm/bin/amdclang \
173+
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
172174
"$ROCM_IMAGE" \
173175
bash -c "
174176
apt-get update -qq && \

‎.github/workflows/hipobject-hardware-test-s3-backend.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ jobs:
145145
-v "${{ github.workspace }}:/hipobject:ro" \
146146
-v "${{ github.workspace }}/ernic-build-s3:/hipobject-build" \
147147
-e ROCM_PATH=/opt/rocm \
148+
-e CC=/opt/rocm/llvm/bin/amdclang \
149+
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
148150
"$ROCM_IMAGE" \
149151
bash -c "
150152
apt-get update -qq && \

‎.github/workflows/hipobject-hardware-test-two-vm-gpu-direct.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ jobs:
197197
-v "${{ github.workspace }}:/hipobject:ro" \
198198
-v "${{ github.workspace }}/ernic-build:/hipobject-build" \
199199
-e ROCM_PATH=/opt/rocm \
200+
-e CC=/opt/rocm/llvm/bin/amdclang \
201+
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
200202
"$ROCM_IMAGE" \
201203
bash -c "
202204
apt-get update -qq && \

‎.github/workflows/hipobject-hardware-test-two-vm-protocol.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ jobs:
165165
-v "${{ github.workspace }}:/hipobject:ro" \
166166
-v "${{ github.workspace }}/ernic-build:/hipobject-build" \
167167
-e ROCM_PATH=/opt/rocm \
168+
-e CC=/opt/rocm/llvm/bin/amdclang \
169+
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
168170
"$ROCM_IMAGE" \
169171
bash -c "
170172
apt-get update -qq && \

‎.github/workflows/hipobject-iwyu.yml‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
name: include-what-you-use (advisory)
5858
runs-on: ubuntu-latest
5959
container:
60-
image: rocm/dev-ubuntu-24.04:10.0.0-full
60+
image: rocm/dev-ubuntu-26.04:10.1.0-full
6161
options: --user root
6262
env:
6363
ROCM_PATH: /opt/rocm
@@ -89,17 +89,18 @@ jobs:
8989
# runs IWYU through a wrapper that records every run for the check
9090
# step.
9191
#
92-
# The iwyu package installs clang, so the compilers are set to GCC
93-
# rather than left to whichever c++ CMake finds first. GCC also
94-
# checks that IWYU's clang copes with the GCC-only warning flags.
92+
# The compiler is amdclang, as in the other workflows. IWYU's clang
93+
# is older, so the build leaves out the flags it doesn't have (see
94+
# HIPOBJIWYU.cmake).
9595
#
9696
# HIPOBJ_WERROR is off: the Build workflow checks for warnings, and
9797
# this job is only about IWYU.
9898
- name: Configure
99+
env:
100+
CC: /opt/rocm/llvm/bin/amdclang
101+
CXX: /opt/rocm/llvm/bin/amdclang++
99102
run: |
100103
cmake -B build -G Ninja \
101-
-DCMAKE_C_COMPILER=gcc \
102-
-DCMAKE_CXX_COMPILER=g++ \
103104
-DCMAKE_PREFIX_PATH=/opt/rocm \
104105
-DBUILD_TESTING=ON \
105106
-DHIPOBJ_BNXT=ON \

‎.github/workflows/hipobject-minio-integration-check.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
runs-on: ubuntu-24.04
6767
timeout-minutes: 30
6868
container:
69-
image: rocm/dev-ubuntu-24.04:10.0.0-full
69+
image: rocm/dev-ubuntu-26.04:10.1.0-full
7070
options: --user root
7171
env:
7272
ROCM_PATH: /opt/rocm
@@ -137,7 +137,11 @@ jobs:
137137
"$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD" --insecure
138138
mc mb "ci/$TEST_BUCKET"
139139
140+
# CMake picks the compilers up from CC and CXX
140141
- name: Build hipObject with curl support
142+
env:
143+
CC: /opt/rocm/llvm/bin/amdclang
144+
CXX: /opt/rocm/llvm/bin/amdclang++
141145
run: |
142146
cmake -B build \
143147
-DCMAKE_PREFIX_PATH=/opt/rocm \

‎.github/workflows/hipobject-nightly.yml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,34 @@ jobs:
127127
# and install into, the version's own directory instead, as ROCm's
128128
# packages do. The test programs find libamdhip64 through
129129
# LD_LIBRARY_PATH (see hipobject-build.yml).
130+
#
131+
# The packages are built with that version's amdclang, as TheRock
132+
# builds ROCm. CMake picks the compilers up from CC and CXX.
130133
- name: Find ROCm
131134
run: |
132135
rocm_path="/opt/rocm/core-${ROCM_VERSION%.*}"
133136
if [[ ! -d "${rocm_path}" ]]; then
134137
echo "::error::ROCm ${ROCM_VERSION} isn't in ${rocm_path}"
135138
exit 1
136139
fi
140+
for compiler in amdclang amdclang++; do
141+
if [[ ! -x "${rocm_path}/llvm/bin/${compiler}" ]]; then
142+
echo "::error::${compiler} isn't in ${rocm_path}/llvm/bin"
143+
exit 1
144+
fi
145+
done
137146
{
138147
echo "ROCM_PATH=${rocm_path}"
139148
echo "LD_LIBRARY_PATH=${rocm_path}/lib"
149+
echo "CC=${rocm_path}/llvm/bin/amdclang"
150+
echo "CXX=${rocm_path}/llvm/bin/amdclang++"
140151
} >> "${GITHUB_ENV}"
141152
142153
# rocm-cmake reads the package release from the environment when
143154
# hipObject is configured.
144155
#
145156
# Warnings aren't errors here. The build workflow checks them, but
146-
# only on Ubuntu 24.04, so a newer release's compiler can warn about
157+
# only with ROCm 10.1.0, so another version's compiler can warn about
147158
# code that workflow passes. That shouldn't stop the packages.
148159
- name: Configure
149160
env:

0 commit comments

Comments
 (0)