Files
cuframes/README.md
T
gx dc478c7cda docs: system requirements (hardware, software, build, Docker, k8s)
docs/requirements.md (220 строк):
- Hardware: NVIDIA GPU CC ≥7.5 (Turing+), Linux x86_64, VRAM/RAM/CPU minimum
- Software host: kernel ≥5.4, driver ≥525/555, glibc ≥2.31, Ubuntu/Debian/RHEL
- Build deps: CUDA Toolkit ≥12.0, GCC 11+, CMake 3.20+, FFmpeg 4.4+
- Docker: nvidia-container-toolkit, --gpus, --ipc=shareable, --shm-size=2gb
- Cross-container CUDA IPC: variant A (--ipc=container:X), variant B (host),
  k8s через emptyDir + shareProcessNamespace
- Out-of-scope: AMD/Intel/macOS/Windows/WSL2/Jetson/multi-GPU/multi-host
- Quick-check команды (nvidia-smi, uname, ldd, df /dev/shm)
- Tested matrix (Phase 0): RTX 5090, driver 595, CUDA 13.0.88, Ubuntu 24.04

README.md обновлён:
- Краткая таблица minimum vs recommended
- Список не-поддерживаемых платформ
- Ссылки на все docs/ файлы (architecture, protocol, requirements, benchmarks)
2026-05-14 23:11:30 +01:00

105 lines
4.4 KiB
Markdown
Raw 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.
# cuframes
Zero-copy sharing декодированных видеокадров между процессами через CUDA IPC.
**Статус:** ⚠️ Design phase. Дизайн-спецификация готова, реализация в процессе.
**Лицензия:** LGPL-2.1+
## Минимальные требования
| | Минимум | Рекомендуется |
|---|---|---|
| OS | Linux kernel ≥ 5.4 | Ubuntu 24.04 |
| GPU | NVIDIA с compute capability ≥ 7.5 (Turing+) | Ampere/Ada/Blackwell |
| NVIDIA driver | 525 (для CUDA 12) | 555+ (для CUDA 13) |
| CUDA Toolkit (build) | 12.0 | 13.0+ |
| GCC / Clang | 11 / 14 | 12+ / 17+ |
| CMake | 3.20 | 3.28+ |
| Docker | 24.x + nvidia-container-toolkit 1.14+ | — |
**Не работает** на Windows, macOS, WSL2, AMD/Intel GPU, multi-GPU producer/consumer.
Подробно — [docs/requirements.md](docs/requirements.md).
## Идея в одну минуту
Типичный setup с несколькими сервисами видеоаналитики:
```
Camera ─► ffmpeg #1 (NVR, decode + record)
─► ffmpeg #2 (AI-detector, decode + inference)
─► ffmpeg #3 (custom analytics, decode + ...)
```
Каждый сервис делает **свой** decode на GPU. На 16 cameras × 25 fps × 3 consumers
это сотни лишних NVDEC operations и GB/s VRAM-bandwidth впустую.
`cuframes` устраняет дублирование:
```
Camera ─► ffmpeg + cuframes filter ─► VRAM ─┬─► consumer 1 (NVR)
├─► consumer 2 (AI)
└─► consumer 3 (analytics)
```
Один decode, frame остаётся в VRAM, любое количество consumers читают
**zero-copy** через CUDA IPC.
## Состав
- **FFmpeg filter `cuda_ipc_export`** — добавляется в любой ffmpeg-pipeline
- **`libcuframes`** — C library + C++/Python bindings для consumers
- **Docker images** — drop-in replacement для существующих setups (включая Frigate)
## Quickstart
> 🚧 в разработке
```bash
# Producer (после v0.1)
docker run --gpus all -v /run/cuframes:/run/cuframes ghcr.io/<org>/cuframes-ffmpeg:N \
ffmpeg -hwaccel cuda -i rtsp://camera/stream \
-vf "scale_cuda=1920:1080,cuda_ipc_export=key=cam1" \
-c:v copy -f segment recording.mp4
# Consumer (C++)
#include <cuframes.hpp>
cuframes::Subscriber sub("cam1");
while (auto frame = sub.next()) {
// frame->cuda_ptr — device pointer, zero-copy
process_on_cuda(frame->cuda_ptr, frame->width, frame->height);
}
```
## Документация
- [docs/architecture.md](docs/architecture.md) — полный design document
- [docs/protocol.md](docs/protocol.md) — bit-exact wire protocol spec
- [docs/requirements.md](docs/requirements.md) — system requirements (hardware, software, build, Docker, k8s)
- [docs/benchmarks-phase0.md](docs/benchmarks-phase0.md) — Phase 0 latency/throughput measurements
- [docs/quickstart.md](docs/quickstart.md) — *(в разработке)*
## Why
Подтверждённый спрос в Frigate community ([#17033](https://github.com/blakeblackshear/frigate/discussions/17033),
[#20191](https://github.com/blakeblackshear/frigate/discussions/20191), [#21559](https://github.com/blakeblackshear/frigate/discussions/21559))
— люди тычатся в NVDEC saturation при многокамерных setup'ах. Решения уровня
NVIDIA DeepStream закрытые / vendor-locked. Open source FFmpeg-plugin для этой
ниши **не существует**. См. подробный prior-art analysis в `docs/architecture.md`.
## Roadmap
| Phase | Что | Срок |
|---|---|---|
| 0 | PoC spike, CUDA IPC latency measurements | 3 дня |
| 1 | `libcuframes` (producer/consumer ring buffer + handshake protocol) | 1 неделя |
| 2 | FFmpeg filter `vf_cuda_ipc_export` + patched FFmpeg build | 1-2 недели |
| 3 | C++ / Python bindings | 1 неделя |
| 4 | Docker packaging + Frigate drop-in image | 3-5 дней |
| 5 | Reference consumer: 16-камерный mosaic compositor | 1 неделя |
| 6 | OSS launch (HN, reddit, FFmpeg upstream PR) | 3-5 дней |
## Contributing
Проект на ранней стадии. Перед PR сверьтесь с [docs/architecture.md](docs/architecture.md)
и [CONTRIBUTING.md](CONTRIBUTING.md).