Skip to content

Commit

Permalink
CI: fix HIP install script
Browse files Browse the repository at this point in the history
Fix CI HIP install script to support alpaka'S CI base container instead
require native ROCM containers.

CI_FILTER: ^linux_hipcc
  • Loading branch information
psychocoderHPC committed Dec 19, 2023
1 parent 8d6db0d commit 3911e51
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions script/install_hip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3911e51

Please sign in to comment.