From e66337d673626d69186bb938f91a20fceba130ba Mon Sep 17 00:00:00 2001 From: Cole Leavitt Date: Fri, 5 Dec 2025 09:39:15 -0700 Subject: [PATCH] fix(linux/kms): skip NVIDIA cards for VAAPI on hybrid GPU laptops --- src/platform/linux/kmsgrab.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/platform/linux/kmsgrab.cpp b/src/platform/linux/kmsgrab.cpp index 3db74899930..93f59493ddd 100644 --- a/src/platform/linux/kmsgrab.cpp +++ b/src/platform/linux/kmsgrab.cpp @@ -615,6 +615,14 @@ namespace platf { } } + // Skip Nvidia cards if we're looking for VAAPI devices + // This is important for hybrid GPU laptops where the display + // may be connected through NVIDIA but rendering happens on Intel + if (mem_type == mem_type_e::vaapi && card.is_nvidia()) { + BOOST_LOG(debug) << file << " is an NVIDIA card, skipping for VAAPI"sv; + continue; + } + auto end = std::end(card); for (auto plane = std::begin(card); plane != end; ++plane) { // Skip unused planes @@ -1612,6 +1620,14 @@ namespace platf { } } + // Skip Nvidia cards if we're looking for VAAPI devices + // This is important for hybrid GPU laptops where the display + // may be connected through NVIDIA but rendering happens on Intel + if (hwdevice_type == mem_type_e::vaapi && card.is_nvidia()) { + BOOST_LOG(debug) << file << " is an NVIDIA card, skipping for VAAPI"sv; + continue; + } + auto crtc_to_monitor = kms::map_crtc_to_monitor(card.monitors(conn_type_count)); auto end = std::end(card);