Skip to content

Studio: keep Vulkan on the GPU when an overlay's implicit layer crashes llama-server - #16826

Open
alarcritty wants to merge 5 commits into
unslothai:mainfrom
alarcritty:studio-windows-crash-details
Open

alarcritty wants to merge 5 commits into
unslothai:mainfrom
alarcritty:studio-windows-crash-details

Conversation

@alarcritty

Copy link
Copy Markdown
Contributor

On Windows, overlay and capture tools (RTSS, Overwolf, OBS, ReShade, ...) register implicit Vulkan layers that the loader injects into every Vulkan process. A faulty one kills llama-server with 0xC0000005 the first time ggml-vulkan creates its device, so every load falls back to the CPU.

In #16395 every Vulkan attempt crashes at that point with --fit on or off (the --fit off attempt dies at load_tensors), and CPU loads work.

Changes:

  • Windows llama-server children set each known overlay layer's own opt-out variable (list from s&box's crash data). This works on any loader version and leaves GPU vendor layers alone.
  • A Vulkan hard crash at startup retries once with VK_LOADER_LAYERS_DISABLE=implicit, keeping AMD's switchable-graphics layer so device numbering matches Studio's plan. A success is remembered for the process; a failure falls through to the existing recovery and CPU fallback unchanged.
  • After a native crash on Windows, the attempt log gets the faulting module (Application Error event 1000, matched by PID), GPU driver versions and enabled implicit layers.
  • The CPU fallback notice says what to try next.

Not yet verified on real Windows or AMD hardware; waiting on the reporter's faulting-module output to confirm the cause before marking this as the fix.

Related to #16395

…es llama-server

Overlay and capture tools (RTSS, Overwolf, OBS, ReShade, ...) register
implicit Vulkan layers that the Windows loader injects into every Vulkan
process. A faulty one kills llama-server with 0xC0000005 the first time
ggml-vulkan creates its device, so every load fell back to the CPU.

- Windows llama-server children set each known overlay layer's own
  opt-out variable. This works on any loader version and leaves GPU
  vendor layers alone.
- A Vulkan hard crash at startup on Windows retries once with
  VK_LOADER_LAYERS_DISABLE=~implicit~, keeping AMD's switchable-graphics
  layer so device numbering matches what Studio planned. A success is
  remembered for the rest of the process.
- After a native crash on Windows, the attempt log gets the faulting
  module from the Application event log, the GPU driver versions and
  the enabled implicit layers.
- The CPU fallback notice says what to try next.

Related to unslothai#16395
@alarcritty
alarcritty marked this pull request as ready for review November 5, 2026 17:44
danielhanchen added a commit that referenced this pull request Nov 6, 2026
…s are added (#16856)

## Summary

From 21:00 UTC yesterday until #16809 merged, `Frontend unit tests
(Windows)` and `Frontend build + bundle sanity` failed on every frontend
PR (#16826, #16829, #16831, #16839, #16854 and others) with the same
test:

```
not ok 4712 - family options follow the backend registry, deduplicated, and every backend family has a label
  location: 'studio/frontend/tests/family-override.test.ts:54:1'
+ [ [ 'chroma', 'chroma' ], [ 'anima', 'anima' ] ]
- []
```

#16710 added the `chroma` and `anima` image families to the backend
registry. That part is fine, and #16809 added the missing picker labels.
The test caught it correctly, but on the wrong PR: it reads
`diffusion_families.py` and `video_families.py`, yet only Frontend CI
runs it, and Frontend CI only triggers on `studio/frontend/**`. So the
backend-only PR that added the families never ran it and merged green,
and the next frontend PR inherited the failure.

## Change

`studio/backend/tests/test_family_override_labels.py`, a new test only.
It takes every family name from `diffusion_families._FAMILIES` and
`video_families._FAMILIES`, reads the keys of `LABELS` in
`family-override.ts`, and fails if a family has no label, naming the
missing ones. Backend CI triggers on `studio/**`, so the PR that adds a
family now has to add its label too.

A second small test pins the `LABELS` parser on quoted (`"flux.1":`) and
bare (`sdxl:`) keys, so a reformatted table cannot quietly read as
empty.

Running Frontend CI on every family registry change would also work, but
those files change many times a day and the frontend jobs include
Windows and macOS legs. One backend test costs under a second. No
product code changes, and the frontend test stays as it is.

## Testing

- On main (with #16809): 2 passed.
- Deleting `chroma: "Chroma"` from `LABELS` again: fails with `add these
families to LABELS in family-override.ts: ['chroma']`.
- The file sorts into the existing `a-f` backend shard by glob.
`tests/test_ci_backend_pytest_shards.py`: 26 passed.

This branch has not been deployed

No deployments
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.

2 participants