From 5395d279388ad4202420ea60239499ba09593f0a Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 14 Oct 2026 05:30:55 +0300 Subject: [PATCH 1/4] ci: put Homebrew on PATH in the pastrami job The pastrami runner starts jobs without /opt/homebrew/bin on PATH, so the macOS job died at its first cmake call ("cmake: command not found", exit 127) before building anything. chipStar's own pastrami workflows export the same prefix for this reason. --- .github/workflows/presubmit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index bc865258c..dffefcb84 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -106,6 +106,7 @@ jobs: shell: bash run: | set -e + export PATH="/opt/homebrew/bin:$PATH" source /opt/homebrew/Cellar/modules/5.6.0/init/bash module use ~/modulefiles module load llvm/22.0-native pocl HIP/chipStar/main From 75085cce38efed563d720760782da78ff94f9652 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 14 Oct 2026 05:53:27 +0300 Subject: [PATCH 2/4] ci: set a macOS deployment target in the pastrami job The pastrami runner's .env sets SDKROOT to the Command Line Tools SDK. With SDKROOT (or an -isysroot, which Homebrew CMake 4.1 adds when SDKROOT is unset) and no deployment target, the assertion-enabled LLVM 22 build at ~/install/llvm/22.0-native aborts on any HIP compile: Assertion failed: (!TargetInitialized && "Target already initialized!"), function setTarget, file Darwin.h from Darwin::AddDeploymentTarget, reached once for the host toolchain and again for the offload job. CMake's compiler check therefore fails. The -arch arm64 in the log is CMake's default on Apple Silicon (_CMAKE_APPLE_ARCHS_DEFAULT in Platform/Darwin-Initialize.cmake) and is not the trigger: plain `hipcc -c` asserts the same way with SDKROOT set. Giving clang a deployment target (MACOSX_DEPLOYMENT_TARGET, which CMake also turns into -mmacosx-version-min) skips the SDK-derived path and the assertion. 15.0 matches the 15.5 Command Line Tools SDK. --- .github/workflows/presubmit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index dffefcb84..e90f624b3 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -107,6 +107,8 @@ jobs: run: | set -e export PATH="/opt/homebrew/bin:$PATH" + # Without an explicit deployment target, clang's HIP driver asserts in Darwin::AddDeploymentTarget. + export MACOSX_DEPLOYMENT_TARGET=15.0 source /opt/homebrew/Cellar/modules/5.6.0/init/bash module use ~/modulefiles module load llvm/22.0-native pocl HIP/chipStar/main From 13eb0b4b5d844ef7a50b2d4bf2b18a89fc0eb90e Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 14 Oct 2026 05:53:39 +0300 Subject: [PATCH 3/4] ci: point hipcc at the installed macOS TargetConditionals override Every device compile that includes a macOS SDK header (gtest pulls in AvailabilityMacros.h) fails on pastrami with TargetConditionals.h:353: error: unrecognized arch using compiler with __is_target_arch support chipStar works around this by adding -Xarch_device -I/include/hip/devicelib/macOS, whose stub TargetConditionals.h shadows the SDK one for spirv64. But chipStar's CMakeLists.txt bakes ${CMAKE_SOURCE_DIR} into the installed .hipInfo, so the pastrami install points at /Users/paulius/chipStar-main, a source tree that no longer exists. The same header is installed under /include/hip/devicelib/macOS, so append that path through hipcc's HIPCC_COMPILE_FLAGS_APPEND. --- .github/workflows/presubmit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index e90f624b3..d0a6bd023 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -112,6 +112,8 @@ jobs: source /opt/homebrew/Cellar/modules/5.6.0/init/bash module use ~/modulefiles module load llvm/22.0-native pocl HIP/chipStar/main + # The install's .hipInfo points this override at a deleted source tree. + export HIPCC_COMPILE_FLAGS_APPEND="-Xarch_device -I$(dirname "$(dirname "$(which hipcc)")")/include/hip/devicelib/macOS" module list rm -rf ~/.cache/chipStar build cmake -S . -B build \ From bad606bf29c219fb010f5a5e9c81dfdfaef323d9 Mon Sep 17 00:00:00 2001 From: Paulius Velesko Date: Wed, 14 Oct 2026 06:46:00 +0300 Subject: [PATCH 4/4] ci: work around meatloaf's stale chipStar install paths rocPRIM's meatloaf job has failed in CMake's compiler check since at least 2026-08-07: clang++: error: cannot find HIP device library for 'spirv64' target clang++: error: cannot find HIP runtime ~/install/HIP/chipStar/main on meatloaf was installed from a chipStar CI build configured with the prefix /tmp/chipstar-ci-staging/1460/ chipStar/ci. Its share/.hipInfo (HIP_PATH, --hip-path, -include, -L, rpath) and lib/cmake/hip/hip-targets.cmake (_IMPORT_PREFIX, so hip::CHIP -> .../ci/lib/libCHIP.so) name that staging dir, which has since been reaped. chipStar main fixed the generator side in 7a0fd3fe06d3 ("cmake: resolve the install prefix in generated files at install time"), but this install predates it. hipcc reads .hipInfo from bin/../share before $HIP_PATH/share, so the module's HIP_PATH cannot override it. Copy hipcc, .hipInfo and the hip CMake package into $RUNNER_TEMP, rewrite the stale prefix to the real one, and point CMake at the copies. Everything else (headers, libCHIP, device libraries) is used from the install. With a correct install the sed is a no-op. Pinning the only other install on meatloaf, HIP/chipStar/2026.04.08, was tried and rejected: it configures, but rocprim.warp_scan fails ExclusiveScan/Scan for warp_params, which pass with this install. These lines can go once HIP/chipStar/main on meatloaf is reinstalled. --- .github/workflows/presubmit.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index d0a6bd023..941c8bdad 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -35,9 +35,15 @@ jobs: module use /space/pvelesko/modulefiles module load oneapi/2025.0.4 llvm/22.0-native HIP/chipStar/main level-zero/dgpu module list + # This install names a deleted CI staging dir; use copies of its config that name the install. + stale=$(sed -n 's/^HIP_PATH=//p' "$HIP_PATH/share/.hipInfo") + hip="$RUNNER_TEMP/chipstar-main" + rm -rf "$hip" && mkdir -p "$hip/bin" "$hip/share" "$hip/lib/cmake" + cp "$HIP_PATH/bin/hipcc" "$hip/bin/" && cp "$HIP_PATH/share/.hipInfo" "$hip/share/" && cp -r "$HIP_PATH/lib/cmake/hip" "$hip/lib/cmake/" + sed -i "s|$stale|$HIP_PATH|g" "$hip/share/.hipInfo" "$hip"/lib/cmake/hip/*.cmake rm -rf ~/.cache/chipStar build cmake -S . -B build \ - -DCMAKE_CXX_COMPILER="$(which hipcc)" \ + -DCMAKE_CXX_COMPILER="$hip/bin/hipcc" -Dhip_DIR="$hip/lib/cmake/hip" \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TEST=ON -DBUILD_BENCHMARK=OFF \ -DAMDGPU_TEST_TARGETS="" \