Update Cuda CI based on amrex and ERF #1681
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: cuda | |
| on: [push, pull_request] | |
| jobs: | |
| # Build libamrex and all tests with CUDA 9.2 | |
| # tests-cuda9: | |
| # name: CUDA@9.2 GNU@6.5.0 C++14 Release [tests] | |
| # runs-on: ubuntu-18.04 | |
| # env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wunreachable-code"} | |
| # steps: | |
| # - uses: actions/checkout@v2 | |
| # - name: Dependencies | |
| # run: .github/workflows/dependencies/dependencies_nvcc9.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!" | |
| # mkdir build | |
| # cd build | |
| # cmake .. \ | |
| # -DCMAKE_VERBOSE_MAKEFILE=ON \ | |
| # -DAMReX_ENABLE_TESTS=ON \ | |
| # -DAMReX_FORTRAN=OFF \ | |
| # -DAMReX_PARTICLES=ON \ | |
| # -DAMReX_GPU_BACKEND=CUDA \ | |
| # -DCMAKE_C_COMPILER=$(which gcc-6) \ | |
| # -DCMAKE_CXX_COMPILER=$(which g++-6) \ | |
| # -DCMAKE_CUDA_HOST_COMPILER=$(which g++-6) \ | |
| # -DCMAKE_Fortran_COMPILER=$(which gfortran-6) \ | |
| # -DAMReX_CUDA_ARCH=6.0 \ | |
| # -DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON | |
| # make -j 2 | |
| # Build libamrex and all tests with CUDA 12.0 | |
| tests-cuda11: | |
| name: CUDA@12.0 GNU C++17 Release [${{ matrix.app }}] DIM=${{ matrix.dim }} | |
| runs-on: ubuntu-22.04 | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| app: | |
| - compressible | |
| - compressible_stag | |
| - immersedIons | |
| dim: [3] | |
| include: | |
| # 2D and 3D tests for specified applications | |
| - app: structFactTest | |
| dim: 2 | |
| - app: structFactTest | |
| dim: 3 | |
| - app: reactDiff | |
| dim: 2 | |
| - app: reactDiff | |
| dim: 3 | |
| - app: multispec | |
| dim: 2 | |
| - app: multispec | |
| dim: 3 | |
| - app: dean_kow/singlelevel | |
| dim: 2 | |
| - app: dean_kow/singlelevel | |
| dim: 3 | |
| - app: dean_kow/multilevel | |
| dim: 2 | |
| - app: dean_kow/multilevel | |
| dim: 3 | |
| - app: hydro | |
| dim: 2 | |
| - app: hydro | |
| dim: 3 | |
| env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code"} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Clone AMReX for dependency scripts | |
| run: | | |
| git clone https://github.com/AMReX-Codes/amrex.git ${{runner.workspace}}/amrex | |
| - name: Prepare CUDA environment | |
| run: ${{runner.workspace}}/amrex/.github/workflows/dependencies/dependencies_nvcc.sh 12.0 | |
| - name: Install Additional Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libfftw3-dev libfftw3-mpi-dev | |
| - name: Install CCache | |
| run: ${{runner.workspace}}/amrex/.github/workflows/dependencies/dependencies_ccache.sh | |
| - name: Set Up Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ccache | |
| key: ccache-${{ github.workflow }}-${{ github.job }}-${{ matrix.app }}-git-${{ github.sha }} | |
| restore-keys: | | |
| ccache-${{ github.workflow }}-${{ github.job }}-${{ matrix.app }}-git- | |
| - name: Enable Problem Matchers | |
| run: echo "::add-matcher::.github/problem-matchers/gcc.json" | |
| - name: Build & Install ${{ matrix.app }} | |
| continue-on-error: true | |
| run: | | |
| export CCACHE_COMPRESS=1 | |
| export CCACHE_COMPRESSLEVEL=10 | |
| export CCACHE_MAXSIZE=600M | |
| ccache -z | |
| 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} | |
| export LD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/lib64:${LD_LIBRARY_PATH} | |
| cd exec/${{ matrix.app }} | |
| which nvcc || echo "nvcc not in PATH!" | |
| make -j2 VERBOSE=1 USE_MPI=TRUE USE_CUDA=TRUE USE_OMP=FALSE DIM=${{ matrix.dim }} TINY_PROFILE=FALSE 2>&1 | tee ${{runner.workspace}}/build-output.txt | |
| ccache -s | |
| du -hs ~/.cache/ccache | |
| env: | |
| AMREX_HOME: ${{runner.workspace}}/amrex | |
| - name: Report | |
| id: report | |
| continue-on-error: true | |
| run: | | |
| # Extract and count warnings | |
| egrep "warning:" ${{runner.workspace}}/build-output.txt \ | |
| # | egrep -v "amrex" \ | |
| # Note: if avoiding third party library errors, filter by full path like ${{runner.workspace}}/amrex instead \ | |
| | egrep -v "lto-wrapper: warning:" \ | |
| | sort | uniq \ | |
| | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > ${{runner.workspace}}/build-warnings.txt | |
| # Extract and count errors | |
| egrep "error:" ${{runner.workspace}}/build-output.txt \ | |
| # | egrep -v "amrex" \ | |
| # Note: if avoiding third party library errors, filter by full path like ${{runner.workspace}}/amrex instead \ | |
| | sort | uniq \ | |
| | awk 'BEGIN{i=0}{print $0}{i++}END{print "Errors: "i}' > ${{runner.workspace}}/build-errors.txt | |
| echo "=== WARNINGS ===" | |
| cat ${{runner.workspace}}/build-warnings.txt | |
| echo "=== ERRORS ===" | |
| cat ${{runner.workspace}}/build-errors.txt | |
| # Store error count for later use | |
| export error_count=$(tail -n 1 ${{runner.workspace}}/build-errors.txt | awk '{print $2}') | |
| echo "error_count=${error_count}" >> $GITHUB_OUTPUT | |
| - name: Generate Error Summary | |
| if: always() | |
| run: | | |
| echo "## Build Report 📊" >> $GITHUB_STEP_SUMMARY | |
| echo "**Job Details:**" >> $GITHUB_STEP_SUMMARY | |
| echo "- App: ${{ matrix.app }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- Dimensions: ${{ matrix.dim }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- Commit: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- Branch: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| # Add warnings if they exist | |
| if [ -f "${{runner.workspace}}/build-warnings.txt" ]; then | |
| echo "## ⚠️ Warnings" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cat ${{runner.workspace}}/build-warnings.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| # Add errors if they exist | |
| if [ -f "${{runner.workspace}}/build-errors.txt" ]; then | |
| echo "## 🚨 Errors" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cat ${{runner.workspace}}/build-errors.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Fail on Errors | |
| if: steps.report.outputs.error_count != '0' | |
| run: exit 1 | |
| # # Build 3D libamrex cuda build with configure | |
| # configure-3d-cuda: | |
| # name: CUDA@11.2 GNU@9.3.0 [configure 3D] | |
| # runs-on: ubuntu-20.04 | |
| # 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} | |
| # ./configure --dim 3 --with-cuda yes --enable-eb yes --enable-xsdk-defaults yes --with-fortran no | |
| # make -j2 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS=-fno-operator-names CXXSTD=c++17 | |
| # make install |