Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 119 additions & 41 deletions .github/workflows/hipobject-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,54 +52,125 @@ defaults:

jobs:
build:
name: >-
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) || '' }})
name: Build (${{ matrix.label }})
runs-on: ubuntu-latest
strategy:
# Every other workflow builds the default configuration (shared
# library, no sanitizers), so this is the only place the static,
# sanitizer, and code coverage configurations get compiled and tested.
# Let every job finish so a failure in one doesn't hide the state of
# the others.
fail-fast: false
# The jobs are listed one by one rather than made by crossing axes,
# since most of them change one thing from the first job, and
# crossing would build combinations nobody needs. Every job sets
# label, ubuntu, cc, cxx, and build_type. A job that leaves out one
# of the other keys gets its default:
#
# shared_libs ON. TheRock only builds shared libraries.
# sanitizer None. asan is HIPOBJ_USE_SANITIZERS (ASan, UBSan,
# and the compiler's other checks), and tsan is
# HIPOBJ_USE_THREAD_SANITIZER.
# coverage OFF
# cxx_standard 20
# backends ON, which turns on both HIPOBJ_BNXT and
# HIPOBJ_IONIC
# packages None. Extra apt packages, such as a compiler.
#
# Every job uses ROCm 10.1.0, the latest ROCm (see the image below).
matrix:
shared_libs: [ON, OFF]
# asan is HIPOBJ_USE_SANITIZERS, tsan is HIPOBJ_USE_THREAD_SANITIZER,
# and empty is neither
sanitizer: ['']
coverage: [OFF]
# Empty means the CMakeLists.txt default (RelWithDebInfo)
build_type: ['']
include:
# Two sanitizer jobs with the default configuration: one with
# every sanitizer except ThreadSanitizer, and one with
# ThreadSanitizer. They build with ROCm's Clang, which has more
# checks than GCC. They build Debug, so they're also where the
# library's assert()s are checked, and sanitizer reports aren't
# muddied by optimization.
- shared_libs: ON
sanitizer: asan
coverage: OFF
# The core jobs build with ROCm's amdclang on the newest Ubuntu
# release, as TheRock will build hipObject.
- label: amdclang, RelWithDebInfo
ubuntu: '26.04'
cc: /opt/rocm/llvm/bin/amdclang
cxx: /opt/rocm/llvm/bin/amdclang++
build_type: RelWithDebInfo
# Debug, so the library's assert()s are checked with the
# sanitizers on, and the reports aren't muddied by optimization
- label: amdclang, Debug, ASan and UBSan
ubuntu: '26.04'
cc: /opt/rocm/llvm/bin/amdclang
cxx: /opt/rocm/llvm/bin/amdclang++
build_type: Debug
sanitizer: asan
# RelWithDebInfo, as TheRock's ThreadSanitizer builds are, so the
# threads' timing is closer to a normal build's
- label: amdclang, RelWithDebInfo, TSan
ubuntu: '26.04'
cc: /opt/rocm/llvm/bin/amdclang
cxx: /opt/rocm/llvm/bin/amdclang++
- shared_libs: ON
build_type: RelWithDebInfo
sanitizer: tsan
coverage: OFF
build_type: Debug
# Debug, so the report's lines match the source. Coverage needs
# Clang.
- label: amdclang, Debug, coverage
ubuntu: '26.04'
cc: /opt/rocm/llvm/bin/amdclang
cxx: /opt/rocm/llvm/bin/amdclang++
# One code coverage job with the default configuration. Coverage
# needs Clang, so it builds with ROCm's, too. It builds Debug, so
# the report's lines match the source.
- shared_libs: ON
sanitizer: ''
coverage: ON
build_type: Debug
coverage: ON
# Smoke tests of what the core jobs don't build. Release is
# TheRock's default build type.
- label: amdclang, Release, static
ubuntu: '26.04'
cc: /opt/rocm/llvm/bin/amdclang
cxx: /opt/rocm/llvm/bin/amdclang++
build_type: Release
shared_libs: OFF
- label: amdclang, no NIC backends
ubuntu: '26.04'
cc: /opt/rocm/llvm/bin/amdclang
cxx: /opt/rocm/llvm/bin/amdclang++
build_type: RelWithDebInfo
backends: OFF
- label: amdclang, C++23
ubuntu: '26.04'
cc: /opt/rocm/llvm/bin/amdclang
cxx: /opt/rocm/llvm/bin/amdclang++
build_type: RelWithDebInfo
cxx_standard: 23
# C++26 needs CMake 3.30 or later, which Ubuntu 24.04 doesn't have
- label: amdclang, C++26
ubuntu: '26.04'
cc: /opt/rocm/llvm/bin/amdclang
cxx: /opt/rocm/llvm/bin/amdclang++
build_type: RelWithDebInfo
cxx_standard: 26
# Upstream Clang, the version Ubuntu installs as clang
- label: Clang 21
ubuntu: '26.04'
cc: clang-21
cxx: clang++-21
build_type: RelWithDebInfo
packages: clang-21
# GCC is a second set of eyes: its warnings and sanitizers find
# problems that Clang's don't. The sanitizer job builds
# RelWithDebInfo, since the amdclang one builds Debug.
- label: GCC 15
ubuntu: '26.04'
cc: gcc-15
cxx: g++-15
build_type: RelWithDebInfo
- label: GCC 15, ASan and UBSan
ubuntu: '26.04'
cc: gcc-15
cxx: g++-15
build_type: RelWithDebInfo
sanitizer: asan
# The oldest supported Ubuntu release, with older compilers and
# an older CMake (3.28)
- label: Ubuntu 24.04, GCC 13
ubuntu: '24.04'
cc: gcc-13
cxx: g++-13
build_type: RelWithDebInfo
- label: Ubuntu 24.04, Clang 18
ubuntu: '24.04'
cc: clang-18
cxx: clang++-18
build_type: RelWithDebInfo
packages: clang-18
container:
image: rocm/dev-ubuntu-24.04:10.0.0-full
image: rocm/dev-ubuntu-${{ matrix.ubuntu }}:10.1.0-full
options: --user root
env:
ROCM_PATH: /opt/rocm
Expand All @@ -119,8 +190,14 @@ jobs:
#
# The MinIO bridge needs nlohmann-json3-dev and libpugixml-dev.
# libcurlpp-dev saves downloading and building curlpp.
#
# A job's packages (EXTRA_PACKAGES) are separated by spaces, so read
# splits them into an array with one package in each element.
- name: Install dependencies
env:
EXTRA_PACKAGES: ${{ matrix.packages }}
run: |
read -ra extra_packages <<< "${EXTRA_PACKAGES}"
apt-get update
apt-get install -y \
cmake \
Expand All @@ -131,18 +208,18 @@ jobs:
libpugixml-dev \
libssl-dev \
nlohmann-json3-dev \
rpm
rpm \
"${extra_packages[@]}"

