build: split CUDA Docker images into cuda12 (12.9.x) / cuda13 (13.3.x), fix Blackwell Ultra arch gate (#23)
The CMakeLists.txt >=12.8 CUDA-architecture branch claimed 121a-real
(Blackwell Ultra) alongside 120a-real, but nvcc from CUDA 12.8.1
rejects compute_121 ("nvcc fatal: Unsupported gpu architecture
'compute_121'"). Confirmed against a real build: 12.8.1 compiles
cleanly with 120a-real but not 121a-real; 12.9.2 compiles both. Split
the >=12.8 branch into >=12.9 (full Blackwell + Ultra) and >=12.8
(Blackwell only, no Ultra).
Since no single CUDA toolkit spans the full arch range -- 12.9.x is
the newest 12.x that still emits Pascal (61-real) SASS, 13.x drops
Pascal entirely but is otherwise more current -- the single :cuda
image can no longer serve both audiences. Split it into two CI
variants, :cuda12 (12.9.2, Pascal through Blackwell Ultra) and
:cuda13 (13.3.1, Turing and newer). The Dockerfile's own --target
cuda stage is unchanged; the CUDA_BUILD_IMAGE/CUDA_RUNTIME_IMAGE ARGs
now default to 12.9.2 (was 12.4.1) and the CI matrix overrides them
per variant.
Both variants were build-tested against nvidia/cuda:12.8.1 and 12.9.2
locally and exercised with real end-to-end synthesis requests on an
actual sm_61 card (GTX 1070 Max-Q) -- RTF ~0.4 on both, no kernel
image / arch mismatch errors.
Co-authored-by: Gary <gitea@gerasch.dev>
This commit is contained in:
@@ -22,7 +22,21 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
variant: [cpu, cuda, vulkan]
|
||||
include:
|
||||
- variant: cpu
|
||||
target: cpu
|
||||
# Two CUDA variants: no single toolkit covers both Pascal and
|
||||
# the newest archs (see CMakeLists.txt).
|
||||
- variant: cuda12
|
||||
target: cuda
|
||||
cuda_build_image: nvidia/cuda:12.9.2-devel-ubuntu22.04
|
||||
cuda_runtime_image: nvidia/cuda:12.9.2-runtime-ubuntu22.04
|
||||
- variant: cuda13
|
||||
target: cuda
|
||||
cuda_build_image: nvidia/cuda:13.3.1-devel-ubuntu22.04
|
||||
cuda_runtime_image: nvidia/cuda:13.3.1-runtime-ubuntu22.04
|
||||
- variant: vulkan
|
||||
target: vulkan
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
@@ -54,12 +68,41 @@ jobs:
|
||||
fi
|
||||
echo "tags=${tags}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Only set these for the cuda variants, an empty value breaks cpu/vulkan.
|
||||
build_args=""
|
||||
if [ -n "${{ matrix.cuda_build_image }}" ]; then
|
||||
build_args=$'CUDA_BUILD_IMAGE=${{ matrix.cuda_build_image }}\nCUDA_RUNTIME_IMAGE=${{ matrix.cuda_runtime_image }}'
|
||||
fi
|
||||
{
|
||||
echo "build_args<<BUILD_ARGS_EOF"
|
||||
echo "$build_args"
|
||||
echo "BUILD_ARGS_EOF"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
# GHCR cache tag, read on every run; only pushed to when we're
|
||||
# logged in (not on PR builds).
|
||||
cache_ref="${image}:buildcache-${variant}"
|
||||
cache_from=$'type=gha,scope='"$variant"$'\ntype=registry,ref='"$cache_ref"
|
||||
cache_to="type=gha,mode=max,scope=${variant}"
|
||||
if [ "${{ github.event_name }}" != "pull_request" ]; then
|
||||
cache_to="${cache_to}"$'\n'"type=registry,ref=${cache_ref},mode=max"
|
||||
fi
|
||||
{
|
||||
echo "cache_from<<CACHE_FROM_EOF"
|
||||
echo "$cache_from"
|
||||
echo "CACHE_FROM_EOF"
|
||||
echo "cache_to<<CACHE_TO_EOF"
|
||||
echo "$cache_to"
|
||||
echo "CACHE_TO_EOF"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
target: ${{ matrix.variant }}
|
||||
target: ${{ matrix.target }}
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.tags.outputs.tags }}
|
||||
cache-from: type=gha,scope=${{ matrix.variant }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}
|
||||
build-args: ${{ steps.tags.outputs.build_args }}
|
||||
cache-from: ${{ steps.tags.outputs.cache_from }}
|
||||
cache-to: ${{ steps.tags.outputs.cache_to }}
|
||||
|
||||
Reference in New Issue
Block a user