Skip to content

Commit 0b56ec9

Browse files
authored
Add CUDA 12.2 CI test (AMReX-Codes#5381)
CUDA 12.2 is the current minimum supported version, so add CI coverage for it. Once GitHub drops the Ubuntu 22.04 runner (in a year?), we may need to drop this CI or update it. This also covers AMReX_PRECISION=DOUBLE && AMReX_PARTICLES_PRECISION=SINGLE.
1 parent a666093 commit 0b56ec9

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/cuda.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,63 @@ jobs:
1414
check_changes:
1515
uses: ./.github/workflows/check_changes.yml
1616

17+
# Build libamrex and all tests with CUDA 12.2
18+
tests-cuda12-2:
19+
name: CUDA@12.2 Release Single Precision Particle [tests]
20+
runs-on: ubuntu-22.04
21+
needs: check_changes
22+
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
23+
steps:
24+
- uses: actions/checkout@v6
25+
- name: Dependencies
26+
run: |
27+
.github/workflows/dependencies/ubuntu_free_disk_space.sh
28+
.github/workflows/dependencies/dependencies_nvcc.sh 12.2
29+
.github/workflows/dependencies/dependencies_ccache.sh
30+
- name: Set Up Cache
31+
uses: actions/cache@v5
32+
with:
33+
path: ~/.cache/ccache
34+
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
35+
restore-keys: |
36+
ccache-${{ github.workflow }}-${{ github.job }}-git-
37+
- name: Build & Install
38+
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches"}
39+
run: |
40+
export CCACHE_COMPRESS=1
41+
export CCACHE_COMPRESSLEVEL=10
42+
export CCACHE_MAXSIZE=235M
43+
ccache -z
44+
45+
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
46+
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
47+
which nvcc || echo "nvcc not in PATH!"
48+
49+
cmake -S . -B build \
50+
-DCMAKE_CXX_STANDARD=20 \
51+
-DCMAKE_VERBOSE_MAKEFILE=ON \
52+
-DAMReX_PRECISION=DOUBLE \
53+
-DAMReX_PARTICLES_PRECISION=SINGLE \
54+
-DAMReX_FFT=ON \
55+
-DAMReX_EB=ON \
56+
-DAMReX_ENABLE_TESTS=ON \
57+
-DAMReX_FORTRAN=OFF \
58+
-DAMReX_GPU_BACKEND=CUDA \
59+
-DCMAKE_C_COMPILER=$(which gcc) \
60+
-DCMAKE_CXX_COMPILER=$(which g++) \
61+
-DCMAKE_CUDA_HOST_COMPILER=$(which g++) \
62+
-DCMAKE_Fortran_COMPILER=$(which gfortran) \
63+
-DAMReX_CUDA_ARCH="8.0" \
64+
-DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON \
65+
-DAMReX_CUDA_ERROR_CAPTURE_THIS=ON \
66+
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
67+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
68+
69+
cmake --build build -j 4
70+
71+
ccache -s
72+
du -hs ~/.cache/ccache
73+
1774
# Build libamrex and all tests with CUDA 12.6
1875
tests-cuda12:
1976
name: CUDA@12.6 Release [tests]

0 commit comments

Comments
 (0)