Skip to content

Commit

Permalink
Install Codeplay packages via APT (AMReX-Codes#3687)
Browse files Browse the repository at this point in the history
Codeplay now provides packages via APT. Token is no longer needed.
  • Loading branch information
WeiqunZhang authored Jan 4, 2024
1 parent a068330 commit f1ec8df
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
26 changes: 20 additions & 6 deletions .github/workflows/dependencies/dependencies_codeplay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 4 additions & 2 deletions .github/workflows/dependencies/dependencies_hip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ sudo apt-get install -y --no-install-recommends \
roctracer-dev \
rocprofiler-dev \
rocrand-dev \
rocprim-dev \
hiprand-dev
rocprim-dev

# hiprand-dev is a new package that does not exist in old versions
sudo apt-get install -y --no-install-recommends hiprand-dev || true

# activate
#
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,24 @@ 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
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
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
Expand Down Expand Up @@ -148,28 +143,23 @@ 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
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
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
Expand Down

0 comments on commit f1ec8df

Please sign in to comment.