Skip to content

Commit f44453f

Browse files
committed
Blacklist NVIDIA driver for hardware accel under Linux
Testers have reported that CEF and NVIDIA driver does not seem to work well together.
1 parent c6a6fda commit f44453f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

cmake/os-linux.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ target_compile_definitions(obs-browser PRIVATE ENABLE_BROWSER_QT_LOOP)
66

77
target_include_directories(obs-browser PRIVATE ${libdrm_include_directories})
88

9-
target_link_libraries(obs-browser PRIVATE CEF::Wrapper CEF::Library X11::X11)
9+
target_link_libraries(obs-browser PRIVATE CEF::Wrapper CEF::Library X11::X11 OBS::glad)
1010
set_target_properties(obs-browser PROPERTIES BUILD_RPATH "$ORIGIN/" INSTALL_RPATH "$ORIGIN/")
1111

1212
target_sources(obs-browser PRIVATE drm-format.cpp drm-format.hpp)

obs-browser-plugin.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#endif
5757

5858
#if !defined(_WIN32) && !defined(__APPLE__)
59+
#include <glad/glad.h>
5960
#include "drm-format.hpp"
6061
#endif
6162

@@ -700,6 +701,24 @@ static void check_hwaccel_support(void)
700701
}
701702
}
702703
}
704+
#elif __linux__
705+
static void check_hwaccel_support(void)
706+
{
707+
/* NOTE: GL_VERSION returns a string that contains the driver vendor */
708+
const char *glVersion = NULL;
709+
710+
obs_enter_graphics();
711+
gladLoadGL();
712+
glVersion = (const char *)glGetString(GL_VERSION);
713+
obs_leave_graphics();
714+
715+
if (strstr(glVersion, "NVIDIA") != NULL) {
716+
hwaccel = false;
717+
blog(LOG_INFO,
718+
"[obs-browser]: Blacklisted driver detected, disabling browser source hardware acceleration.");
719+
}
720+
return;
721+
}
703722
#else
704723
static void check_hwaccel_support(void)
705724
{

0 commit comments

Comments
 (0)