Skip to content

Add CUDA deps-only base image for BOUT-dev CI#41

Merged
dschwoerer merged 8 commits into
boutproject:mainfrom
yassineAlouini:ci-cuda
Feb 24, 2026
Merged

Add CUDA deps-only base image for BOUT-dev CI#41
dschwoerer merged 8 commits into
boutproject:mainfrom
yassineAlouini:ci-cuda

Conversation

@yassineAlouini
Copy link
Copy Markdown
Contributor

Summary

Adds a CUDA dependencies base image (ci-cuda/) for use by BOUT-dev CI. This supersedes PR #39 with the following improvements:

  • Dockerfile: deps-only image (no BOUT++ clone/build — BOUT-dev CI handles that)
    • Added libssl-dev to apt packages (required by libevent/OpenSSL for Spack builds)
    • Added ^mpich constraint to netcdf-cxx4 and fftw specs (prevents building OpenMPI from source)
    • Added openssl to spack external find
    • Added --show-log-on-error to spack install
    • Added /usr/local/bin/bout-env.bash helper script for activating the Spack env
    • Removed bout-build stage, hardcoded password, and boutuser creation
  • CI workflow: removed unused matrix build-args (MPI, TYPE, OPENMP); set image tag to boutdev-cuda
  • README: simplified to reflect deps-only purpose

Publishes to ghcr.io/boutproject/bout-container-base:boutdev-cuda.

Companion PR: boutproject/BOUT-dev#3272

Fixes boutproject/BOUT-dev#3233

Test plan

  • CI builds the CUDA image successfully
  • BOUT-dev CUDA CI job pulls the new image and builds BOUT++

🤖 Generated with Claude Code

yassineAlouini and others added 5 commits February 11, 2026 11:54
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add libssl-dev to apt packages (required by libevent/OpenSSL for Spack)
- Add ^mpich constraint to netcdf-cxx4 and fftw (prevents building OpenMPI)
- Add openssl to spack external find
- Add --show-log-on-error to spack install
- Add /usr/local/bin/bout-env.bash helper script
- Remove bout-build stage (BOUT-dev CI handles cloning/building)
- Remove hardcoded password and boutuser creation
- Remove unused matrix build-args from CI workflow
- Set image tag to boutdev-cuda
- Simplify README to reflect deps-only purpose

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@dschwoerer dschwoerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good. Just a few small things.

Comment thread ci-cuda/Dockerfile
make -j 2 build-check && \
make check && cd ../.. && rm -rf BOUT-dev
' > /usr/local/bin/bout-env.bash && \
chmod +x /usr/local/bin/bout-env.bash
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to make sure the image is working. This way we can test that regressions are not introduced by building a broken image.

Suggested change
chmod +x /usr/local/bin/bout-env.bash
chmod +x /usr/local/bin/bout-env.bash
USER boutuser
RUN git clone ${BOUT_URL} BOUT-dev && \
cd BOUT-dev && \
git checkout ${BOUT_COMMIT} && \
. /usr/local/bin/bout-env.bash && \
git submodule update --init --recursive && \
cmake -S . \
-B build \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DBOUT_ENABLE_RAJA=on \
-DBOUT_ENABLE_UMPIRE=on \
-DBOUT_ENABLE_CUDA=on \
-DCMAKE_CUDA_ARCHITECTURES=80 \
-DCUDA_ARCH=compute_80,code=sm_80 \
-DBOUT_ENABLE_WARNINGS=off \
-DBOUT_USE_SYSTEM_FMT=on && \
cd build && \
make -j 2 build-check && \
make check && cd ../.. && rm -rf BOUT-dev

