From 58d42d4d29070f160d109c8b116b0f7559417328 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Wed, 2 Nov 2022 08:19:29 -0500 Subject: [PATCH] CUDA CI: Ubuntu 20.04+ (#3496) Migrate CUDA CI to use Ubuntu 18.04 -> 20.04 --- .github/workflows/cuda.yml | 12 ++-- .../dependencies/{nvcc11.sh => nvcc11-0.sh} | 8 ++- .github/workflows/dependencies/nvcc11-8.sh | 61 +++++++++++++++++++ 3 files changed, 72 insertions(+), 9 deletions(-) rename .github/workflows/dependencies/{nvcc11.sh => nvcc11-0.sh} (85%) create mode 100755 .github/workflows/dependencies/nvcc11-8.sh diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index b3554875332..e2700cb0f90 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -12,8 +12,8 @@ jobs: # https://github.com/ComputationalRadiationPhysics/picongpu/blob/0.5.0/share/picongpu/dockerfiles/ubuntu-1604/Dockerfile # https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ build_nvcc: - name: NVCC 11.0.2 SP - runs-on: ubuntu-18.04 + name: NVCC 11.0.3 SP + runs-on: ubuntu-20.04 if: github.event.pull_request.draft == false env: CXXFLAGS: "-Werror" @@ -30,7 +30,7 @@ jobs: python-version: '3.x' - name: install dependencies run: | - .github/workflows/dependencies/nvcc11.sh + .github/workflows/dependencies/nvcc11-0.sh - name: CCache Cache uses: actions/cache@v2 # - once stored under a key, they become immutable (even if local cache path content changes) @@ -83,14 +83,14 @@ jobs: # make sure legacy build system continues to build, i.e., that we don't forget # to add new .cpp files build_nvcc_gnumake: - name: NVCC 11.0.2 GNUmake - runs-on: ubuntu-18.04 + name: NVCC 11.8.0 GNUmake + runs-on: ubuntu-20.04 if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v2 - name: install dependencies run: | - .github/workflows/dependencies/nvcc11.sh + .github/workflows/dependencies/nvcc11-8.sh - name: CCache Cache uses: actions/cache@v2 # - once stored under a key, they become immutable (even if local cache path content changes) diff --git a/.github/workflows/dependencies/nvcc11.sh b/.github/workflows/dependencies/nvcc11-0.sh similarity index 85% rename from .github/workflows/dependencies/nvcc11.sh rename to .github/workflows/dependencies/nvcc11-0.sh index 7f52c0ce000..2f840e41664 100755 --- a/.github/workflows/dependencies/nvcc11.sh +++ b/.github/workflows/dependencies/nvcc11-0.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2020 The WarpX Community +# Copyright 2020-2022 The WarpX Community # # License: BSD-3-Clause-LBNL # Authors: Axel Huebl @@ -21,8 +21,10 @@ sudo apt-get install -y \ pkg-config \ wget -sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub -echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" \ +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 +echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" \ | sudo tee /etc/apt/sources.list.d/cuda.list sudo apt-get update diff --git a/.github/workflows/dependencies/nvcc11-8.sh b/.github/workflows/dependencies/nvcc11-8.sh new file mode 100755 index 00000000000..fbf1ee6ba62 --- /dev/null +++ b/.github/workflows/dependencies/nvcc11-8.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# +# Copyright 2020-2022 The WarpX Community +# +# License: BSD-3-Clause-LBNL +# Authors: Axel Huebl + +set -eu -o pipefail + +sudo apt-get -qqq update +sudo apt-get install -y \ + build-essential \ + ca-certificates \ + cmake \ + gnupg \ + libhiredis-dev \ + libopenmpi-dev \ + libzstd-dev \ + ninja-build \ + openmpi-bin \ + pkg-config \ + wget + +wget 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-11-8 \ + cuda-compiler-11-8 \ + cuda-cupti-dev-11-8 \ + cuda-minimal-build-11-8 \ + cuda-nvml-dev-11-8 \ + cuda-nvtx-11-8 \ + libcufft-dev-11-8 \ + libcurand-dev-11-8 +sudo ln -s cuda-11.8 /usr/local/cuda + +# if we run out of temporary storage in CI: +#du -sh /usr/local/cuda-11.8 +#echo "+++ REDUCING CUDA Toolkit install size +++" +#sudo rm -rf /usr/local/cuda-11.8/targets/x86_64-linux/lib/libcu{fft,pti,rand}_static.a +#sudo rm -rf /usr/local/cuda-11.8/targets/x86_64-linux/lib/libnvperf_host_static.a +#du -sh /usr/local/cuda-11.8/ +#df -h + +# cmake-easyinstall +# +sudo curl -L -o /usr/local/bin/cmake-easyinstall https://git.io/JvLxY +sudo chmod a+x /usr/local/bin/cmake-easyinstall +export CEI_SUDO="sudo" +export CEI_TMP="/tmp/cei" + +# ccache 4.2+ +# +CXXFLAGS="" cmake-easyinstall --prefix=/usr/local \ + git+https://github.com/ccache/ccache.git@v4.6 \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_DOCUMENTATION=OFF \ + -DENABLE_TESTING=OFF \ + -DWARNINGS_AS_ERRORS=OFF