Skip to content

vulkan: clearer message when --gpu vulkan is explicitly unavailable - #1006

Merged
aittalam merged 1 commit into
mainfrom
windows-gpu-probe-messaging
Jun 29, 2026
Merged

aittalam merged 1 commit into
mainfrom
windows-gpu-probe-messaging

Conversation

@aittalam

Copy link
Copy Markdown
Member

What

When Vulkan is explicitly requested (--gpu vulkan) but no usable device is found, llamafile already exits with a fatal error instead of silently downgrading to CPU. This keeps that behavior (a silent downgrade would surprise users with ~10× slower inference on an explicit GPU request) but replaces the dead-end message:

fatal error: support for --gpu vulkan was explicitly requested, but it wasn't available

with an actionable one that names the two real causes and the way forward:

fatal error: --gpu vulkan was explicitly requested but Vulkan is not usable on this system
  - no Vulkan-capable device was detected, or the driver failed/crashed during probe and was skipped for safety
  - retry with --gpu auto to use the best available backend (falls back to CPU), or --gpu disabled to force CPU

Why

The "driver failed/crashed during probe and was skipped" case is real on some Windows configurations (e.g. certain Intel iGPU setups, issue #938), where the out-of-process probe / crash guard (#988) correctly skips a faulting backend so the process stays alive. In --gpu auto that already falls back to CPU silently and correctly; only the explicit-request path surfaced a message that left users with no next step.

Scope

  • Messaging only — no behavior change. --gpu auto fallback and the exit(1) on explicit request are unchanged.
  • Touches llamafile/vulkan.c only (11 lines). The sibling cuda.c/metal.c messages could get the same treatment in a follow-up if desired.
  • Compiles clean under cosmocc.

🤖 Generated with Claude Code

When Vulkan is explicitly requested (--gpu vulkan) but the probe finds no
usable device -- or the driver faulted during probe and was skipped to keep
the process alive (the #988 out-of-process probe / crash guard) -- we still
exit(1) rather than silently downgrading to CPU, which would surprise users
with ~10x slower inference. But the old message ('it wasn't available') gave
no next step. Spell out the two causes and point at --gpu auto (graceful
fallback) and --gpu disabled (force CPU).

Behavior unchanged; messaging only. --gpu auto already falls back silently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aittalam
aittalam merged commit 9ff770c into main Jun 29, 2026
2 checks passed
@aittalam
aittalam deleted the windows-gpu-probe-messaging branch June 29, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant