Raja-89
09bf8dab5b
avfilter/dnn: implement zero-copy CUDA tensor mapping for Torch backend
...
When a CUDA frame with a supported RGB sw_format is received, map the
GPU device pointer directly into a LibTorch tensor using
torch::from_blob() with CUDA device options, bypassing cudaMemcpy
entirely.
Changes:
- Add fill_model_input_cuda() that extracts the CUdeviceptr from the
AVHWFramesContext and wraps it in a PyTorch GPU tensor with a no-op
deleter (memory owned by FFmpeg AVBuffer ref-counting).
- Handle GPU memory alignment padding via custom strides derived from
AVFrame linesize.
- Permute the mapped NHWC tensor to NCHW (PyTorch convention).
- Manage CUDA context explicitly with cuCtxPushCurrent/cuCtxPopCurrent
for thread safety in async filter graphs.
- Implement zero-copy Device-to-Device output mapping that writes the
model result directly into the output frame's VRAM, bypassing
ff_proc_from_dnn_to_frame / sws_scale entirely for CUDA frames.
- Add torch::cuda::synchronize() to prevent async race conditions
with downstream encoders (e.g. NVENC reading uninitialized frames).
- Add format validation in ff_dnn_zero_copy_supported_cuda() to reject
unsupported sw_formats and batching with CUDA zero-copy early.
- Register AV_PIX_FMT_CUDA in vf_dnn_processing pixel format list.
- Gracefully fall back to CPU path when sw_format is not a supported
RGB variant or when CONFIG_CUDA is not enabled.
Signed-off-by: Raja-89 <imraja729@gmail.com >
2026-08-09 02:13:24 +00:00
..
2026-01-09 16:10:10 +00:00
2026-04-04 11:31:16 +00:00
2026-08-09 02:13:24 +00:00
2025-12-16 17:30:29 +02:00
2026-02-03 21:07:29 +00:00
2026-07-13 18:57:37 +09:00
2026-08-06 19:59:16 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-06-30 11:05:29 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2025-09-04 23:12:34 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-07-11 19:32:17 -03:00
2026-01-24 08:11:19 +00:00
2026-07-31 04:00:18 +00:00
2026-06-13 21:41:05 +00:00
2026-07-11 19:32:17 -03:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-05-25 22:21:41 +00:00
2026-01-24 08:11:19 +00:00
2026-02-26 11:40:16 +08:00
2026-03-13 21:31:54 +01:00
2026-08-05 19:37:11 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2025-10-07 14:51:46 -07:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-04-08 11:52:44 -03:00
2026-07-13 18:16:18 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-04-10 15:12:18 +02:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-04-28 12:29:37 +00:00
2026-06-22 11:43:51 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-03-10 13:52:19 +01:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-04-10 15:12:18 +02:00
2026-07-22 02:50:50 +00:00
2026-06-23 17:15:02 +02:00
2026-07-27 20:13:00 +02:00
2025-10-04 17:49:08 +02:00
2026-05-16 17:22:45 +00:00
2026-06-23 22:38:55 +00:00
2025-09-02 17:06:25 +02:00
2026-04-12 20:02:18 +00:00
2026-03-29 09:38:01 +00:00
2025-11-30 22:20:13 +01:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-03-06 03:21:37 +01:00
2026-08-09 02:13:24 +00:00
2026-08-09 02:13:24 +00:00
2026-07-24 14:06:09 +00:00
2025-09-02 17:06:25 +02:00
2025-09-02 17:06:25 +02:00
2025-08-12 09:01:39 +00:00
2026-01-24 08:11:19 +00:00
2026-08-06 00:30:00 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2025-12-14 12:41:00 +05:30
2026-06-08 02:20:53 +00:00
2026-06-13 21:41:05 +00:00
2026-07-27 20:32:34 +02:00
2026-07-27 20:32:34 +02:00
2026-04-10 22:02:00 +02:00
2026-04-10 15:12:18 +02:00
2025-09-26 12:24:04 -03:00
2026-07-05 09:02:40 +02:00
2026-02-10 19:44:46 +01:00
2026-02-10 19:44:46 +01:00
2026-07-13 18:16:18 +00:00
2026-02-14 12:21:10 +00:00
2026-02-14 12:21:10 +00:00
2025-11-30 22:20:13 +01:00
2025-09-02 17:06:25 +02:00
2026-04-28 06:14:38 +00:00
2025-09-30 15:39:39 +00:00
2026-06-23 19:22:21 +00:00
2025-11-30 22:20:13 +01:00
2026-05-15 18:19:40 -07:00
2026-01-24 08:11:19 +00:00
2026-01-05 20:41:59 +00:00
2025-08-11 19:29:53 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-06-23 19:15:57 +02:00
2026-07-14 19:45:02 +00:00
2026-01-24 08:11:19 +00:00
2026-07-29 08:52:27 +00:00
2026-03-13 12:52:57 -03:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-12-03 11:52:54 +01:00
2026-08-05 16:04:31 +09:00
2026-06-13 21:41:05 +00:00
2025-10-07 16:00:27 +00:00
2026-06-13 21:41:05 +00:00
2026-08-05 16:04:37 +09:00
2026-06-13 21:41:05 +00:00
2025-12-16 17:30:23 +02:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-08-05 16:04:31 +09:00
2026-06-13 21:41:05 +00:00
2026-03-10 13:52:19 +01:00
2026-06-13 21:41:05 +00:00
2026-07-02 03:16:42 +00:00
2026-06-28 19:33:23 +00:00
2026-08-05 16:04:31 +09:00
2026-08-08 21:46:08 +00:00
2026-06-13 21:41:05 +00:00
2026-08-05 16:04:31 +09:00
2025-10-07 16:00:27 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-05-03 13:23:21 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-06-13 21:41:05 +00:00
2025-12-03 11:52:54 +01:00
2026-06-15 03:15:19 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-02-10 19:44:46 +01:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-03-06 01:45:09 -05:00
2025-08-12 09:01:39 +00:00
2025-09-04 22:20:58 +02:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-07-31 13:21:29 +00:00
2026-08-09 02:13:24 +00:00
2025-08-12 09:01:39 +00:00
2026-06-02 00:52:03 +00:00
2026-04-28 12:29:37 +00:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2025-12-03 21:23:51 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-02-10 19:44:46 +01:00
2026-08-05 16:04:31 +09:00
2026-07-13 17:14:54 +00:00
2026-07-27 10:51:09 +02:00
2026-02-26 11:40:16 +08:00
2025-11-30 22:20:13 +01:00
2026-04-21 16:47:05 +00:00
2025-08-12 09:01:39 +00:00
2026-04-30 08:33:31 -05:00
2025-11-17 12:18:12 +01:00
2025-11-17 12:18:12 +01:00
2025-11-30 22:20:13 +01:00
2025-11-30 22:20:13 +01:00
2026-08-05 16:04:31 +09:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-01-24 08:11:19 +00:00
2026-07-22 02:50:50 +00:00
2026-07-22 02:50:50 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-07-14 19:45:02 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2025-09-21 11:02:41 +00:00
2025-11-30 22:20:13 +01:00
2025-09-21 11:02:41 +00:00
2026-08-05 16:04:31 +09:00
2026-05-03 13:25:48 +00:00
2026-06-13 21:41:05 +00:00
2026-07-13 18:16:18 +00:00
2026-03-27 21:00:53 -03:00
2026-06-13 21:41:05 +00:00
2026-01-02 23:46:42 +08:00
2026-07-13 18:57:38 +09:00
2025-08-12 09:01:39 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-07-24 19:09:44 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-07-02 18:23:18 +02:00
2026-06-13 21:41:05 +00:00
2026-01-27 17:05:27 +00:00
2026-02-26 11:40:16 +08:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-07-20 17:49:47 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-12-08 21:31:13 +00:00
2026-06-13 21:41:05 +00:00
2026-01-09 16:10:10 +00:00
2026-08-05 16:04:37 +09:00
2026-06-13 21:41:05 +00:00
2026-01-09 16:10:10 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-10-16 18:41:19 +02:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-08-05 16:04:31 +09:00
2026-06-13 21:41:05 +00:00
2025-09-02 17:06:25 +02:00
2025-09-02 17:06:25 +02:00
2026-01-24 08:11:19 +00:00
2026-01-24 08:11:19 +00:00
2026-07-05 00:41:30 +00:00
2025-10-07 14:51:46 -07:00
2026-06-13 21:41:05 +00:00
2026-05-15 20:29:29 +02:00
2026-05-15 20:29:29 +02:00
2026-06-13 21:41:05 +00:00
2025-12-03 11:52:54 +01:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-11-30 22:20:13 +01:00
2026-07-05 22:31:27 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-30 11:15:33 +00:00
2025-09-02 17:06:25 +02:00
2026-07-08 12:37:35 +00:00
2026-06-23 19:22:21 +00:00
2026-06-23 19:22:21 +00:00
2026-07-31 13:29:24 +00:00
2026-04-28 06:14:38 +00:00
2026-04-28 06:14:38 +00:00
2026-04-28 06:14:38 +00:00
2026-04-28 06:14:38 +00:00
2026-08-05 16:04:31 +09:00
2026-05-31 21:20:54 +00:00
2026-08-05 16:04:37 +09:00
2025-08-12 09:01:39 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-10-28 20:46:21 +01:00
2026-06-13 21:41:05 +00:00
2025-12-03 11:52:54 +01:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2025-10-15 19:43:37 +02:00
2026-03-11 10:23:35 +01:00
2026-04-13 19:49:32 +08:00
2026-06-13 21:41:05 +00:00
2026-01-03 21:31:30 -03:00
2026-06-13 21:41:05 +00:00
2026-06-23 03:57:25 +00:00
2026-06-13 21:41:05 +00:00
2026-07-13 18:22:46 +00:00
2025-11-30 22:20:13 +01:00
2026-06-13 21:41:05 +00:00
2026-06-24 12:18:15 +00:00
2026-06-13 21:41:05 +00:00
2025-09-02 17:06:25 +02:00
2026-03-27 19:42:08 -03:00
2026-02-10 19:44:43 +01:00
2026-02-26 11:40:16 +08:00
2026-06-13 21:41:05 +00:00
2025-09-02 17:06:25 +02:00
2026-06-24 12:18:15 +00:00
2026-04-20 21:08:21 +02:00
2026-08-05 16:04:31 +09:00
2026-06-13 21:41:05 +00:00
2025-12-03 11:52:54 +01:00
2026-06-13 21:41:05 +00:00
2026-07-13 18:57:37 +09:00
2026-07-07 17:43:18 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-06-13 21:41:05 +00:00
2026-04-01 21:56:37 +08:00
2026-06-26 21:15:23 +00:00
2025-08-12 09:01:39 +00:00
2026-03-31 11:17:51 +00:00
2026-01-24 08:11:19 +00:00
2026-07-13 16:40:41 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-08-05 16:04:31 +09:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-07-29 00:42:47 +00:00
2026-06-28 19:33:23 +00:00
2026-06-13 21:41:05 +00:00
2026-06-13 21:41:05 +00:00
2026-01-24 08:11:19 +00:00
2026-04-10 15:12:18 +02:00
2026-01-29 22:33:33 +01:00
2025-09-17 14:50:41 +00:00
2025-09-14 11:45:11 +00:00
2026-07-06 06:39:19 +00:00
2025-09-18 01:04:59 +00:00
2025-09-14 11:45:11 +00:00
2025-09-14 20:33:24 +02:00
2026-01-24 08:11:19 +00:00
2026-02-26 11:40:16 +08:00
2026-08-05 16:04:31 +09:00
2026-04-28 12:29:37 +00:00
2026-04-21 08:28:45 +02:00
2026-04-21 08:28:45 +02:00