diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-08 18:48:46 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-08 18:48:46 +0200 |
| commit | a585bb750969eefc4d817ec9c67ea447ff2d07e3 (patch) | |
| tree | b5ec54847a6207996ef60047adfd6d363f012d46 | |
| parent | df499cf6f45a32f5cfab836eb84fd73a190f0727 (diff) | |
| download | imggen-a585bb750969eefc4d817ec9c67ea447ff2d07e3.tar.gz imggen-a585bb750969eefc4d817ec9c67ea447ff2d07e3.zip | |
A failed /generate now keeps the server's JSON error body instead of
discarding it (dropped curl -f). A level_zero DEVICE_LOST body prints a
clear "GPU wedged ... reboot needed" message; other failures surface the
actual server error. Root cause of the wedge is a GuC firmware / xe
driver version mismatch (GuC 70.65.0 vs driver-wanted 70.49.4), a
host-side fault the wrapper cannot fix, only report clearly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| -rwxr-xr-x | imggen | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -115,12 +115,21 @@ if daemon_up; then [ -n "$H" ] && req="$req,\"height\":$H" req="$req}" - if curl -sf -X POST "${BASE}/generate" -H 'Content-Type: application/json' \ - -d "$req" -o "$OUT_PATH"; then + # No -f: keep the error body so we can classify it (e.g. GPU wedged). + code="$(curl -s -w '%{http_code}' -X POST "${BASE}/generate" \ + -H 'Content-Type: application/json' -d "$req" -o "$OUT_PATH")" + if [ "$code" = 200 ]; then echo "Saved ${OUT_PATH}" else - echo "generate failed (see daemon logs: docker compose logs)" >&2 + # On failure the body is the server's JSON error, not a PNG. + err="$(cat "$OUT_PATH" 2>/dev/null)" rm -f "$OUT_PATH" + # level_zero DEVICE_LOST = GuC/xe driver hang; only a reboot recovers. + if printf '%s' "$err" | grep -qi "device.lost\|DEVICE_LOST\|error 20"; then + echo "GPU wedged (level_zero DEVICE_LOST): GuC/xe driver fault, reboot needed" >&2 + else + echo "generate failed: ${err:-see daemon logs: docker compose logs}" >&2 + fi exit 1 fi else |
