Architectural decision: production GPU efficiency — 3 варианта #2
Reference in New Issue
Block a user
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?
Контекст
Текущая архитектура runtime layout switching (3 cuda_grid instances + streamselect + 3-way split per cam) работает на RTX 5090 (dev) — 25-33% GPU util. На production hardware (RTX 4060 / A2000 / T4 — ~5× меньше throughput) saturated ~100% → не workable.
Проблема: streamselect выбирает один output, но upstream branches continuously produce frames чтобы быть ready к switch. То есть 3 cuda_grid composes + 12 scale_npp per frame даже если visible только один.
Нужно redesign — не генерировать то что не видно.
Замеры current architecture
Варианты redesign
Вариант 1 — Single fixed layout + smart cell content
Один cuda_grid (например
main_plus_previewвсегда). Контент cell — dynamic через streamselect per cell input.Auto-selector назначает: main = highest-priority active, preview cells = другие active cameras (без duplicate).
Trade-off: нет single/quad layouts. UX: всегда 4-cell view, акцент через main cell.
Вариант 2 — Pipeline restart on layout switch
Один cuda_grid с выбранным layout. При switch — controller вызывает
docker restart cuda-grid-pipelineс новым layout option.Trade-off: auto-layout = pipeline restarts при каждом motion change → TV freeze + reconnect. Не подходит для motion-driven auto switching. OK для manual user-initiated switches.
Вариант 3 — Filter rework (proper long-term)
vf_cuda_gridподдерживает runtime layout change + internal scaling per cell.Изменения filter:
nb_active_cellsdynamic per layoutprocess_command "layout <name>"→ meняет cell_px[] + active countprocess_command "cell_map <i> <pad>"→ swap input pad для cell iСравнение
Рекомендация
Кратко-средне: Вариант 1 (smart cell content в фиксированном mpp). Получаем motion+priority highlighting на production hardware без filter dev.
Долгосрочно: Вариант 3 — proper filter rework когда понадобится больше layouts.
Принять решение когда будет понятно production hardware spec + feature requirements.
Related
4cd2b4b)