diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 749366e75..f617453a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,7 +177,7 @@ jobs: build-and-push-docker-images: name: Build and push container images if: ${{ github.event_name != 'pull_request' }} - runs-on: ubuntu-latest + runs-on: ${{ matrix.runner }} permissions: contents: read @@ -189,7 +189,12 @@ jobs: strategy: matrix: variant: [musa, sycl, vulkan, cuda] - + platform: [linux/amd64] + runner: [ubuntu-latest] + include: + - variant: cuda-spark + platform: linux/arm64 + runner: ubuntu-24.04-arm env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -243,7 +248,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64 + platforms: ${{ matrix.platform }} push: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} file: Dockerfile.${{ matrix.variant }} tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}-${{ matrix.variant }} diff --git a/Dockerfile.cuda-spark b/Dockerfile.cuda-spark new file mode 100644 index 000000000..6d6b8e41b --- /dev/null +++ b/Dockerfile.cuda-spark @@ -0,0 +1,30 @@ +ARG CUDA_VERSION=13.0.0 +ARG UBUNTU_VERSION=24.04 + +FROM nvidia/cuda:${CUDA_VERSION}-cudnn-devel-ubuntu${UBUNTU_VERSION} AS build + +RUN apt-get update && apt-get install -y --no-install-recommends build-essential git ccache cmake + +WORKDIR /sd.cpp + +COPY . . + +ARG CUDACXX=/usr/local/cuda/bin/nvcc +ARG CUDA_ARCHITECTURES=121 +RUN cmake . -B ./build \ + -DCMAKE_BUILD_TYPE=Release \ + -DSD_CUDA=ON \ + -DGGML_CUDA_FA_ALL_QUANTS=ON \ + -DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCHITECTURES}" \ +RUN cmake --build ./build --config Release -j$(nproc) + +FROM nvidia/cuda:${CUDA_VERSION}-cudnn-runtime-ubuntu${UBUNTU_VERSION} AS runtime + +RUN apt-get update && \ + apt-get install -y --no-install-recommends libgomp1 && \ + apt-get clean + +COPY --from=build /sd.cpp/build/bin/sd-cli /sd-cli +COPY --from=build /sd.cpp/build/bin/sd-server /sd-server + +ENTRYPOINT ["/sd-cli"]