ComfyUI: GPU (gfx1151 ROCm) build via container
Replace the CPU stock image with a container built from Containerfile.comfyui on AMD's gfx1151-tagged vLLM base — the only torch build verified to report torch.cuda.is_available()=True on the Strix Halo APU (Radeon 8060S, capability (11,5)). - Containerfile bakes the ComfyUI code in and installs its deps, but skips the torch family (the base image already ships the gfx1151 ROCm torch/torchvision/torchaudio; an unpinned 'torch' in requirements.txt would clobber the gfx1151 kernels). - compose comfyui service: build + image comfyui-rocm:gfx1151, passes /dev/kfd + /dev/dri, adds video+render groups, drops --cpu. Models/data persist under /opt/comfyui. - Un-skip the four compose-wiring acceptance tests (the gate for this work).
This commit is contained in:
1 parent
aa38c556b2
commit
354ddc473f
3 files changed
+50
-14
No files matched your search
@@ -0,0 +1,24 @@
|
|||||||
|
# ComfyUI on the gfx1151 (AMD Strix Halo / Radeon 8060S) ROCm torch build.
|
||||||
|
#
|
||||||
|
# Base image: AMD's gfx1151-tagged vLLM image. It is the only verified build
|
||||||
|
# where torch.cuda.is_available() is True on this APU (device capability
|
||||||
|
# (11,5) = gfx1151). It already ships the matching ROCm torch family
|
||||||
|
# (torch 2.9.1+rocm, torchvision 0.24.0+rocm, torchaudio 2.9.0+rocm), so we
|
||||||
|
# must NOT let pip reinstall them: ComfyUI's requirements.txt lists an unpinned
|
||||||
|
# `torch`, which would otherwise clobber the gfx1151 kernels with a default build.
|
||||||
|
FROM docker.io/rocm/vllm:rocm7.12.0_gfx1151_ubuntu24.04_py3.12_pytorch_2.9.1_vllm_0.16.0
|
||||||
|
|
||||||
|
# Bake the ComfyUI code into the image (rebuild the image to update the code).
|
||||||
|
RUN git clone --depth 1 https://github.com/comfyanonymous/ComfyUI /opt/ComfyUI
|
||||||
|
WORKDIR /opt/ComfyUI
|
||||||
|
|
||||||
|
# Pre-create the user-data dirs. The host mounts its collections over them
|
||||||
|
# (see the comfyui service in compose.yaml).
|
||||||
|
RUN mkdir -p /opt/ComfyUI/models /opt/ComfyUI/input /opt/ComfyUI/output /opt/ComfyUI/custom_nodes
|
||||||
|
|
||||||
|
# Install ComfyUI's dependencies, but skip the torch family (already present
|
||||||
|
# above as the gfx1151 ROCm builds). torchsde and the rest are kept.
|
||||||
|
RUN grep -viE '^(torch|torchvision|torchaudio)([^a-z]|$)' requirements.txt > /tmp/req-notorch.txt \
|
||||||
|
&& pip install --no-cache-dir -r /tmp/req-notorch.txt
|
||||||
|
|
||||||
|
EXPOSE 8188
|
||||||
+21
-5
@@ -11,21 +11,37 @@ services:
|
|||||||
# Deploy with: scripts/deploy-searxng-quadlet.sh dankclaw
|
# Deploy with: scripts/deploy-searxng-quadlet.sh dankclaw
|
||||||
# See ../docs/Dankclaw/SearXNG.md, Gluetun.md, Valkey.md.
|
# See ../docs/Dankclaw/SearXNG.md, Gluetun.md, Valkey.md.
|
||||||
|
|
||||||
# --- AI image generation (CPU backend; ROCm does not support gfx1151) ----
|
# --- AI image generation (ROCm GPU backend, gfx1151) ---------------------
|
||||||
|
# Built from Containerfile.comfyui on AMD's gfx1151 torch base. The GPU is
|
||||||
|
# passed through (/dev/kfd, /dev/dri) with the video+render groups; no --cpu.
|
||||||
|
# Models + data persist under /opt/comfyui. See ../docs/Dankclaw/ComfyUI.md.
|
||||||
comfyui:
|
comfyui:
|
||||||
image: ghcr.io/comfyanonymous/comfyui:latest
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Containerfile.comfyui
|
||||||
|
image: comfyui-rocm:gfx1151
|
||||||
container_name: comfyui
|
container_name: comfyui
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
command: ["python", "main.py", "--cpu", "--listen", "0.0.0.0", "--port", "8188"]
|
command: ["python", "main.py", "--listen", "0.0.0.0", "--port", "8188"]
|
||||||
ports:
|
ports:
|
||||||
- "8188:8188"
|
- "8188:8188"
|
||||||
|
devices:
|
||||||
|
- /dev/kfd:/dev/kfd
|
||||||
|
- /dev/dri:/dev/dri
|
||||||
|
group_add:
|
||||||
|
- video
|
||||||
|
- render
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/comfyui:/workspace
|
- /opt/comfyui/models:/opt/ComfyUI/models
|
||||||
|
- /opt/comfyui/input:/opt/ComfyUI/input
|
||||||
|
- /opt/comfyui/output:/opt/ComfyUI/output
|
||||||
|
- /opt/comfyui/custom_nodes:/opt/ComfyUI/custom_nodes
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8188/')"]
|
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8188/')"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 5
|
||||||
|
start_period: 180s
|
||||||
|
|
||||||
# --- Chat UI + agent -----------------------------------------------------
|
# --- Chat UI + agent -----------------------------------------------------
|
||||||
openwebui:
|
openwebui:
|
||||||
|
|||||||
@@ -7,16 +7,15 @@
|
|||||||
# - NOT pass --cpu
|
# - NOT pass --cpu
|
||||||
# - add the video and render groups
|
# - add the video and render groups
|
||||||
#
|
#
|
||||||
# STATUS (2026-08-18): the GPU migration is NOT yet applied. The compose still
|
# STATUS (2026-08-19): the GPU migration is applied. The compose builds
|
||||||
# runs ComfyUI with --cpu on the stock image (the gfx1151 torch image is not
|
# comfyui-rocm:gfx1151 from Containerfile.comfyui (AMD's gfx1151 torch base),
|
||||||
# built yet). The four compose-wiring tests below are skipped until the ROCm
|
# passes /dev/kfd + /dev/dri, adds the video+render groups, and drops --cpu.
|
||||||
# build lands. The Containerfile test stays active: the file exists and is ready.
|
# The four compose-wiring tests below are active (un-skipped). See
|
||||||
# See docs/Research/ComfyUI ROCm and Vulkan.md. Re-enable the skips then.
|
# docs/Research/ComfyUI ROCm and Vulkan.md.
|
||||||
|
|
||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
@test "comfyui builds from the gfx1151 ROCm Containerfile" {
|
@test "comfyui builds from the gfx1151 ROCm Containerfile" {
|
||||||
skip "GPU ComfyUI migration pending (CPU path in use)"
|
|
||||||
local compose="$REPO_ROOT/dankclaw/compose.yaml"
|
local compose="$REPO_ROOT/dankclaw/compose.yaml"
|
||||||
python3 - "$compose" <<'PYEOF'
|
python3 - "$compose" <<'PYEOF'
|
||||||
import sys, yaml
|
import sys, yaml
|
||||||
@@ -39,7 +38,6 @@ PYEOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "comfyui passes /dev/kfd and /dev/dri to the container" {
|
@test "comfyui passes /dev/kfd and /dev/dri to the container" {
|
||||||
skip "GPU ComfyUI migration pending (CPU path in use)"
|
|
||||||
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
||||||
import sys, yaml
|
import sys, yaml
|
||||||
with open(sys.argv[1]) as fh:
|
with open(sys.argv[1]) as fh:
|
||||||
@@ -53,7 +51,6 @@ PYEOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "comfyui does not run with --cpu" {
|
@test "comfyui does not run with --cpu" {
|
||||||
skip "GPU ComfyUI migration pending (CPU path in use)"
|
|
||||||
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
||||||
import sys, yaml
|
import sys, yaml
|
||||||
with open(sys.argv[1]) as fh:
|
with open(sys.argv[1]) as fh:
|
||||||
@@ -67,7 +64,6 @@ PYEOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "comfyui adds the video and render groups" {
|
@test "comfyui adds the video and render groups" {
|
||||||
skip "GPU ComfyUI migration pending (CPU path in use)"
|
|
||||||
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
||||||
import sys, yaml
|
import sys, yaml
|
||||||
with open(sys.argv[1]) as fh:
|
with open(sys.argv[1]) as fh:
|
||||||
|
|||||||
Reference in new issue
Block a user