gpu: performance split respects per-card VRAM cap; harden process naming
Problem 1 — the per-card cap was read and printed ("VRAM capped at 5.0 GB on
amd:...") but the PERFORMANCE split branch ignored it: it pushed the whole
overflow onto the slow card (_overflow * adj[i]/others == all of it when there's
one other card), so a 5 GB-capped RX 580 got ~47% of the layers and filled up.
Fix: treat each card's (capped) free VRAM as an absolute ceiling — fill the fast
lead card first up to its cap, then each other card up to ITS cap; the GPU budget
is bounded by sum(caps) and the remainder spills to CPU via the n_gpu_layers
auto-offload. RX 580 @5 GB now yields tensor_split [0.805, 0.195] (was [0.527,
0.473]). The VRAM (proportional) strategy already used the capped values.
Problem 2 — process naming: extract _set_proc_title() and ALSO re-assert it right
before the engine binds uvicorn (defensive), with CODERAI_ENGINE_BACKEND as a
fallback name. The per-engine CODERAI_ENGINE_NAME is verified distinct, so this
guarantees coderai-front / coderai-nvidia / coderai-radeon regardless of timing.
Co-Authored-By:
Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DDv7BchtZQWsnPG6Jm49m
Showing
Please
register
or
sign in
to comment