CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
54 lines
2.2 KiB
Bash
Executable File
54 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright © Advanced Micro Devices, Inc., or its affiliates.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
set -e
|
|
COMPILERS_HASH_DIR=${COMPILERS_HASH_DIR:-"/tmp/.sccache"}
|
|
SCCACHE_EXTRAFILES=${SCCACHE_EXTRAFILES:-"${COMPILERS_HASH_DIR}/rocm_compilers_hash_file"}
|
|
SCCACHE_BIN=${SCCACHE_BIN:-"${SCCACHE_INSTALL_LOCATION}/sccache"}
|
|
ENFORCE_REDIS="false"
|
|
while [ "$1" != "" ];
|
|
do
|
|
case $1 in
|
|
--enforce_redis )
|
|
shift; ENFORCE_REDIS="true" ;;
|
|
--no-hipcc )
|
|
shift ;;
|
|
*)
|
|
break ;;
|
|
esac
|
|
done
|
|
setup_rocm_compilers_hash_file() {
|
|
mkdir -p "$COMPILERS_HASH_DIR"
|
|
# MD5 checksums of clang and clang-offload-bundler cannot be used since they will keep changing
|
|
# if the ROCM_PATH changes, ie; for every mainline build.
|
|
# This is because ROCM_PATH gets encoded into the clang/clang-offload-bundler binaries as part
|
|
# of RPATH.
|
|
# Note: Since compiler version strings include the commit hash, they vary with each build of TheRock.
|
|
# Exclude the commit hash to prevent unnecessary cache invalidation.
|
|
# Omit hipcc and bitcode hashing for now; hipcc is unused, and bitcode hashing can be restored if needed
|
|
CLANG_VERSION="$("${ROCM_PATH}/llvm/bin/clang" --version | head -n 1)"
|
|
CLANG_OFFLOAD_BUNDLER_VERSION="$("${ROCM_PATH}/llvm/bin/clang-offload-bundler" --version | head -n 1)"
|
|
printf '%s: %s\n' 'clang version' "${CLANG_VERSION}" | sed 's/ (.*)//' | tee -a "$SCCACHE_EXTRAFILES"
|
|
printf '%s: %s\n' 'clang-offload-bundler version' "${CLANG_OFFLOAD_BUNDLER_VERSION}" | sed 's/ (.*)//' | tee -a "$SCCACHE_EXTRAFILES"
|
|
echo "sccache-wrapper: compilers hash file set up at ${SCCACHE_EXTRAFILES}"
|
|
cat "$SCCACHE_EXTRAFILES"
|
|
}
|
|
if [ "${ENFORCE_REDIS}" == "true" ]; then
|
|
if [ -z "${SCCACHE_REDIS}" ]; then
|
|
echo "SCCACHE_REDIS not set. Not wrapping compilers with sccache."
|
|
exit 10
|
|
else
|
|
response=$(redis-cli -u ${SCCACHE_REDIS} ping) || true
|
|
if [ "${response}" != "PONG" ]; then
|
|
echo "Redis server unreachable. Not wrapping compilers with sccache."
|
|
exit 20
|
|
fi
|
|
fi
|
|
fi
|
|
setup_rocm_compilers_hash_file
|
|
$SCCACHE_BIN --version
|
|
$SCCACHE_BIN --start-server
|