Repository navigation
Run the temporal camera filter on Vulkan compute with CPU fallback - #1
Conversation
…lback Reproduce the CPU fixed-point filter and noise estimator in a GPU plugin, prefer it for the temporal stage, and add parity and paced benchmark tooling. Hardware measurements remain pending. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cover single and split plane DMA-BUF offsets, padded strides and invalid buffer ranges without a camera. Keep software Vulkan test workers bounded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cache successful loads while allowing missing or invalid plugins to be retried after installation. Test the optional DMA-BUF companion and legacy ABI v1 plugins without a GPU. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop old camera-pool references after synchronous processing completes, and probe DMA-BUF support again for the next stream. Document CPU fallback warmup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Vulkan loader pkg-config file may be installed without development headers. Auto mode should omit the plugin in that case; explicitly enabled builds should explain the missing dependency at configuration. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Export linear allocations on the build GPU and pass them through the plugin companion ABI. Compare every output byte and noise estimate to CPU across offset/stride variations, pool reuse, resets and rejected bounds, without a camera. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Document exact RADV upload and DMA-BUF parity, strict enabled/disabled builds, and historical CPU reference rows. Keep paired Apple camera latency, CPU, GPU busy and power results pending. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Measured this branch live on the Neo (fleet14b, 1080p30, camera open, 10 s means of the SMC PPMC rail at real governor clocks). Camera node alone 1637 mW. CPU backend 2034 mW (+397 mW, 42% of one core, 14.3 ms per frame). This Vulkan backend 2960 mW (+1323 mW, 3.5% CPU, 6.1 ms per frame). So today it costs about 3.3x the CPU backend in energy. Please keep |
On the Neo at 1080p30 the Vulkan path costs about 3.3 times the CPU path's extra energy (+1323 mW against +397 mW on the SMC PPMC rail), so it should not be the default yet. Add temporal-backend = auto | cpu | gpu, also --temporal-backend. auto is the CPU for now. gpu runs the temporal stage on Vulkan compute when the plugin and device work, else on the CPU as before. backend = cpu still forces the CPU for both stages. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
|
Made |
The always-on temporal camera filter spends CPU time on every frame. Add
cdn-backend-gpu.so, a Vulkan compute version of that stage. It is opt-in withtemporal-backend = gpu(or--temporal-backend gpu), andautostays on the CPU. On the Neo the GPU path costs about 3.3 times the CPU path's energy today, so it should not be the default until it is cheaper. With the GPU asked for, it falls back to the CPU when the plugin or device is unavailable or processing fails.--backend cpuforces the CPU for both stages, and the low-light backend remains independently triggered.The compute shaders reproduce the CPU noise estimator, fixed-point history, motion tests, edge-preserving luma filter and both chroma passes. An optional companion entry preserves backend ABI v1 while importing linear NV12 DMA-BUF planes with producer-fence waits and foreign ownership transfers. Unsupported imports use one upload. Output copies into the existing PipeWire memory buffer.
Validation on Radeon RX 7900 XTX / RADV NAVI31:
Neo (J700), live camera at 1080p30: the default runs
temporal cpu(18.2 ms per frame) and--temporal-backend gpuruns on the A18 Pro with imported DMA-BUFs and no upload (6.0 ms per frame), 300 frames each, no AVCs with SELinux enforcing. Build with-Dgpu=enabled -Dwerror=trueon the Neo: 7/7 tests passed on the real GPU (CDN_TEST_REQUIRE_GPU=1).Power on the Neo from 11-01 is in the validation notes. The other Macs' paired rows are still to do, and they only matter for when
autocan move to the GPU.