Skip to content

Commit

Permalink
Allow NVENC to be forced to try capturing non-Nvidia GPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Mar 13, 2024
1 parent d887798 commit c13a30d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/platform/linux/kmsgrab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit c13a30d

Please sign in to comment.