nowrep / obs-vkcapture

OBS Linux Vulkan/OpenGL game capture
GNU General Public License v2.0
502 stars 24 forks source link

Failed to resolve glXGetProcAddress #190

Closed Arisa-Snowbell closed 7 months ago

Arisa-Snowbell commented 7 months ago

Describe the bug Minecraft errors out with "GLFW error 65543: GLX: Forward compatibility requested but GLX_ARB_create_context_profile is unavailable." if I use obs-gamecapture.

System (please complete the following information):

Game log:

[obs-vkcapture] Init GLX 1.4.7 (64bit)
[obs-vkcapture] Failed to resolve glXGetProcAddress
[21:25:30] [Render thread/WARN]: Failed to create window: 
ekt$a: GLFW error 65543: GLX: Forward compatibility requested but GLX_ARB_create_context_profile is unavailable
    at ekt.b(SourceFile:195) ~[minecraft-1.20.2-client.jar:?]
    at org.lwjgl.glfw.GLFWErrorCallbackI.callback(GLFWErrorCallbackI.java:43) ~[lwjgl-glfw-3.3.2.jar:build 13]
    at org.lwjgl.system.JNI.invokePPPP(Native Method) ~[lwjgl-3.3.2.jar:build 13]
    at org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:2058) ~[lwjgl-glfw-3.3.2.jar:build 13]
    at org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:2229) ~[lwjgl-glfw-3.3.2.jar:build 13]
    at ekt.<init>(SourceFile:93) ~[minecraft-1.20.2-client.jar:?]
    at fow.a(SourceFile:21) ~[minecraft-1.20.2-client.jar:?]
    at eqv.<init>(SourceFile:494) ~[minecraft-1.20.2-client.jar:?]
    at net.minecraft.client.main.Main.main(SourceFile:214) ~[minecraft-1.20.2-client.jar:?]
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:87) ~[NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:130) ~[NewLaunch.jar:?]
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) ~[NewLaunch.jar:?]

Additional info:

[21:25:16] [Render thread/INFO]: Backend library: LWJGL version 3.3.2+13
Arisa-Snowbell commented 7 months ago

More maybe useful info:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 535.113.01
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 535.113.01
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 535.113.01
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
nowrep commented 7 months ago

Can you please try this patch?

diff --git a/src/glinject.c b/src/glinject.c
index 585abe0..df5be6a 100644
--- a/src/glinject.c
+++ b/src/glinject.c
@@ -132,7 +132,11 @@ static bool gl_init_funcs(bool glx)
     data.glx = glx;

     if (glx) {
-        void *handle = NULL;
+        void *handle = dlopen("libGLX.so.0", RTLD_LAZY);
+        if (!handle) {
+            hlog("Failed to open libGLX.so.0");
+            return false;
+        }
         GETGLXADDR(GetProcAddress);
         GETGLXADDR(GetProcAddressARB);
         GETGLXPROCADDR(DestroyContext);
Arisa-Snowbell commented 7 months ago

That patch fixed it, thank you