Skip to content

Commit 21fd4e6

Browse files
authored
ci: add CUDA Docker image support for NVIDIA Spark GB10 (#1512)
1 parent 8308042 commit 21fd4e6

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
build-and-push-docker-images:
178178
name: Build and push container images
179179
if: ${{ github.event_name != 'pull_request' }}
180-
runs-on: ubuntu-latest
180+
runs-on: ${{ matrix.runner }}
181181

182182
permissions:
183183
contents: read
@@ -189,6 +189,20 @@ jobs:
189189
strategy:
190190
matrix:
191191
variant: [musa, sycl, vulkan, cuda]
192+
platform: [linux/amd64]
193+
runner: [ubuntu-latest]
194+
build-args: [""]
195+
tag-suffix: [""]
196+
include:
197+
- variant: cuda
198+
platform: linux/arm64
199+
runner: ubuntu-24.04-arm
200+
tag-suffix: "-spark"
201+
build-args: |
202+
CUDA_VERSION=13.0.0
203+
UBUNTU_VERSION=24.04
204+
CUDA_ARCHITECTURES=121
205+
GGML_CUDA_FA_ALL_QUANTS=ON
192206
193207
env:
194208
REGISTRY: ghcr.io
@@ -243,12 +257,13 @@ jobs:
243257
uses: docker/build-push-action@v6
244258
with:
245259
context: .
246-
platforms: linux/amd64
260+
platforms: ${{ matrix.platform }}
247261
push: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
248262
file: Dockerfile.${{ matrix.variant }}
249-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}-${{ matrix.variant }}
263+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}-${{ matrix.variant }}${{ matrix.tag-suffix }}
250264
labels: ${{ steps.meta.outputs.labels }}
251265
annotations: ${{ steps.meta.outputs.annotations }}
266+
build-args: ${{ matrix.build-args }}
252267

253268
macOS-latest-cmake:
254269
runs-on: macos-latest

Dockerfile.cuda

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ WORKDIR /sd.cpp
1010
COPY . .
1111

1212
ARG CUDACXX=/usr/local/cuda/bin/nvcc
13-
RUN cmake . -B ./build -DSD_CUDA=ON
13+
ARG CUDA_ARCHITECTURES=""
14+
ARG GGML_CUDA_FA_ALL_QUANTS=""
15+
16+
RUN cmake . -B ./build \
17+
-DSD_CUDA=ON \
18+
${CUDA_ARCHITECTURES:+-DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCHITECTURES}"} \
19+
${GGML_CUDA_FA_ALL_QUANTS:+-DGGML_CUDA_FA_ALL_QUANTS=${GGML_CUDA_FA_ALL_QUANTS}}
1420
RUN cmake --build ./build --config Release -j$(nproc)
1521

1622
FROM nvidia/cuda:${CUDA_VERSION}-cudnn-runtime-ubuntu${UBUNTU_VERSION} AS runtime

0 commit comments

Comments
 (0)