From de844f2a0cbedddd9def6baf62fd61cf2265d6ad Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 11 Dec 2025 20:12:59 -0600 Subject: [PATCH] Deprioritize the Nvidia VAAPI driver if Vulkan or CUDA are available --- app/streaming/video/ffmpeg-renderers/vaapi.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index 8a3eb821..69c78094 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -442,10 +442,19 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params) return false; } - // Prefer CUDA for XWayland and VDPAU for regular X11. - if (m_WindowSystem == SDL_SYSWM_X11 && vendorStr.contains("VA-API NVDEC", Qt::CaseInsensitive)) { + // Prefer Vulkan Video for Nvidia GPUs (and VDPAU for regular X11). + // + // We avoid the Nvidia VAAPI driver because: + // - It can hang in vaSyncSurface() during buffer import (older versions in particular) + // - The 16-bpc planar types cannot be imported into Vulkan due to incompatible DRM modifiers + // - EGL is broken in their driver, so we're stuck using the slow copy path in SDL renderer + if ( +#if !defined(HAVE_LIBPLACEBO_VULKAN) && !defined(HAVE_CUDA) + m_WindowSystem == SDL_SYSWM_X11 && +#endif + vendorStr.contains("VA-API NVDEC", Qt::CaseInsensitive)) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, - "Deprioritizing VAAPI for NVIDIA driver on X11/XWayland. Set FORCE_VAAPI=1 to override."); + "Deprioritizing VAAPI for NVIDIA driver. Set FORCE_VAAPI=1 to override."); return false; } }