From a585bb750969eefc4d817ec9c67ea447ff2d07e3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 8 Jul 2026 18:48:46 +0200 Subject: Classify DEVICE_LOST generate failures in wrapper 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 --- imggen | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/imggen b/imggen index b385712..193b10d 100755 --- a/imggen +++ b/imggen @@ -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 -- cgit v1.2.3