Skip to content

Commit 09f2bc8

Browse files
Add Blackwell (sm100) environment and extend CI for B200/B300
- envs/x86/sm100/: spack.yaml and Dockerfile targeting cuda_arch=100 with CUDA 13.0 - Workflow matrix switched to include entries pairing each arch with its CUDA version - Dockerfile path in CI now dynamic: envs/x86/<gpu_arch>/Dockerfile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 940872f commit 09f2bc8

4 files changed

Lines changed: 226 additions & 3 deletions

File tree

.github/workflows/build-nvidia.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
- main
77
paths:
88
- envs/x86/sm70/**
9+
- envs/x86/sm100/**
910
- .github/workflows/build-nvidia.yml
1011
pull_request:
1112
paths:
1213
- envs/x86/sm70/**
14+
- envs/x86/sm100/**
1315
- .github/workflows/build-nvidia.yml
1416
workflow_dispatch:
1517

@@ -26,8 +28,11 @@ jobs:
2628
strategy:
2729
fail-fast: false
2830
matrix:
29-
gpu_arch: [sm70]
30-
cuda_version: ["12.4"]
31+
include:
32+
- gpu_arch: sm70
33+
cuda_version: "12.4"
34+
- gpu_arch: sm100
35+
cuda_version: "13.0"
3136
steps:
3237
- name: Check out repository
3338
uses: actions/checkout@v4
@@ -72,7 +77,7 @@ jobs:
7277
uses: docker/build-push-action@v5
7378
with:
7479
context: .
75-
file: envs/x86/sm70/Dockerfile
80+
file: envs/x86/${{ matrix.gpu_arch }}/Dockerfile
7681
push: ${{ github.event_name != 'pull_request' }}
7782
tags: ${{ steps.meta.outputs.tags }}
7883
build-args: |

envs/x86/sm100/Dockerfile

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
FROM docker.io/rockylinux:9 AS bootstrap
2+
3+
ARG CUDA_VERSION=13.0
4+
5+
ENV SPACK_ROOT=/opt/spack \
6+
CURRENTLY_BUILDING_DOCKER_IMAGE=1 \
7+
container=docker
8+
9+
RUN dnf update -y \
10+
&& dnf install -y epel-release \
11+
&& dnf update -y \
12+
&& dnf --enablerepo epel install -y \
13+
bzip2 \
14+
cmake \
15+
curl-minimal \
16+
file \
17+
findutils \
18+
gcc-c++ \
19+
gcc \
20+
gcc-gfortran \
21+
git \
22+
gnupg2 \
23+
hg \
24+
hostname \
25+
iproute \
26+
make \
27+
patch \
28+
python3 \
29+
python3-pip \
30+
python3-setuptools \
31+
svn \
32+
unzip \
33+
xz \
34+
zstd \
35+
&& pip3 install boto3 \
36+
&& rm -rf /var/cache/dnf \
37+
&& dnf clean all
38+
39+
# Install CUDA toolkit from NVIDIA repo
40+
RUN dnf config-manager \
41+
--add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo \
42+
&& dnf clean all \
43+
&& dnf update -y \
44+
&& dnf install -y cuda-toolkit-$(echo ${CUDA_VERSION} | tr '.' '-')
45+
46+
RUN ls -l /usr/local/cuda-${CUDA_VERSION}/include/cuda.h
47+
48+
RUN mkdir $SPACK_ROOT && cd $SPACK_ROOT && \
49+
git init --quiet && git remote add origin https://github.com/spack/spack.git && git fetch --depth=1 origin develop && git checkout --detach FETCH_HEAD && \
50+
mkdir -p $SPACK_ROOT/opt/spack
51+
52+
RUN ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
53+
/usr/local/bin/docker-shell \
54+
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
55+
/usr/local/bin/interactive-shell \
56+
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
57+
/usr/local/bin/spack-env
58+
59+
RUN mkdir -p /root/.spack \
60+
&& cp $SPACK_ROOT/share/spack/docker/modules.yaml \
61+
/root/.spack/modules.yaml \
62+
&& rm -rf /root/*.* /run/nologin
63+
64+
# [WORKAROUND]
65+
# https://superuser.com/questions/1241548/
66+
# xubuntu-16-04-ttyname-failed-inappropriate-ioctl-for-device#1253889
67+
RUN [ -f ~/.profile ] \
68+
&& sed -i 's/mesg n/( tty -s \\&\\& mesg n || true )/g' ~/.profile \
69+
|| true
70+
71+
72+
WORKDIR /root
73+
SHELL ["docker-shell"]
74+
75+
# Creates the package cache
76+
RUN spack bootstrap now \
77+
&& spack bootstrap status --optional \
78+
&& spack spec hdf5+mpi
79+
80+
ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
81+
CMD ["interactive-shell"]
82+
83+
# Build stage with Spack pre-installed and ready to be used
84+
FROM bootstrap AS builder
85+
86+
87+
# What we want to install and how we want to install it
88+
# is specified in a manifest file (spack.yaml)
89+
RUN mkdir -p /opt/spack-environment && \
90+
set -o noclobber \
91+
&& (echo spack: \
92+
&& echo ' specs:' \
93+
&& echo ' - feq-parse@2.2.2' \
94+
&& echo ' - openmpi@5.0.8 +cuda cuda_arch=100' \
95+
&& echo ' - hdf5@1.14.5 +fortran +mpi' \
96+
&& echo ' - cmake@3.31.11'\
97+
&& echo ' packages:' \
98+
&& echo ' all:' \
99+
&& echo ' require:' \
100+
&& echo ' - target=x86_64_v3' \
101+
&& echo ' prefer:' \
102+
&& echo ' - cuda_arch=100' \
103+
&& echo ' cuda:' \
104+
&& echo ' buildable: false' \
105+
&& echo ' externals:' \
106+
&& echo " - spec: \"cuda@${CUDA_VERSION}\"" \
107+
&& echo " prefix: \"/usr/local/cuda-${CUDA_VERSION}\"" \
108+
&& echo '' \
109+
&& echo ' concretizer:' \
110+
&& echo ' unify: true' \
111+
&& echo ' config:' \
112+
&& echo ' install_tree:' \
113+
&& echo ' root: /opt/software' \
114+
&& echo ' view: /opt/views/view') > /opt/spack-environment/spack.yaml
115+
116+
# Apply feq-parse patch to add "c" build dependency
117+
COPY ./envs/x86/sm100/feq-parse.patch /tmp/feq-parse.patch
118+
#
119+
RUN SPACK_PKGS_ROOT=$(spack repo list | awk '{print $NF}') &&\
120+
SPACK_BUILTIN_PKGS_ROOT=${SPACK_PKGS_ROOT/repos\/spack_repo\/builtin} &&\
121+
patch -p1 -d $SPACK_BUILTIN_PKGS_ROOT < /tmp/feq-parse.patch
122+
123+
# Install the software, remove unnecessary deps
124+
RUN cd /opt/spack-environment && spack env activate . && spack repo list && spack install --fail-fast && spack gc -y
125+
126+
# Strip all the binaries
127+
RUN find -L /opt/views/view/* -type f -exec readlink -f '{}' \; | \
128+
xargs file -i | \
129+
grep 'charset=binary' | \
130+
grep 'x-executable\|x-archive\|x-sharedlib' | \
131+
awk -F: '{print $1}' | xargs strip
132+
133+
# Modifications to the environment that are necessary to run
134+
RUN cd /opt/spack-environment && \
135+
spack env activate --sh -d . > activate.sh
136+
137+
138+
# Bare OS image to run the installed executables
139+
FROM docker.io/rockylinux:9
140+
141+
COPY --from=builder /opt/spack-environment /opt/spack-environment
142+
COPY --from=builder /opt/software /opt/software
143+
144+
RUN dnf update -y \
145+
&& dnf install -y epel-release \
146+
&& dnf update -y \
147+
&& dnf --enablerepo epel install -y \
148+
bzip2 \
149+
cmake \
150+
curl-minimal \
151+
file \
152+
findutils \
153+
gcc-c++ \
154+
gcc \
155+
gcc-gfortran \
156+
lcov
157+
158+
# Install CUDA runtime libraries
159+
ARG CUDA_VERSION=13.0
160+
RUN dnf config-manager \
161+
--add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo \
162+
&& dnf clean all \
163+
&& dnf update -y \
164+
&& dnf install -y \
165+
cuda-libraries-$(echo ${CUDA_VERSION} | tr '.' '-') \
166+
cuda-nvtx-$(echo ${CUDA_VERSION} | tr '.' '-')
167+
168+
# paths.view is a symlink, so copy the parent to avoid dereferencing and duplicating it
169+
COPY --from=builder /opt/views /opt/views
170+
171+
RUN { \
172+
echo '#!/bin/sh' \
173+
&& echo '.' /opt/spack-environment/activate.sh \
174+
&& echo 'exec "$@"'; \
175+
} > /entrypoint.sh \
176+
&& chmod a+x /entrypoint.sh \
177+
&& ln -s /opt/views/view /opt/view
178+
179+
180+
LABEL "mpi"="openmpi"
181+
ENTRYPOINT [ "/entrypoint.sh" ]
182+
CMD [ "/bin/bash" ]

envs/x86/sm100/feq-parse.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/repos/spack_repo/builtin/packages/feq_parse/package.py b/repos/spack_repo/builtin/packages/feq_parse/package.py
2+
index e4b960b7..bc0916b9 100644
3+
--- a/repos/spack_repo/builtin/packages/feq_parse/package.py
4+
+++ b/repos/spack_repo/builtin/packages/feq_parse/package.py
5+
@@ -29,6 +29,7 @@ class FeqParse(CMakePackage):
6+
version("1.0.2", sha256="1cd1db7562908ea16fc65dc5268b654405d0b3d9dcfe11f409949c431b48a3e8")
7+
8+
depends_on("fortran", type="build") # generated
9+
+ depends_on("c", type="build") # generated
10+
11+
depends_on("cmake@3.0.2:", type="build")
12+

envs/x86/sm100/spack.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
spack:
2+
specs:
3+
- feq-parse@2.2.2
4+
- openmpi@5.0.8 +cuda cuda_arch=100
5+
- hdf5@1.14.5 +fortran +mpi
6+
7+
packages:
8+
all:
9+
require:
10+
- "target=x86_64_v3"
11+
prefer:
12+
- "cuda_arch=100"
13+
14+
container:
15+
format: docker
16+
images:
17+
os: rockylinux:9
18+
spack:
19+
ref: v1.0.2
20+
21+
strip: true
22+
23+
labels:
24+
mpi: openmpi

0 commit comments

Comments
 (0)