71 lines
2.5 KiB
Bash
71 lines
2.5 KiB
Bash
#!/usr/bin/env bats
|
|
# Seam: ComfyUI ROCm GPU configuration on Dankclaw.
|
|
# The gfx1151-enabled PyTorch build is the only verified GPU path on Strix
|
|
# Halo. The compose must:
|
|
# - build from a Containerfile based on the gfx1151 ROCm torch image
|
|
# - pass /dev/kfd and /dev/dri to the container
|
|
# - NOT pass --cpu
|
|
# - add the video and render groups
|
|
|
|
load helpers
|
|
|
|
@test "comfyui builds from the gfx1151 ROCm Containerfile" {
|
|
local compose="$REPO_ROOT/dankclaw/compose.yaml"
|
|
python3 - "$compose" <<'PYEOF'
|
|
import sys, yaml
|
|
with open(sys.argv[1]) as fh:
|
|
data = yaml.safe_load(fh)
|
|
svc = data["services"]["comfyui"]
|
|
assert svc.get("build"), "comfyui must have a build: section (Containerfile)"
|
|
assert svc.get("image", "").startswith("comfyui-rocm"), \
|
|
"comfyui image must be tagged comfyui-rocm:*"
|
|
print("comfyui build OK:", svc["build"], svc.get("image"))
|
|
PYEOF
|
|
}
|
|
|
|
@test "comfyui Containerfile is based on the gfx1151 torch image" {
|
|
local cf
|
|
cf=$(find "$REPO_ROOT/dankclaw" -name 'Containerfile*' 2>/dev/null | head -1)
|
|
[ -n "$cf" ] || { echo "no Containerfile under dankclaw/"; return 1; }
|
|
grep -q "gfx1151" "$cf" || { echo "$cf does not reference gfx1151"; return 1; }
|
|
grep -q "FROM" "$cf" || { echo "$cf has no FROM"; return 1; }
|
|
}
|
|
|
|
@test "comfyui passes /dev/kfd and /dev/dri to the container" {
|
|
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
|
import sys, yaml
|
|
with open(sys.argv[1]) as fh:
|
|
data = yaml.safe_load(fh)
|
|
devices = data["services"]["comfyui"].get("devices", [])
|
|
joined = "\n".join(devices)
|
|
for need in ("/dev/kfd", "/dev/dri"):
|
|
assert need in joined, f"comfyui devices must include {need}; got: {devices}"
|
|
print("device passthrough OK:", devices)
|
|
PYEOF
|
|
}
|
|
|
|
@test "comfyui does not run with --cpu" {
|
|
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
|
import sys, yaml
|
|
with open(sys.argv[1]) as fh:
|
|
data = yaml.safe_load(fh)
|
|
cmd = data["services"]["comfyui"].get("command", [])
|
|
joined = " ".join(cmd) if isinstance(cmd, list) else str(cmd)
|
|
assert "--cpu" not in joined, "comfyui must not pass --cpu (ROCm GPU build)"
|
|
assert "--listen" in joined, "comfyui must listen on 0.0.0.0"
|
|
print("command OK:", cmd)
|
|
PYEOF
|
|
}
|
|
|
|
@test "comfyui adds the video and render groups" {
|
|
python3 - "$REPO_ROOT/dankclaw/compose.yaml" <<'PYEOF'
|
|
import sys, yaml
|
|
with open(sys.argv[1]) as fh:
|
|
data = yaml.safe_load(fh)
|
|
groups = data["services"]["comfyui"].get("group_add", [])
|
|
for g in ("video", "render"):
|
|
assert g in groups, f"comfyui group_add must include {g}; got: {groups}"
|
|
print("groups OK:", groups)
|
|
PYEOF
|
|
}
|