From c13a30db7876ad18fecd222f4433ccd11f24d6c5 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 12 Mar 2024 21:01:49 -0500 Subject: [PATCH] Allow NVENC to be forced to try capturing non-Nvidia GPUs --- src/platform/linux/kmsgrab.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/platform/linux/kmsgrab.cpp b/src/platform/linux/kmsgrab.cpp index 748fc93a..d4feb355 100644 --- a/src/platform/linux/kmsgrab.cpp +++ b/src/platform/linux/kmsgrab.cpp @@ -625,9 +625,12 @@ namespace platf { } // Skip non-Nvidia cards if we're looking for CUDA devices + // unless NVENC is selected manually by the user if (mem_type == mem_type_e::cuda && !card.is_nvidia()) { BOOST_LOG(debug) << file << " is not a CUDA device"sv; - continue; + if (config::video.encoder != "nvenc") { + continue; + } } auto end = std::end(card); @@ -1635,9 +1638,15 @@ namespace platf { } // Skip non-Nvidia cards if we're looking for CUDA devices + // unless NVENC is selected manually by the user if (hwdevice_type == mem_type_e::cuda && !card.is_nvidia()) { BOOST_LOG(debug) << file << " is not a CUDA device"sv; - continue; + if (config::video.encoder == "nvenc") { + BOOST_LOG(warning) << "Using NVENC with your display connected to a different GPU may not work properly!"sv; + } + else { + continue; + } } auto crtc_to_monitor = kms::map_crtc_to_monitor(card.monitors(conn_type_count));