From 3911e510d0fd2dba00a84d4b659aa9303eae5814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Widera?= Date: Tue, 19 Dec 2023 11:28:25 +0100 Subject: [PATCH] CI: fix HIP install script Fix CI HIP install script to support alpaka'S CI base container instead require native ROCM containers. CI_FILTER: ^linux_hipcc --- script/install_hip.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/script/install_hip.sh b/script/install_hip.sh index 78f6107af580..bbdae6f461f6 100755 --- a/script/install_hip.sh +++ b/script/install_hip.sh @@ -18,17 +18,24 @@ else travis_retry apt-get -y --quiet update travis_retry apt-get -y --quiet install wget gnupg2 # AMD container keys are outdated and must be updated + source /etc/os-release wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - + echo "deb https://repo.radeon.com/rocm/apt/${ALPAKA_CI_HIP_VERSION} ${VERSION_CODENAME} main" | sudo tee -a /etc/apt/sources.list.d/rocm.list travis_retry apt-get -y --quiet update - # AMD container are not shipped with rocrand/hiprand - travis_retry sudo apt-get -y --quiet install rocrand + ALPAKA_CI_ROCM_VERSION=$ALPAKA_CI_HIP_VERSION + # append .0 if no patch level is defined + if ! echo $ALPAKA_CI_ROCM_VERSION | grep -Eq '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+'; then + ALPAKA_CI_ROCM_VERSION="${ALPAKA_CI_ROCM_VERSION}.0" + fi + + apt install -y rocm-hip-sdk${ALPAKA_CI_ROCM_VERSION} rocm-dev${ALPAKA_CI_ROCM_VERSION} export ROCM_PATH=/opt/rocm fi # ROCM_PATH required by HIP tools -export HIP_PATH=${ROCM_PATH}/hip - -export HIP_LIB_PATH=${HIP_PATH}/lib +export HIP_PLATFORM="amd" +export HIP_DEVICE_LIB_PATH=${ROCM_PATH}/amdgcn/bitcode +export HSA_PATH=$ROCM_PATH export PATH=${ROCM_PATH}/bin:$PATH export PATH=${ROCM_PATH}/llvm/bin:$PATH @@ -38,8 +45,8 @@ sudo update-alternatives --install /usr/bin/clang++ clang++ ${ROCM_PATH}/llvm/bi sudo update-alternatives --install /usr/bin/cc cc ${ROCM_PATH}/llvm/bin/clang 50 sudo update-alternatives --install /usr/bin/c++ c++ ${ROCM_PATH}/llvm/bin/clang++ 50 -export LD_LIBRARY_PATH=${ROCM_PATH}/lib64:${ROCM_PATH}/hiprand/lib:${LD_LIBRARY_PATH}:${ROCM_PATH}/llvm/lib -export CMAKE_PREFIX_PATH=${ROCM_PATH}:${ROCM_PATH}/hiprand:${CMAKE_PREFIX_PATH:-} +export LD_LIBRARY_PATH=${ROCM_PATH}/lib:${ROCM_PATH}/lib64:${LD_LIBRARY_PATH}:${ROCM_PATH}/llvm/lib +export CMAKE_PREFIX_PATH=${ROCM_PATH}:${CMAKE_PREFIX_PATH:-} if [[ "$CI_RUNNER_TAGS" =~ .*cpuonly.* ]] ; then # In cases where the compile-only job is executed on a GPU runner but with different kinds of accelerators