From 8fabc75634564a3f803b890c82ab8711ad1ea063 Mon Sep 17 00:00:00 2001 From: Benson Wong Date: Wed, 25 Mar 2026 23:26:13 +0900 Subject: [PATCH] docker/unified: vulkan build fixes (#600) multiple fixes to vulkan build: - use ubuntu 26.04 to be compatible with AMD 395+ (Strix halo) hardware - add home directory in container - fix stable-diffusion install to actually enable vulkan --------- Co-authored-by: Claude Opus 4.6 --- .github/workflows/unified-docker.yml | 17 ++++++++++++++++- docker/unified/Dockerfile | 15 +++++---------- docker/unified/install-sd.sh | 1 + 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/unified-docker.yml b/.github/workflows/unified-docker.yml index b6e168ec..bce11d53 100644 --- a/.github/workflows/unified-docker.yml +++ b/.github/workflows/unified-docker.yml @@ -22,6 +22,16 @@ on: description: "llama-swap version (e.g. v198, latest, main)" required: false default: "main" + build_cuda: + description: "Build CUDA image" + type: boolean + required: false + default: true + build_vulkan: + description: "Build Vulkan image" + type: boolean + required: false + default: true permissions: contents: read @@ -33,7 +43,12 @@ jobs: strategy: fail-fast: false matrix: - backend: [cuda, vulkan] + backend: + - cuda + - vulkan + exclude: + - backend: ${{ inputs.build_cuda == false && 'cuda' || 'none' }} + - backend: ${{ inputs.build_vulkan == false && 'vulkan' || 'none' }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/docker/unified/Dockerfile b/docker/unified/Dockerfile index 961ccecf..b45c27fb 100644 --- a/docker/unified/Dockerfile +++ b/docker/unified/Dockerfile @@ -29,7 +29,7 @@ WORKDIR /build # ── -FROM ubuntu:22.04 AS builder-base-vulkan +FROM ubuntu:26.04 AS builder-base-vulkan ENV DEBIAN_FRONTEND=noninteractive ENV CCACHE_DIR=/ccache @@ -39,12 +39,7 @@ ENV PATH="/usr/lib/ccache:${PATH}" RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential cmake git python3 python3-pip libssl-dev \ curl ca-certificates ccache make wget software-properties-common \ - && rm -rf /var/lib/apt/lists/* - -# Install LunarG Vulkan SDK (Ubuntu 22.04 repo headers are too old) -RUN wget -qO /etc/apt/trusted.gpg.d/lunarg.asc https://packages.lunarg.com/lunarg-signing-key-pub.asc \ - && echo "deb https://packages.lunarg.com/vulkan jammy main" > /etc/apt/sources.list.d/lunarg-vulkan.list \ - && apt-get update && apt-get install -y --no-install-recommends vulkan-sdk \ + libvulkan-dev glslang-tools spirv-tools vulkan-validationlayers glslc \ && rm -rf /var/lib/apt/lists/* WORKDIR /build @@ -108,7 +103,7 @@ COPY --from=builder-base-cuda /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/ # ── -FROM ubuntu:22.04 AS runtime-vulkan +FROM ubuntu:26.04 AS runtime-vulkan ENV DEBIAN_FRONTEND=noninteractive ENV PATH="/usr/local/bin:${PATH}" @@ -127,10 +122,10 @@ ARG LLAMA_COMMIT_HASH=unknown ARG WHISPER_COMMIT_HASH=unknown ARG SD_COMMIT_HASH=unknown -RUN pip3 install --no-cache-dir numpy sentencepiece +RUN pip3 install --no-cache-dir --break-system-packages numpy sentencepiece # Create llama-swap user and config directory -RUN useradd --system --no-create-home --shell /sbin/nologin llama-swap && \ +RUN useradd --system --create-home --shell /sbin/nologin llama-swap && \ mkdir -p /etc/llama-swap/config && \ chown -R llama-swap:llama-swap /etc/llama-swap diff --git a/docker/unified/install-sd.sh b/docker/unified/install-sd.sh index 2a781465..e8db7014 100755 --- a/docker/unified/install-sd.sh +++ b/docker/unified/install-sd.sh @@ -43,6 +43,7 @@ elif [ "$BACKEND" = "vulkan" ]; then CMAKE_FLAGS+=( -DGGML_CUDA=OFF -DGGML_VULKAN=ON + -DSD_VULKAN=ON ) fi