Skip to content

Commit

Permalink
CUDA CI: Ubuntu 20.04+ (ECP-WarpX#3496)
Browse files Browse the repository at this point in the history
Migrate CUDA CI to use Ubuntu 18.04 -> 20.04
  • Loading branch information
ax3l authored Nov 2, 2022
1 parent 663e7f6 commit 58d42d4
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/dependencies/nvcc11-8.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 58d42d4

Please sign in to comment.