From 875ebff912b5d3f4edc0e6ad7a983a56374a9e69 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 18 Dec 2020 20:36:28 -0800 Subject: [PATCH] CI: CUDA 9.1 & 11.0 (#1653) Add a recent CUDA 11 release for cutting-edge coverage, too. --- .../dependencies/dependencies_nvcc11.sh | 41 +++++++++++++ ...ndencies_nvcc.sh => dependencies_nvcc9.sh} | 0 .github/workflows/linux.yml | 61 ++++++++++++++----- 3 files changed, 86 insertions(+), 16 deletions(-) create mode 100755 .github/workflows/dependencies/dependencies_nvcc11.sh rename .github/workflows/dependencies/{dependencies_nvcc.sh => dependencies_nvcc9.sh} (100%) diff --git a/.github/workflows/dependencies/dependencies_nvcc11.sh b/.github/workflows/dependencies/dependencies_nvcc11.sh new file mode 100755 index 00000000000..9adc439486f --- /dev/null +++ b/.github/workflows/dependencies/dependencies_nvcc11.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# +# Copyright 2020 Axel Huebl +# +# License: BSD-3-Clause-LBNL + +# search recursive inside a folder if a file contains tabs +# +# @result 0 if no files are found, else 1 +# + +set -eu -o pipefail + +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 + +sudo wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub +sudo apt-key add 7fa2af80.pub +echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" \ + | sudo tee /etc/apt/sources.list.d/cuda.list +sudo apt-get update +sudo apt-get install -y \ + cuda-command-line-tools-11-2 \ + cuda-compiler-11-2 \ + cuda-cupti-dev-11-2 \ + cuda-minimal-build-11-2 \ + cuda-nvml-dev-11-2 \ + cuda-nvtx-11-2 \ + libcurand-dev-11-2 +sudo ln -s cuda-11.2 /usr/local/cuda + diff --git a/.github/workflows/dependencies/dependencies_nvcc.sh b/.github/workflows/dependencies/dependencies_nvcc9.sh similarity index 100% rename from .github/workflows/dependencies/dependencies_nvcc.sh rename to .github/workflows/dependencies/dependencies_nvcc9.sh diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a896100c269..ddd764e693b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -6,7 +6,7 @@ jobs: # Build and install libamrex as AMReX CMake project library: name: GNU@7.5 C++17 Release [lib] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"} steps: - uses: actions/checkout@v2 @@ -29,7 +29,7 @@ jobs: library_clang: name: Clang@6.0 C++14 SP NOMPI Debug [lib] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names"} steps: - uses: actions/checkout@v2 @@ -61,7 +61,7 @@ jobs: # Build libamrex and all tutorials tutorials: name: GNU@7.5 C++14 [tutorials] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"} steps: - uses: actions/checkout@v2 @@ -81,7 +81,7 @@ jobs: # Build libamrex and all tutorials tutorials_cxx20: name: GNU@10.1 C++20 OMP [tutorials] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: {CXXFLAGS: "-Werror -Wno-error=deprecated-declarations -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"} steps: - uses: actions/checkout@v2 @@ -106,7 +106,7 @@ jobs: # Build libamrex and all tutorials w/o MPI tutorials-nonmpi: name: GNU@7.5 C++14 NOMPI [tutorials] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"} steps: - uses: actions/checkout@v2 @@ -127,7 +127,7 @@ jobs: # Build libamrex and all tutorials tutorials-nofortran: name: GNU@7.5 C++11 w/o Fortran [tutorials] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"} steps: - uses: actions/checkout@v2 @@ -146,15 +146,15 @@ jobs: -DCMAKE_CXX_STANDARD=11 make -j 2 - # Build libamrex and all tutorials with CUDA - tutorials-cuda: + # Build libamrex and all tutorials with CUDA 9.1 (oldest supported) + tutorials-cuda9: name: CUDA@9.1.85 GNU@4.8.5 C++11 Release [tutorials] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: {CXXFLAGS: "-fno-operator-names"} steps: - uses: actions/checkout@v2 - name: Dependencies - run: .github/workflows/dependencies/dependencies_nvcc.sh + run: .github/workflows/dependencies/dependencies_nvcc9.sh - name: Build & Install run: | mkdir build @@ -171,6 +171,35 @@ jobs: -DAMReX_CUDA_ARCH=6.0 make -j 2 + # Build libamrex and all tutorials with CUDA 11.0.2 (recent supported) + tutorials-cuda11: + name: CUDA@11.2 GNU@9.3.0 C++14 Release [tutorials] + runs-on: ubuntu-20.04 + env: {CXXFLAGS: "-fno-operator-names"} + steps: + - uses: actions/checkout@v2 + - name: Dependencies + run: .github/workflows/dependencies/dependencies_nvcc11.sh + - name: Build & Install + run: | + export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} + export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH} + which nvcc || echo "nvcc not in PATH!" + + cmake -S . -B build \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DAMReX_BUILD_TUTORIALS=ON \ + -DAMReX_PARTICLES=ON \ + -DAMReX_GPU_BACKEND=CUDA \ + -DCMAKE_C_COMPILER=$(which gcc) \ + -DCMAKE_CXX_COMPILER=$(which g++) \ + -DCMAKE_CUDA_HOST_COMPILER=$(which g++) \ + -DCMAKE_Fortran_COMPILER=$(which gfortran) \ + -DCMAKE_CUDA_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=14 \ + -DAMReX_CUDA_ARCH=8.0 + cmake --build build -j 2 + tutorials-dpcpp: name: DPCPP GFortran@7.5 C++17 [tutorials] runs-on: ubuntu-20.04 @@ -230,7 +259,7 @@ jobs: # Build 1D libamrex with configure configure-1d: name: GNU@7.5 Release [configure 1D] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Dependencies @@ -244,7 +273,7 @@ jobs: # Build 2D libamrex with configure configure-2d: name: Clang@6.0 NOMPI Release [configure 2D] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Dependencies @@ -258,7 +287,7 @@ jobs: # Build 3D libamrex with configure configure-3d: name: GNU@7.5 Release [configure 3D] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Dependencies @@ -272,7 +301,7 @@ jobs: # Build 3D libamrex debug omp build with configure configure-3d-omp-debug: name: GNU@7.5 OMP Debug [configure 3D] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Dependencies @@ -286,7 +315,7 @@ jobs: # Build Tools/Plotfile plotfile-tools: name: GNU Plotfile Tools [tools] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Dependencies @@ -299,7 +328,7 @@ jobs: # Build libamrex and run all tests tests: name: GNU@7.5 C++14 [tests] - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"} steps: - uses: actions/checkout@v2