aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-03-21 20:16:58 +0100
committerdec05eba <dec05eba@protonmail.com>2024-03-21 20:16:58 +0100
commit08622c0712502bafb57514a414ed22845b729e6f (patch)
treef2b416c91cae92cb74dd73c47b14c67f5aece8bd /src/main.cpp
parent28efefc4a90d6b56212e8506f2989016629d0191 (diff)
Force set __GL_THREADED_OPTIMIZATIONS to 0, which fixes window capture/wayland capture for nvidia for users that have set it to 1
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f28cacb..e6c3be8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1595,6 +1595,9 @@ int main(int argc, char **argv) {
// Stop nvidia driver from buffering frames
setenv("__GL_MaxFramesAllowed", "1", true);
+ // If this is set to 1 then cuGraphicsGLRegisterImage will fail for egl context with error: invalid OpenGL or DirectX context,
+ // so we overwrite it
+ setenv("__GL_THREADED_OPTIMIZATIONS", "0", true);
// Some people set this to nvidia (for nvdec) or vdpau (for nvidia vdpau), which breaks gpu screen recorder since
// nvidia doesn't support vaapi and nvidia-vaapi-driver doesn't support encoding yet.
// Let vaapi find the match vaapi driver instead of forcing a specific one.