From patchwork Fri Jun 2 23:30:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 41963 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp1597810pzb; Fri, 2 Jun 2023 16:30:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5RCXYQlqa8s7D9uFv38Zc0OtCa1kyDRmN6yjux+aAy6kaLddQgokyB1i5plrrhLv+pUDSg X-Received: by 2002:a17:907:7f25:b0:973:797b:50de with SMTP id qf37-20020a1709077f2500b00973797b50demr34623ejc.60.1685748646194; Fri, 02 Jun 2023 16:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685748646; cv=none; d=google.com; s=arc-20160816; b=fnMOvTzDA8RjXM4+1kofu5OoVVpeoPeY0FEYcJX5qugoQEHpZgNk80Z4MQvDb7HjaS abZc/RUCn6pVandHie2VzeSSJ3axsIjc3D4gxWP41G3Hc6UDNzefdOkjQShU7v4jC8Dm DDp1H3hUTJQyg6hKr6uIDV+xgCx/zcDJNvgX7UsVY3CFDGc07/AxpKqUe0A8PoYfAdqN NJ4jvRVlwx/8Jx7H0DaAVMhVNI5ba/2yZCIfIThzVUZqbbFBn8y2ugwqM0j3ypYT6atE /zyq6IMKz36r6g0l8s/sVzsfqecKlV4jqY3fbDdGWz5lb5jrcFRCGSha4v8oNX+eZ3py ocpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=epj9/F7UO40oNAzejDAS0rO1zY9PIwLL72TCi2aNruE=; b=CLUIE7TQOjNNkp0NzPZJ2fWXtrecwEBwVJOVIg4Lptzjpoe2nQSvkWHIyqInS2BbGO DRDEiDqs7XKDPZsDzgacoRcgIP8zbD4zdRU8r5QzBv6sacmuPICJ0JjWIuzb2lkoKq6+ 3n/OZBuXLr30cO6bXR+R2cam1CGjA1fziJ/ZkFBbNnmE7Y6JupnDJ563LfCC1Dehpdp3 XW075po+UOzZyZnbTVGv4C5Bwb/UF+0ej8FjHvXhFFtDzdA/Ti4zmo7x7pLN1BqlVkRh JQvb9I/f65NA+urdOMHNTKVGv88hppgDUR/dGHpZRcK5qyNPXyP1An3R8RvFtYiGXI1M i3bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org header.s=mail header.b=Ehgkq7cZ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=overt.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t6-20020a1709060c4600b0096664e81917si1527684ejf.997.2023.06.02.16.30.45; Fri, 02 Jun 2023 16:30:46 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org header.s=mail header.b=Ehgkq7cZ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=overt.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D43A068C364; Sat, 3 Jun 2023 02:30:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.overt.org (mail.overt.org [72.14.183.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5977868C2E3 for ; Sat, 3 Jun 2023 02:30:36 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=overt.org; s=mail; t=1685748634; bh=IqJXNixz/TN/r9ItVC68toia2Yz35hRVIoJqcjdhECc=; h=From:To:Cc:Subject:Date:From; b=Ehgkq7cZSu4WPAANhpgfZ8CwlJXEBz4HXbhLmAoHrvOYg9cli4Pyc5UYBo2HYP7ec YxhIwh4/EDmm4oDIaSSLDYRlFi6Oz9oxlZwmC3jaE0cpyDe7GHo4OoUGPq9Ic/Mjt8 re0mmm98Tk1ntam5+PoMMT5JZPiZE/gRJy39aMCQSbtrN2eoPPBs7P+A01DGIEP+bE TvUBdLvI77dHU9SEpTpyjQPE+7BmjcUn60xh8eDQ6btAGY946jLPuHa6yWiBdjXAnh 5w48yzpbQEAHupwONE9zqhb9TKhm+ylP1Cux81qCT+wxmxHjL9wfpcJUWOzcE4yC9O sbPigsi39F9lg== Received: from authenticated-user (mail.overt.org [72.14.183.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 7BDF560A30; Fri, 2 Jun 2023 18:30:34 -0500 (CDT) From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Fri, 2 Jun 2023 16:30:27 -0700 Message-Id: <20230602233027.136273-1-philipl@overt.org> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avutil/hwcontext_vulkan: disable multiplane when deriving from cuda X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Philip Langdale Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: BADgBGhDV4Z0 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,,hwupload=derive_device=cuda Signed-off-by: Philip Langdale --- 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