Files
cuframes/docker-compose.example.yml
gx f10413580d docs: cross-container CUDA IPC requires both --ipc и --pid namespace share
Реальный тест на 192.168.88.98 (1920x1080 HEVC, 25fps) показал: для отдельных
consumer-container'ов недостаточно ipc=container:X — нужен также
pid=container:X, иначе cudaIpcOpenEventHandle падает с invalid device
context. CUDA driver валидирует IPC peer через /proc/<pid>/...

E2E на реальной камере проверен:
  publisher (отдельный контейнер) -> consumer (docker exec): 250 frames, 0 gaps
  publisher (отдельный контейнер) -> consumer (отдельный с pid+ipc): 200, 0 gaps

Обновлено:
- docs/integration.md compose snippet, verification, troubleshooting section
- docker-compose.example.yml — добавлен pid: container:cuframes-cam-test
- README.md quickstart — добавлен --pid в docker run subscriber

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 06:37:09 +01:00

63 lines
2.1 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Пример docker-compose для cuframes intergration в CCTV-стек.
#
# Запуск:
# export CAM_PASS=your_camera_password
# docker compose -f docker-compose.example.yml up
#
# Этот файл — REFERENCE для adaptации в boost проектах (cctv, frigate stack).
# Не для production без review.
services:
# Источник: декодирует RTSP в CUDA, публикует через cuframes IPC
cuframes-cam-test:
# Локальный build из этого репо
build:
context: .
dockerfile: docker/Dockerfile.runtime
image: gx/cuframes:0.1
container_name: cuframes-cam-test
restart: unless-stopped
runtime: nvidia
environment:
NVIDIA_VISIBLE_DEVICES: all
NVIDIA_DRIVER_CAPABILITIES: compute,video,utility
# CRITICAL: ipc=shareable — позволяет другим контейнерам joinиться через
# `ipc: container:cuframes-cam-test`
ipc: shareable
shm_size: 1g
volumes:
- cuframes_sock:/run/cuframes
command:
- /usr/local/bin/cuframes-rtsp-source
- --rtsp=rtsp://admin:${CAM_PASS}@192.168.88.98:554/cam/realmonitor?channel=1&subtype=0
- --key=cam-test
- --ring=6
- --verbose
# Потребитель: счётчик frames (smoke-test consumer)
cuframes-sub-test:
image: gx/cuframes:0.1
container_name: cuframes-sub-test
depends_on:
- cuframes-cam-test
restart: "no"
runtime: nvidia
environment:
NVIDIA_VISIBLE_DEVICES: all
NVIDIA_DRIVER_CAPABILITIES: compute,video,utility
# CRITICAL: обa namespace должны совпадать с publisher'ом —
# ipc нужен для /dev/shm, pid нужен для CUDA driver IPC validation
# (без pid: cudaIpcOpenEventHandle падает с "invalid device context")
ipc: "container:cuframes-cam-test"
pid: "container:cuframes-cam-test"
volumes:
- cuframes_sock:/run/cuframes:ro
command:
- /usr/local/bin/sub_count
- --key=cam-test
- --max-frames=500
- --verbose
volumes:
cuframes_sock: