From c25ee81eee87a4adb3e53ee29c7a2633ba35c2d6 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Wed, 3 Jan 2024 09:37:24 -0800 Subject: [PATCH] Install Codeplay packages via APT Codeplay now provides packages via APT. Token is no longer needed. --- .../dependencies/dependencies_codeplay.sh | 26 ++++++++++++++----- .../dependencies/dependencies_hip.sh | 5 +++- .github/workflows/intel.yml | 22 +++++----------- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/workflows/dependencies/dependencies_codeplay.sh b/.github/workflows/dependencies/dependencies_codeplay.sh index dfd2e5a03f7..bf692d3c2c7 100755 --- a/.github/workflows/dependencies/dependencies_codeplay.sh +++ b/.github/workflows/dependencies/dependencies_codeplay.sh @@ -6,10 +6,24 @@ set -eu -o pipefail -curl -o oneapi_nvidia.sh -L "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=nvidia&filters[]=linux&aat=$1" -chmod +x oneapi_nvidia.sh -sudo ./oneapi_nvidia.sh --yes +# `man apt.conf`: +# Number of retries to perform. If this is non-zero APT will retry +# failed files the given number of times. +echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries -curl -o oneapi_amd.sh -L "https://developer.codeplay.com/api/v1/products/download?product=oneapi&variant=amd&filters[]=linux&aat=$1" -chmod +x oneapi_amd.sh -sudo ./oneapi_amd.sh --yes +# https://developer.codeplay.com/apt/index.html +sudo wget -qO - https://developer.codeplay.com/apt/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/codeplay-keyring.gpg > /dev/null +echo "deb [signed-by=/usr/share/keyrings/codeplay-keyring.gpg] https://developer.codeplay.com/apt all main" | sudo tee /etc/apt/sources.list.d/codeplay.list + +sudo apt-get update + +# try apt install up to five times, to avoid connection splits +status=1 +for itry in {1..5} +do + sudo apt-get install -y --no-install-recommends \ + $1 \ + && { sudo apt-get clean; status=0; break; } \ + || { sleep 10; } +done +if [[ ${status} -ne 0 ]]; then exit 1; fi diff --git a/.github/workflows/dependencies/dependencies_hip.sh b/.github/workflows/dependencies/dependencies_hip.sh index 36df2f384ba..3978d59d18e 100755 --- a/.github/workflows/dependencies/dependencies_hip.sh +++ b/.github/workflows/dependencies/dependencies_hip.sh @@ -43,7 +43,10 @@ sudo apt-get install -y --no-install-recommends \ roctracer-dev \ rocprofiler-dev \ rocrand-dev \ - rocprim-dev \ + rocprim-dev + +# hiprand-dev is a new package that does not exist in old versions +sudo apt-get install -y --no-install-recommends --ignore-missing \ hiprand-dev # activate diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 6474214e0a2..aa1036ddf94 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -97,19 +97,16 @@ jobs: tests-oneapi-sycl-eb-nvidia: name: oneAPI SYCL for Nvidia GPUs [tests w/ EB] runs-on: ubuntu-latest - env: - CODEPLAYTOKEN: ${{ secrets.CODEPLAYTOKEN }} steps: - uses: actions/checkout@v3 - name: Dependencies - if: ${{ env.CODEPLAYTOKEN != '' }} run: | - .github/workflows/dependencies/dependencies_nvcc.sh + .github/workflows/dependencies/ubuntu_free_disk_space.sh .github/workflows/dependencies/dependencies_dpcpp.sh - .github/workflows/dependencies/dependencies_codeplay.sh ${{ env.CODEPLAYTOKEN }} + .github/workflows/dependencies/dependencies_nvcc.sh 12.0 + .github/workflows/dependencies/dependencies_codeplay.sh oneapi-nvidia-12.0 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache - if: ${{ env.CODEPLAYTOKEN != '' }} uses: actions/cache@v3 with: path: ~/.cache/ccache @@ -117,9 +114,7 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build & Install - if: ${{ env.CODEPLAYTOKEN != '' }} - # clang currently supports CUDA up to version 11.5 and a warning is issued with newer versions - env: {CXXFLAGS: "-fsycl -fsycl-targets=nvptx64-nvidia-cuda -fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -Wnon-virtual-dtor -Wno-unknown-cuda-version"} + env: {CXXFLAGS: "-fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --offload-arch=sm_80 -fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -Wnon-virtual-dtor"} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -148,20 +143,16 @@ jobs: no-tests-oneapi-sycl-amd: name: oneAPI SYCL for AMD GPUs runs-on: ubuntu-20.04 - env: - CODEPLAYTOKEN: ${{ secrets.CODEPLAYTOKEN }} steps: - uses: actions/checkout@v3 - name: Dependencies - if: ${{ env.CODEPLAYTOKEN != '' }} run: | .github/workflows/dependencies/ubuntu_free_disk_space.sh - .github/workflows/dependencies/dependencies_hip.sh 5.4.6 .github/workflows/dependencies/dependencies_dpcpp.sh - .github/workflows/dependencies/dependencies_codeplay.sh ${{ env.CODEPLAYTOKEN }} + .github/workflows/dependencies/dependencies_hip.sh 5.4.3 + .github/workflows/dependencies/dependencies_codeplay.sh oneapi-amd-5.4.3 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache - if: ${{ env.CODEPLAYTOKEN != '' }} uses: actions/cache@v3 with: path: ~/.cache/ccache @@ -169,7 +160,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build & Install - if: ${{ env.CODEPLAYTOKEN != '' }} env: {CXXFLAGS: "-fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx90a -fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -Wnon-virtual-dtor"} run: | export CCACHE_COMPRESS=1