Comment thread ci-cuda/README.md
spack env activate /spack-env
spack load cmake fmt raja umpire netcdf-cxx4 fftw
```
The image is rebuilt monthly by CI and on every push to `ci-cuda`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once this is merged, it will be in the main branch.

Comment thread ci-cuda/README.md Outdated

This directory contains a Dockerfile for building BOUT++ with CUDA support.
Dependencies-only base container for BOUT-dev CUDA CI. Provides a Spack-managed
toolchain (CUDA 12.6, RAJA, Umpire, fmt, NetCDF, FFTW) on Ubuntu 22.04.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove that, so we do not duplicate that information in the docs and in the code?

Comment thread .github/workflows/ci-cuda.yml Outdated
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=boutdev-cuda
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this ci-cuda, in line with ci-fedora?

Comment thread ci-cuda/README.md Outdated
Or simply use the helper script:
```bash
/usr/local/bin/bout-env.sh <your-command>
docker build -t boutdev-cuda:latest ci-cuda/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also need fixing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will double check and come back to you later today. Thanks for the review.

- Add BOUT++ clone/build/test step to validate the image works
- Rename image tag from boutdev-cuda to ci-cuda (consistent with ci-fedora)
- Remove duplicated toolchain details from README
- Fix local build command in README to use ci-cuda tag

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dschwoerer
Copy link
Copy Markdown
Collaborator

This is failing with:

#9 28.44 -- Creating BLT CUDA targets...
#9 28.44 CMake Error at /spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/camp-2024.07.0-r42j3swnnb7outsfkejfho7av3t2mkxs/lib/cmake/camp/thirdparty/BLTSetupCUDA.cmake:26 (message):
#9 28.44   CUDA language enabled prior to setting CMAKE_CUDA_HOST_COMPILER.  Please
#9 28.44   set CMAKE_CUDA_HOST_COMPILER prior to ENABLE_LANGUAGE(CUDA) or PROJECT(..
#9 28.44   LANGUAGES CUDA)
#9 28.44 Call Stack (most recent call first):
#9 28.44   /spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/camp-2024.07.0-r42j3swnnb7outsfkejfho7av3t2mkxs/lib/cmake/camp/BLTSetupTargets.cmake:97 (include)
#9 28.44   /spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/camp-2024.07.0-r42j3swnnb7outsfkejfho7av3t2mkxs/lib/cmake/camp/campConfig.cmake:29 (include)
#9 28.44   /spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/cmake-3.30.5-kcdsfgc3mi2bwfgzlyevya757y4kbpic/share/cmake-3.30/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
#9 28.44   /spack/opt/spack/linux-ubuntu22.04-zen2/gcc-11.4.0/umpire-2024.07.0-fewrejibm3ofrhv74gwelwqxfjm4uwva/lib/cmake/umpire/umpire-config.cmake:56 (find_dependency)
#9 28.44   cmake/SetupBOUTThirdParty.cmake:46 (find_package)
#9 28.44   CMakeLists.txt:482 (include)

Also, it seems no python packages are installed. Would it be possible to install them also into the image?

@yassineAlouini
Copy link
Copy Markdown
Contributor Author

@dschwoerer Yes, I will make sure the CICD is passing.

yassineAlouini and others added 2 commits February 20, 2026 09:15
camp/BLT requires CMAKE_CUDA_HOST_COMPILER to be set before
ENABLE_LANGUAGE(CUDA). Without it, the cmake configuration fails with:
"CUDA language enabled prior to setting CMAKE_CUDA_HOST_COMPILER"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lidate stage

- Downgrade fmt 11.0.2 -> 10.2.1 for CUDA/nvcc compatibility
- Install BOUT++ Python dependencies (numpy, scipy, netcdf4, boutdata, etc.)
- Move BOUT++ validation build into a separate 'validate' Docker stage
  (requires --gpus all; not run in CI since runners lack GPUs)
- CI now builds 'setup-spack' target only to avoid GPU-requiring steps
- Parameterize CUDA_ARCH in validate stage cmake flags

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@dschwoerer dschwoerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks goods 👍

@dschwoerer dschwoerer merged commit a475211 into boutproject:main Feb 24, 2026
9 of 10 checks passed
@ZedThree
Copy link
Copy Markdown
Member

This is using fmt 10, I'd really like to use the latest version, 12. It looks like the problem is that the compiler, gcc 16, is defaulting to C++20 -- so this needs boutproject/BOUT-dev#3265 to go in first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CUDA builds failing due to missing fmt header

3 participants