Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions .github/workflows/build-and-push-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'build base image'
check-name: "build base image"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

Expand Down Expand Up @@ -74,16 +74,16 @@ jobs:
- name: push developer-cpu image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/developer-cpu:latest

build-cuda-sm70:
name: build cuda-sm70 images
build-cuda-sm89:
name: build cuda-sm89 images
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: wait for base image
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'build base image'
check-name: "build base image"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

Expand All @@ -97,29 +97,29 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build cuda-sm70 image
- name: build cuda-sm89 image
run: |
docker-compose build --build-arg cuda_arch_sm=70 cuda
docker-compose build --build-arg cuda_arch_sm=89 cuda
docker image tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda:latest \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-sm70:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-sm89:latest

- name: push cuda-sm70 image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-sm70:latest
- name: push cuda-sm89 image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-sm89:latest

- name: build cuda-tpls-sm70 image
- name: build cuda-tpls-sm89 image
run: |
docker-compose build --build-arg cuda_arch_sm=70 cuda-tpls
docker-compose build --build-arg cuda_arch_sm=89 cuda-tpls
docker image tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-tpls:latest \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-tpls-sm70:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-tpls-sm89:latest

- name: push cuda-tpls-sm70 image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-tpls-sm70:latest
- name: push cuda-tpls-sm89 image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/cuda-tpls-sm89:latest

- name: build developer-cuda-sm70 image
- name: build developer-cuda-sm89 image
run: |
docker-compose build --build-arg base_image=cuda-tpls-sm70 developer-cuda
docker-compose build --build-arg base_image=cuda-tpls-sm89 developer-cuda
docker image tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/developer-cuda:latest \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/developer-cuda-sm70:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/developer-cuda-sm89:latest

- name: push developer-cuda-sm70 image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/developer-cuda-sm70:latest
- name: push developer-cuda-sm89 image
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_PREFIX }}/developer-cuda-sm89:latest
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,38 @@ Both types are available in the following configurations:

- [`cpu`](https://github.com/mfem/containers/pkgs/container/containers%2Fcpu)
- OpenMPI 4.1.2
- hypre 2.27
- hypre 2.31.0

- [`cuda-sm70`](https://github.com/mfem/containers/pkgs/container/containers%2Fcuda-sm70)
- CUDA toolkit 11.8
- [`cuda-sm89`](https://github.com/mfem/containers/pkgs/container/containers%2Fcuda-sm89)
- CUDA toolkit 12.9
- OpenMPI 4.1.2
- hypre 2.27
- hypre 2.31.0

- [`cpu-tpls`](https://github.com/mfem/containers/pkgs/container/containers%2Fcpu-tpls)
- OpenMPI 4.1.2
- hypre 2.27.0
- hypre 2.31.0
- SuperLU_dist 8.2.1
- PETSc 3.20.2

- [`cuda-tpls-sm70`](https://github.com/mfem/containers/pkgs/container/containers%2Fcuda-tpls-sm70)
- CUDA toolkit 11.8
- [`cuda-tpls-sm89`](https://github.com/mfem/containers/pkgs/container/containers%2Fcuda-tpls-sm89)
- CUDA toolkit 12.9
- OpenMPI 4.1.2
- hypre 2.27.0
- hypre 2.31.0
- AmgX 8.2.1

- [`developer-cpu`](https://github.com/mfem/containers/pkgs/container/containers%2Fdeveloper-cpu)
- extension of `cpu-tpls` that includes a development environment with VSCode server and GLVis
- see the MFEM [AWS tutorial](https://mfem.org/tutorial/docker) for details
- [`developer-cuda-sm70`](https://github.com/mfem/containers/pkgs/container/containers%2Fdeveloper-cuda-sm70)
- extension of `cuda-tpls-sm70` that includes a development environment with VSCode server and GLVis

- [`developer-cuda-sm89`](https://github.com/mfem/containers/pkgs/container/containers%2Fdeveloper-cuda-sm89)
- extension of `cuda-tpls-sm89` that includes a development environment with VSCode server and GLVis
- see the MFEM [AWS tutorial](https://mfem.org/tutorial/docker) for details

Note that the `cuda` images require the host has the
Note that the `cuda` images require the host has the
[NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) to installed and configured.

Note also that the `cuda` images have MFEM and its third-party libraries configured for
CUDA `sm_70`. You can create your own image that support a different compute capability with
CUDA `sm_89`. You can create your own image that support a different compute capability (e.g. sm_80) with
`docker-compose` as follows:
```
git clone [email protected]:mfem/containers.git
Expand All @@ -60,7 +60,7 @@ docker-compose build --build-arg cuda_arch_sm=80 cuda-tpls && docker image tag c

We recommend starting the container with:
```
docker run --cap-add=SYS_PTRACE -ti --gpus all ghcr.io/mfem/containers/cuda-tpls-sm70:latest /bin/bash
docker run --rm --cap-add=SYS_PTRACE --runtime=nvidia --gpus all -ti ghcr.io/mfem/containers/cuda-tpls-sm89:latest bash
```
which puts you in the home directory for the `euler` user, enables access to all GPUs, and lets you
explore the broad selection of examples or write your own.
31 changes: 23 additions & 8 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ARG num_jobs

RUN apt-get update && apt-get install -y \
curl git git-lfs clang clang-tools clangd cmake autoconf \
automake gdb git libffi-dev zlib1g-dev python3-pip \
libssl-dev xz-utils pkgconf gfortran openmpi-bin libopenmpi-dev \
wget libarchive-tools htop libmetis-dev libparmetis-dev libopenblas-dev
curl git git-lfs clangd cmake autoconf lsb-release \
automake gdb git libffi-dev zlib1g-dev python3-pip libzstd-dev \
libssl-dev xz-utils pkgconf gfortran openmpi-bin libopenmpi-dev \
wget libarchive-tools htop libmetis-dev libparmetis-dev libopenblas-dev

RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
RUN curl -L https://apt.llvm.org/llvm-snapshot.gpg.key > /etc/apt/trusted.gpg.d/apt.llvm.org.asc &&\
echo "deb http://apt.llvm.org/$(lsb_release -sc)/ llvm-toolchain-$(lsb_release -sc) main" | tee /etc/apt/sources.list.d/apt.llvm.org.list

RUN apt-get update && apt-get install -y clang-19 libclang-19-dev clangd-19

RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-19 100 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-19 100 && \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100 && \
update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-19 100

ENV OMPI_CC=clang
ENV OMPI_CXX=clang++
ENV LD_LIBRARY_PATH=/usr/local/lib

RUN curl -L https://github.com/EnzymeAD/Enzyme/archive/refs/tags/v0.0.186.tar.gz > enzyme.tar.gz && \
tar -xzf enzyme.tar.gz && \
cd Enzyme-0.0.186/enzyme && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DLLVM_DIR=/usr/lib/llvm-19 && \
make -j ${num_jobs} && make install

RUN useradd --create-home --shell /bin/bash euler

USER euler
WORKDIR /home/euler
WORKDIR /home/euler
Loading