diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index b9c2e799f..9b30b25b9 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | - .github/workflows/dependencies_clang-tidy-apt-llvm.sh 17 + .github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17 - name: Compile wdconvect run: | diff --git a/.github/workflows/dependencies_clang-tidy-apt-llvm.sh b/.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh similarity index 100% rename from .github/workflows/dependencies_clang-tidy-apt-llvm.sh rename to .github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh diff --git a/.github/workflows/dependencies/dependencies_nvcc.sh b/.github/workflows/dependencies/dependencies_nvcc.sh new file mode 100755 index 000000000..8f6ac3ead --- /dev/null +++ b/.github/workflows/dependencies/dependencies_nvcc.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# Copyright 2020-2022 Axel Huebl +# +# License: BSD-3-Clause-LBNL + +set -eu -o pipefail + +# `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 + +sudo apt-get -qqq update +sudo apt-get install -y \ + build-essential \ + ca-certificates \ + cmake \ + g++ \ + gfortran \ + gnupg \ + libopenmpi-dev \ + openmpi-bin \ + pkg-config \ + wget + +VERSION_DOTTED=${1-12.0} && VERSION_DASHED=$(sed 's/\./-/' <<< $VERSION_DOTTED) +curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb +sudo dpkg -i cuda-keyring_1.0-1_all.deb +sudo apt-get update +sudo apt-get install -y \ + cuda-command-line-tools-$VERSION_DASHED \ + cuda-compiler-$VERSION_DASHED \ + cuda-cupti-dev-$VERSION_DASHED \ + cuda-minimal-build-$VERSION_DASHED \ + cuda-nvml-dev-$VERSION_DASHED \ + cuda-nvtx-$VERSION_DASHED \ + libcublas-dev-$VERSION_DASHED \ + libcufft-dev-$VERSION_DASHED \ + libcurand-dev-$VERSION_DASHED \ + libcusparse-dev-$VERSION_DASHED +sudo ln -s cuda-$VERSION_DOTTED /usr/local/cuda diff --git a/.github/workflows/gpu_action.yml b/.github/workflows/gpu_action.yml index 526480c58..c6a28d011 100644 --- a/.github/workflows/gpu_action.yml +++ b/.github/workflows/gpu_action.yml @@ -1,6 +1,7 @@ name: GPU compilation on: [pull_request] + jobs: gpu-compilation: runs-on: ubuntu-latest @@ -24,14 +25,7 @@ jobs: sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0 - name: Install CUDA - # from https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network - run: | - wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin - sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 - sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub - sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" - sudo apt-get update - sudo apt-get -y install cuda + run: .github/workflows/dependencies/dependencies_nvcc.sh 11.8 - name: Compile reacting_bubble for GPU run: |