Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

GPU Management

Gaius manages 6 NVIDIA RTX 4090 GPUs (24GB VRAM each, 144GB total) across vLLM inference, LuxCore rendering, and embedding workloads.

GPU Allocation

Device assignment is all-or-nothing. One model owns a GPU. We never place two models on one card, even when VRAM is free. A large model takes as many whole GPUs as tensor-parallel requires.

GPUTypical UseVRAMNotes
0–3thinking (Qwen3.8-27B)4 × 24GBTP=4, whole devices
4–5Ask light / medium2 × 24GB2× 1.7B (light, one GPU each) or 1× 9B-SAE (medium, TP=2)

The Orchestrator manages allocation via capability-based scheduling (OR-Tools CP-SAT). GPUs can be temporarily reassigned for LuxCore rendering or evolution training via makespan scheduling — the Orchestrator evicts a low-priority endpoint, runs the workload, then restores the endpoint.

Status Monitoring

# Endpoint status
uv run gaius-cli --cmd "/gpu status" --format json

# GPU health (memory, temperature, utilization)
uv run gaius-cli --cmd "/gpu health" --format json

Cleanup

When GPU processes get stuck or memory leaks:

# Standard cleanup (kill orphan vLLM processes)
just gpu-cleanup

# Deep cleanup (aggressive memory recovery)
just gpu-deep-cleanup

The gpu-helpers.sh shared library provides the gpu_cleanup function used by both the engine startup script and the justfile recipes.

Common Issues

IssueSymptomFix
Orphan vLLM processGPU memory used but no endpointjust gpu-cleanup
OOM during model loadEndpoint stuck in STARTINGFree GPU, then /health fix endpoints
CUDA memory fragmentationDegraded inference speedjust gpu-deep-cleanup then restart
OpenCV conflictvLLM WorkerProc fails (cv2 error)Already fixed via pyproject.toml override
Qwen3.8 JIT cicc / GLIBC_2.38thinking STARTING then FAILED after ~14 GiB/GPUTinybox CUDA 12.4 + host gcc-11; scripts/lib/tinybox-nvcc.sh shadows $CUDA_HOME/bin/nvcc. Do not install CUDA 13
/dev/shm full (#EP.00000007)thinking fails: Insufficient space in /dev/shm (0 MiB free)Leftover --kv-offloading-size maps. /health fix endpoints or just gpu-cleanup unlinks unheld vllm_offload_*.mmap / psm_* only — never PostgreSQL or gaius-aeron

Rendering GPU Eviction

The viz pipeline temporarily evicts a low-priority endpoint to use a GPU for LuxCore rendering:

  1. Orchestrator evicts endpoint from target GPU
  2. LuxCore renders using PATHOCL engine with CUDA
  3. clear_embeddings() releases Nomic model (~3GB)
  4. Orchestrator restores evicted endpoint