* [FFmpeg-devel] [PATCH] avutil/hwcontext_vulkan: disable multiplane when deriving from cuda
@ 2023-06-02 23:30 Philip Langdale
0 siblings, 0 replies; only message in thread
From: Philip Langdale @ 2023-06-02 23:30 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Philip Langdale
Today, cuda is not able to import multiplane images, and cuda requires
images to be imported whether you trying to import to cuda or export
from cuda (in the later case, the image is imported and then copied
into on the cuda side). So any interop between cuda and vulkan requires
that multiplane be disabled.
The existing option for this is not sufficient, because when deriving
devices it is not possible to specify any options.
And, it is necessary to derive the Vulkan device, because any pipeline
that involves uploading from cuda to vulkan and then back to cuda must
use the same cuda context on both sides, and the only way to propagate
the cuda context all the way through is to derive the device at each
stage.
ie:
-vf hwupload=derive_device=vulkan,<filters>,hwupload=derive_device=cuda
Signed-off-by: Philip Langdale <philipl@overt.org>
---
libavutil/hwcontext_vulkan.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index e8241638d9..2c594317f9 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1589,6 +1589,11 @@ static int vulkan_device_derive(AVHWDeviceContext *ctx,
dev_select.has_uuid = 1;
+ /*
+ * CUDA is not able to import multiplane images, so always derive a
+ * Vulkan device with multiplane disabled.
+ */
+ av_dict_set(&opts, "disable_multiplane", "1", 0);
return vulkan_device_create_internal(ctx, &dev_select, opts, flags);
}
#endif
--
2.39.2
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-06-02 23:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 23:30 [FFmpeg-devel] [PATCH] avutil/hwcontext_vulkan: disable multiplane when deriving from cuda Philip Langdale
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git