Skip to content

Add GPU CI with NVIDIA Docker for OpenACC testing #212

@krystophny

Description

@krystophny

Problem

Currently there is no CI verification for GPU/OpenACC code. GPU regressions could go undetected.

Proposal

Add a GitHub Actions workflow that uses NVIDIA Docker to:

  1. Build the interpolate library with nvfortran + OpenACC
  2. Build and run GPU benchmarks
  3. Verify GPU execution produces correct results (max_abs_diff = 0)

Implementation

Docker Image

Use official NVIDIA HPC SDK container:

container:
  image: nvcr.io/nvidia/nvhpc:25.11-devel-cuda12.6-ubuntu24.04
  options: --gpus all

Or build custom image with:

  • NVHPC SDK 25.11+
  • CUDA toolkit
  • CMake, Ninja
  • Required dependencies (BLAS, LAPACK, etc.)

Workflow Structure

name: GPU Tests

on:
  push:
    branches: [main]
  pull_request:
    paths:
      - 'src/interpolate/**'
      - 'bench/spline_many/**'

jobs:
  gpu-benchmark:
    runs-on: [self-hosted, gpu]  # or use GPU runners
    container:
      image: nvcr.io/nvidia/nvhpc:25.11-devel-cuda12.6-ubuntu24.04
      options: --gpus all
    steps:
      - uses: actions/checkout@v4
      
      - name: Build benchmarks
        run: |
          cmake -S bench/spline_many -B build -G Ninja \
            -DCMAKE_Fortran_COMPILER=nvfortran
          cmake --build build
      
      - name: Run GPU benchmarks
        run: |
          ACC_DEVICE_TYPE=nvidia ./build/bench_spline1d_many
          ACC_DEVICE_TYPE=nvidia ./build/bench_spline2d_many
          ACC_DEVICE_TYPE=nvidia ./build/bench_spline3d_many
      
      - name: Verify correctness
        run: |
          # Check that max_abs_diff = 0 in output
          ACC_DEVICE_TYPE=nvidia ./build/bench_spline3d_many 2>&1 | \
            grep -q "max_abs_diff     0.000000000000000"

Runner Options

  1. Self-hosted GPU runner: Most flexible, requires hardware
  2. GitHub GPU runners: Available in some plans (expensive)
  3. AWS/GCP spot instances: Cost-effective for periodic testing

Scope

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions