PR #24441 opened by t-boiko
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24441
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24441.patch

On NVIDIA, when limit_queues is unset, PICK_QF already caps graphics to 1 
queue. This change applies the same default to compute.
NVIDIA still creates the full compute family (often 8 queues). That dominates 
vkCreateDevice time even when decode never needs them. Transfer and video stay 
uncapped unless limit_queues is set.


>From acb30d7dfc177c4d44bb823eb1fb26e7565d3470 Mon Sep 17 00:00:00 2001
From: Tymur Boiko <[email protected]>
Date: Wed, 9 Sep 2026 23:24:11 +0200
Subject: [PATCH] avutil/hwcontext_vulkan: cap NVIDIA compute queues like
 graphics

On proprietary NVIDIA, PICK_QF already limits graphics to 1 queue
when limit_queues is unset. Compute still used the full family
count (often 8), which dominates vkCreateDevice time. Apply the
same default cap to compute. Transfer and video families are
unchanged unless limit_queues is set.
---
 libavutil/hwcontext_vulkan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index aa0efdd755..12b9e4309a 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1720,7 +1720,8 @@ static int setup_queue_families(AVHWDeviceContext *ctx, 
VkDeviceCreateInfo *cd)
             if (p->limit_queues ||                                       \
                 p->dprops.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY) { \
                 int max = p->limit_queues;                               \
-                if (type == VK_QUEUE_GRAPHICS_BIT)                       \
+                if (type == VK_QUEUE_GRAPHICS_BIT ||                     \
+                    type == VK_QUEUE_COMPUTE_BIT)                        \
                     hwctx->qf[i].num = FFMIN(hwctx->qf[i].num,           \
                                              max ? max : 1);             \
                 else if (max)                                            \
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to