# HIPOBJ_WERROR makes a new warning fail the build. It only
# covers hipObject's own targets, not the code FetchContent pulls in.
#
# Every job but the coverage job builds the MinIO bridge, so it's
# compiled with GCC's warnings in each configuration and ctest's
# install and package tests include it. The coverage report only
# measures src/, so the bridge would only slow that job down.
# compiled with each compiler's warnings and ctest's install and
# package tests include it. The coverage report only measures src/,
# so the bridge would only slow that job down.
#
# CMake picks the compilers up from CC and CXX, and ignores them when
# they're empty, as they are for the jobs that don't set cc and cxx.
# CMake picks the compilers up from CC and CXX.
- name: Configure
env:
CC: ${{ matrix.cc }}
Expand All @@ -152,13 +229,14 @@ jobs:
-DCMAKE_PREFIX_PATH=/opt/rocm \
-DBUILD_TESTING=ON \
-DHIPOBJ_WERROR=ON \
-DHIPOBJ_BNXT=ON \
-DHIPOBJ_IONIC=ON \
-DHIPOBJ_BNXT=${{ matrix.backends || 'ON' }} \
-DHIPOBJ_IONIC=${{ matrix.backends || 'ON' }} \
-DHIPOBJ_MINIO_CLIENT=${{ matrix.coverage == 'ON' && 'OFF' || 'ON' }} \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs }} \
-DBUILD_SHARED_LIBS=${{ matrix.shared_libs || 'ON' }} \
-DHIPOBJ_CXX_STANDARD=${{ matrix.cxx_standard || '20' }} \
-DHIPOBJ_USE_SANITIZERS=${{ matrix.sanitizer == 'asan' && 'ON' || 'OFF' }} \
-DHIPOBJ_USE_THREAD_SANITIZER=${{ matrix.sanitizer == 'tsan' && 'ON' || 'OFF' }} \
-DHIPOBJ_USE_CODE_COVERAGE=${{ matrix.coverage }} \
-DHIPOBJ_USE_CODE_COVERAGE=${{ matrix.coverage || 'OFF' }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

- name: Build
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/hipobject-clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ name: hipObject - clang-tidy
# This uses upstream clang-tidy rather than ROCm's, which is built
# without the clang-analyzer-* checks, as hipFile's clang-tidy workflow
# does. The compiler is still ROCm's amdclang++. Keep LLVM_VERSION at
# the LLVM major version of the image's ROCm (ROCm 10.0 is LLVM 23), so
# clang-tidy understands the compiler's flags.
# the LLVM major version of the image's ROCm where apt.llvm.org has a
# release of it, so clang-tidy understands the compiler's flags. ROCm
# 10.1 is LLVM 24, which only has snapshot builds, so this uses LLVM 23,
# the newest release. That works while the build uses no warning flag
# newer than Clang 23 (see HIPOBJClangCompilerOptions.cmake).

on:
# The same triggers and paths as the Build workflow, since anything that
Expand Down Expand Up @@ -58,13 +61,13 @@ jobs:
name: clang-tidy
runs-on: ubuntu-latest
container:
image: rocm/dev-ubuntu-24.04:10.0.0-full
image: rocm/dev-ubuntu-26.04:10.1.0-full
options: --user root
env:
ROCM_PATH: /opt/rocm
LLVM_VERSION: 23
# The Ubuntu release of the image, for apt.llvm.org
UBUNTU_CODENAME: noble
UBUNTU_CODENAME: resolute
# The fingerprint of apt.llvm.org's signing key, which is public
LLVM_SIGNER_FINGERPRINT: 6084F3CF814B57C1CF12EFD515CF4D18AF4F7421
steps:
Expand Down Expand Up @@ -125,9 +128,8 @@ jobs:
# installed above, rather than whatever HIPOBJClangTidy.cmake's
# search finds first.
#
# This builds the MinIO bridge, which the Build workflow's Clang
# job (code coverage) doesn't, so HIPOBJ_WERROR is on to make this
# the job that fails on Clang's warnings in the bridge.
# HIPOBJ_WERROR is on, so a compiler warning fails this job too, as
# it does the Build workflow's jobs.
- name: Configure
env:
CC: /opt/rocm/llvm/bin/amdclang
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/hipobject-hardware-test-gpu-direct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ jobs:
-v "${{ github.workspace }}:/hipobject:ro" \
-v "${{ github.workspace }}/ernic-build-gpu:/hipobject-build" \
-e ROCM_PATH=/opt/rocm \
-e CC=/opt/rocm/llvm/bin/amdclang \
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
"$ROCM_IMAGE" \
bash -c "
apt-get update -qq && \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/hipobject-hardware-test-minio-bridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ jobs:
-v "${{ github.workspace }}:/hipobject:ro" \
-v "${{ github.workspace }}/ernic-build:/hipobject-build" \
-e ROCM_PATH=/opt/rocm \
-e CC=/opt/rocm/llvm/bin/amdclang \
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
"$ROCM_IMAGE" \
bash -c "
apt-get update -qq && \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/hipobject-hardware-test-s3-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ jobs:
-v "${{ github.workspace }}:/hipobject:ro" \
-v "${{ github.workspace }}/ernic-build-s3:/hipobject-build" \
-e ROCM_PATH=/opt/rocm \
-e CC=/opt/rocm/llvm/bin/amdclang \
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
"$ROCM_IMAGE" \
bash -c "
apt-get update -qq && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ jobs:
-v "${{ github.workspace }}:/hipobject:ro" \
-v "${{ github.workspace }}/ernic-build:/hipobject-build" \
-e ROCM_PATH=/opt/rocm \
-e CC=/opt/rocm/llvm/bin/amdclang \
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
"$ROCM_IMAGE" \
bash -c "
apt-get update -qq && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ jobs:
-v "${{ github.workspace }}:/hipobject:ro" \
-v "${{ github.workspace }}/ernic-build:/hipobject-build" \
-e ROCM_PATH=/opt/rocm \
-e CC=/opt/rocm/llvm/bin/amdclang \
-e CXX=/opt/rocm/llvm/bin/amdclang++ \
"$ROCM_IMAGE" \
bash -c "
apt-get update -qq && \
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/hipobject-iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
name: include-what-you-use (advisory)
runs-on: ubuntu-latest
container:
image: rocm/dev-ubuntu-24.04:10.0.0-full
image: rocm/dev-ubuntu-26.04:10.1.0-full
options: --user root
env:
ROCM_PATH: /opt/rocm
Expand Down Expand Up @@ -89,17 +89,18 @@ jobs:
# runs IWYU through a wrapper that records every run for the check
# step.
#
# The iwyu package installs clang, so the compilers are set to GCC
# rather than left to whichever c++ CMake finds first. GCC also
# checks that IWYU's clang copes with the GCC-only warning flags.
# The compiler is amdclang, as in the other workflows. IWYU's clang
# is older, so the build leaves out the flags it doesn't have (see
# HIPOBJIWYU.cmake).
#
# HIPOBJ_WERROR is off: the Build workflow checks for warnings, and
# this job is only about IWYU.
- name: Configure
env:
CC: /opt/rocm/llvm/bin/amdclang
CXX: /opt/rocm/llvm/bin/amdclang++
run: |
cmake -B build -G Ninja \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_PREFIX_PATH=/opt/rocm \
-DBUILD_TESTING=ON \
-DHIPOBJ_BNXT=ON \
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/hipobject-minio-integration-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 30
container:
image: rocm/dev-ubuntu-24.04:10.0.0-full
image: rocm/dev-ubuntu-26.04:10.1.0-full
options: --user root
env:
ROCM_PATH: /opt/rocm
Expand Down Expand Up @@ -137,7 +137,11 @@ jobs:
"$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD" --insecure
mc mb "ci/$TEST_BUCKET"

# CMake picks the compilers up from CC and CXX
- name: Build hipObject with curl support
env:
CC: /opt/rocm/llvm/bin/amdclang
CXX: /opt/rocm/llvm/bin/amdclang++
run: |
cmake -B build \
-DCMAKE_PREFIX_PATH=/opt/rocm \
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/hipobject-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,34 @@ jobs:
# and install into, the version's own directory instead, as ROCm's
# packages do. The test programs find libamdhip64 through
# LD_LIBRARY_PATH (see hipobject-build.yml).
#
# The packages are built with that version's amdclang, as TheRock
# builds ROCm. CMake picks the compilers up from CC and CXX.
- name: Find ROCm
run: |
rocm_path="/opt/rocm/core-${ROCM_VERSION%.*}"
if [[ ! -d "${rocm_path}" ]]; then
echo "::error::ROCm ${ROCM_VERSION} isn't in ${rocm_path}"
exit 1
fi
for compiler in amdclang amdclang++; do
if [[ ! -x "${rocm_path}/llvm/bin/${compiler}" ]]; then
echo "::error::${compiler} isn't in ${rocm_path}/llvm/bin"
exit 1
fi
done
{
echo "ROCM_PATH=${rocm_path}"
echo "LD_LIBRARY_PATH=${rocm_path}/lib"
echo "CC=${rocm_path}/llvm/bin/amdclang"
echo "CXX=${rocm_path}/llvm/bin/amdclang++"
} >> "${GITHUB_ENV}"

# rocm-cmake reads the package release from the environment when
# hipObject is configured.
#
# Warnings aren't errors here. The build workflow checks them, but
# only on Ubuntu 24.04, so a newer release's compiler can warn about
# only with ROCm 10.1.0, so another version's compiler can warn about
# code that workflow passes. That shouldn't stop the packages.
- name: Configure
env:
Expand Down
Loading
Loading