diff --git a/.github/workflows/setup/hip.sh b/.github/workflows/setup/hip.sh index f6e6cb0f71..4261814e00 100755 --- a/.github/workflows/setup/hip.sh +++ b/.github/workflows/setup/hip.sh @@ -21,11 +21,20 @@ set -eu -o pipefail echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries # Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu -wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key \ - | sudo apt-key add - -echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' \ - | sudo tee /etc/apt/sources.list.d/rocm.list +# Make the directory if it doesn't exist yet. +# This location is recommended by the distribution maintainers. +sudo mkdir --parents --mode=0755 /etc/apt/keyrings + +# Download the key, convert the signing-key to a full +# keyring required by apt and store in the keyring directory +wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \ + gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null + +source /etc/os-release # set UBUNTU_CODENAME: focal or jammy or ... + +echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-latest} ${UBUNTU_CODENAME} main" \ + | sudo tee /etc/apt/sources.list.d/rocm.list echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \ | sudo tee -a /etc/profile.d/rocm.sh # we should not need to export HIP_PATH=/opt/rocm/hip with those installs