Broker must be the SOLE VRAM authority — close bypass gaps so out-of-band ollama holds get evicted (imagen starved by 24h keep-alive) #6
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Incident (2026-07-10)
flexsiebels imagen (FLUX/ComfyUI) failed with "no GPU space." Diagnosis on mRock (16 GB card):
The broker (
mgpumanager.service) was active the whole time, yet the ~10 GB ollama hold was never evicted, so FLUX couldn't allocate. Manualollama stop gemma3:12b+ollama stop bge-m3freed 12.4 GB and imagen worked. m's call: fix this at the root ("die große Lösung, an der Wurzel"), not with a shorter keep-alive band-aid.Root cause
The broker already has LRU-eviction over
config/consumers.yamlcoexistence groups and unload paths (Issue #2 lease machinery, evicting.go). It didn't fire because VRAM was held outside the broker's control/accounting:/v1/imagewithout the evict-first lease from #2/#15), the eviction step never runs.So the eviction engine is fine; the problem is bypass: consumers pin/allocate VRAM around the broker instead of through it.
The root fix — broker as the single VRAM chokepoint
/v1/*or/v1/lease). Known suspects to route through the broker (or make broker-aware)::11434, OllamaEmbeddingURL=mRock) — the bge-m3 hold.OLLAMA_KEEP_ALIVEshort on the mRock ollama unit as defence-in-depth.nvidia-smi(it already shells it for/v1/status) and detect resident VRAM it did NOT schedule (out-of-band holds). Under VRAM pressure it must be able to reclaim them via the consumer's declaredunloadpath — so even a stray direct-load gets evicted instead of failing the lease. Today an unaccounted hold silently wins.consumers.yaml priority. Verify the priority actually drives the eviction decision.Definition of done
Reproduce: load
gemma3:12binto ollama with a long keep-alive, then request flexsiebels imagen. Expected: the broker detects the pressure, evicts the idle ollama model via its unload path, and imagen renders — with zero manualollama stop. Add a regression test (scheduler-level) for "out-of-band resident model gets reclaimed under pressure."References
internal/scheduler/evicting.go,config/consumers.yaml, lease API Issue #2, ImaGen lease consumer #15.Partly closed — reclaim works, prevention does not
What now works, and is deployed on mRock:
Per-consumer residency comes from the GPU instead of from the consumers' own health responses, which never carried the field.
/v1/statusreports real numbers for all four. A consumer holding VRAM is an eviction candidate regardless of who started it — that is the reclaim half of this issue, and it is verified live: a lease evicted mvoice, whisper-server and ollama in sequence and was granted with 1165 MiB free.Regression test is
TestEvictsConsumerStartedOutOfBand(internal/scheduler/evicting_test.go): the broker believes a consumer absent, the GPU says it holds 2800 MiB, and the lease must still reclaim it. It fails without the change.What is NOT closed
The broker still cannot stop an out-of-band load from happening. It can only take VRAM back once something asks it for VRAM. Nothing mediates a direct client.
I hit this for real while testing. I loaded
gemma3:12bstraight at:11434, bypassing the broker entirely — the same path mRiver's clients use. It took ~11.3 GB. whisper-server, which was starting at the time, could not fit its model and crash-looped with SIGABRT:STT stayed down until I unloaded the ollama model by hand and restarted the unit. The broker never saw the allocation, so it had nothing to arbitrate.
So the accurate statement of where this issue stands:
This matters concretely: #6 should not be read as "the broker is the sole VRAM authority" yet. A direct
ollamacall can still cost you STT.Does the prevention gap need its own issue?
Yes, in my view. It is a different problem with a different shape — reclaim is a scheduler question, prevention is an admission-control question, and closing it means either putting ollama behind the broker for real (its remote clients currently bypass
:11434deliberately) or accepting that some VRAM is outside the broker's control and making services resilient to losing it rather than crash-looping. Neither belongs in this issue.Filing that is the head's call, not mine, and I have not filed it.
Related, fixed on the way
Evicting whisper-server used to freeze 0 MiB (#8). It now really stops the unit and frees ~2 GB. That surfaced a second defect: the broker refused STT with
consumer_unreachablewhile the unit was stopped, so the request never reached the scheduler and nothing ever started it back — eviction was effectively permanent. Both are fixed onmai/tesla/ollama-residency(https://mgit.msbls.de/m/mGPUmanager/commit/92e55f1).