Skip to content

Studio: replay a stalled Vulkan start on CPU when the device probe failed - #18172

Merged
danielhanchen merged 1 commit into
mainfrom
studio-vulkan-probe-error-cpu-fallback
Nov 17, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-vulkan-probe-error-cpu-fallback

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

A Discord user on Unsloth Desktop (Windows 11, Intel Core i7-6700T, 8 GB RAM, only an Intel HD Graphics 530) saw "Loading a model..." for more than 30 minutes on unsloth/DeepSeek-R1-Distill-Qwen-1.5B-GGUF. Settings > System showed "No visible GPU" with the bundled Vulkan build.

Since #14521 a Vulkan auto-selected load already handles most of this:

  • the device probe listed zero devices: start on CPU right away;
  • the probe timed out or crashed: wait 300 s without counting CPU spin as progress, then replay on CPU.

A probe that failed any other way (error: non-zero exit without a signal, an exception, or a bundle without the Vulkan backend library) was grouped with a probe that listed a working device. That gets the listed-device budget: CPU work renews the 600 s stall window, the ceiling is 3x (30 minutes for a small model), and the end is a terminal error that tells the user to pick CPU in Settings. A failed probe proved no device, so the rationale for that budget ("the probe saw a working device, so a slow start is not proof of a broken driver") does not apply.

Fix

Treat a failed probe like a timed-out or crashed one (_vulkan_suspect). A healthy start is unchanged and stays on Vulkan; only a start that makes no loading progress is replayed on CPU after 300 s instead of failing after 30 minutes. A probe that listed a device keeps the current behaviour.

This does not change the UI or any setting, and the next load re-probes, so one bad start never pins a build to CPU.

Tests

tests/test_vulkan_no_device_cpu_route.py: error joins the suspect cases in the stall-window test and in test_a_hung_suspect_launch_replays_on_cpu; the listed-device stall test keeps devices only.

Case merge base this PR
failed probe, healthy start Vulkan, 600 s window, CPU counts as progress Vulkan, 300 s window, CPU does not count
failed probe, start with no progress terminal error, no CPU replay replayed on CPU, reason vulkan_startup_stall
probe listed a device, stalled terminal error terminal error (unchanged)

pytest tests/test_vulkan_no_device_cpu_route.py: 52 passed (base: the two error cases fail). tests/test_gpu_arch_gate_os_matrix_7624.py tests/test_llama_cpp_mmproj_fallback.py: 341 passed on both base and head.

@danielhanchen danielhanchen self-assigned this Nov 17, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-17T15:39:49.247548Z f81b54a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T15:41:16.280239Z f81b54a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: f81b54aee6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 18b7208 into main Nov 17, 2026
@danielhanchen
danielhanchen deleted the studio-vulkan-probe-error-cpu-fallback branch November 17, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant