[GH-ISSUE #4352] [Engine] After the engine dies, its own strata-vision encoder holds the VRAM and min_free_vram_mib refuses every load (503) #1923

Closed
opened 2026-11-04 01:55:20 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @mkemalemdar on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4352

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Docker

What happened

After the engine died during a request (verify: layer 37 never rang (an illegal memory access was encountered), see #3813), the next request was refused, and every one after it:

503 {"type":"server_error","message":"the GPU is in use by another program: 14612 MiB of VRAM free, the model needs 15000 (min_free_vram_mib) - it stays unloaded until that is free"}

The only other process on the GPU was Strata's own image encoder, which kept running after the engine died:

$ nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv,noheader
8684, /opt/strata/engine/strata-vision, 1212 MiB

/health reports "loaded": false. Expected: Strata does not count its own encoder as "another program", or stops it when the engine dies, and loads again.

Reading ensure_loaded() (same code in v0.2.7, serve/server.py): the min_free_vram_mib check runs before the _vision_down() / vision.restart() step, and the encoder is only stopped by unload(). But unload() returns "not loaded" early when the engine isn't alive, before self.vision.unload(), so POST /unload doesn't release it either. With a dead engine and a live encoder, the free VRAM can't reach min_free_vram_mib unless the encoder's share is subtracted. Stopping the strata-vision process by hand frees it; ensure_loaded() then restarts it.

Smallest steps or command that reproduce it

  1. Start with --vision and min_free_vram_mib set close to the card's free VRAM without the encoder (here 15000 on 16 GB).
  2. Have the engine die mid-request (here an illegal memory access, #3813).
  3. Send any request: 503 "the GPU is in use by another program", for as long as the encoder runs.

Reproduction status

Reproduced locally

Strata version

engine 0.1.38 (GET /v1/status), Docker image built from source at 99f3dbd; the same order in ensure_loaded() in v0.2.7

Graphics card, memory and system

RTX 5060 Ti 16 GB · 30 GB RAM · Ubuntu (kernel 7.0), driver 595.91.07

Model, size and settings

Qwen3.8-Flash-Next GSQ-RCO IQ1_M · 262K context · pictures on (--vision) · min_free_vram_mib 15000

Originally created by @mkemalemdar on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4352 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Docker ### What happened After the engine died during a request (`verify: layer 37 never rang (an illegal memory access was encountered)`, see #3813), the next request was refused, and every one after it: ``` 503 {"type":"server_error","message":"the GPU is in use by another program: 14612 MiB of VRAM free, the model needs 15000 (min_free_vram_mib) - it stays unloaded until that is free"} ``` The only other process on the GPU was Strata's own image encoder, which kept running after the engine died: ``` $ nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv,noheader 8684, /opt/strata/engine/strata-vision, 1212 MiB ``` `/health` reports `"loaded": false`. Expected: Strata does not count its own encoder as "another program", or stops it when the engine dies, and loads again. Reading `ensure_loaded()` (same code in v0.2.7, `serve/server.py`): the `min_free_vram_mib` check runs before the `_vision_down()` / `vision.restart()` step, and the encoder is only stopped by `unload()`. But `unload()` returns `"not loaded"` early when the engine isn't alive, before `self.vision.unload()`, so `POST /unload` doesn't release it either. With a dead engine and a live encoder, the free VRAM can't reach `min_free_vram_mib` unless the encoder's share is subtracted. Stopping the `strata-vision` process by hand frees it; `ensure_loaded()` then restarts it. ### Smallest steps or command that reproduce it 1. Start with `--vision` and `min_free_vram_mib` set close to the card's free VRAM without the encoder (here 15000 on 16 GB). 2. Have the engine die mid-request (here an illegal memory access, #3813). 3. Send any request: 503 "the GPU is in use by another program", for as long as the encoder runs. ### Reproduction status Reproduced locally ### Strata version engine 0.1.38 (`GET /v1/status`), Docker image built from source at 99f3dbd; the same order in `ensure_loaded()` in v0.2.7 ### Graphics card, memory and system RTX 5060 Ti 16 GB · 30 GB RAM · Ubuntu (kernel 7.0), driver 595.91.07 ### Model, size and settings Qwen3.8-Flash-Next GSQ-RCO IQ1_M · 262K context · pictures on (`--vision`) · `min_free_vram_mib` 15000
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Hello mkemalemdar,

Thank you. In Strata 0.2.11 the free-VRAM check releases this server's own picture encoder when the engine is not running, and POST /unload does too, so the dead engine's encoder no longer makes every load answer 503. A foreign program holding the memory still refuses, as it should. If a load is still refused for free VRAM on 0.2.11, please send nvidia-smi and the server log lines around the refusal.

The Strata project

<!-- gh-comment-id:6658463890 --> @Niko1221 commented on GitHub (Nov 5, 2026): Hello mkemalemdar, Thank you. In Strata 0.2.11 the free-VRAM check releases this server's own picture encoder when the engine is not running, and `POST /unload` does too, so the dead engine's encoder no longer makes every load answer 503. A foreign program holding the memory still refuses, as it should. If a load is still refused for free VRAM on 0.2.11, please send `nvidia-smi` and the server log lines around the refusal. The Strata project
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1923
No description provided.