(Linux) Error: GLLoader failed to get GL version
PCSX2 version:
version 1.5.0-dev-3405-gf68bbfba6 that I built using GCC 10.0.1 on Fedora Linux 32 (Kernel 5.6.7 x64 on i7-7500U laptop with GeForce 940MX)
cmake -DCMAKE_BUILD_TYPE=Release -DXDG_STD=TRUE -DCMAKE_BUILD_PO=FALSE -DSDL2_API=TRUE -DGTK3_API=TRUE -DCMAKE_TOOLCHAIN_FILE=cmake/linux-compiler-i386-multilib.cmake -DCMAKE_INSTALL_PREFIX=/usr ..
(unlike previous builds I've made using these exact flags, it now produces a portable build instead ...)
- Notes: Occurs with all game ISOs I've tried and BIOS
PCSX2 options: all default settings
Plugins used: libGSdx.so [GSdx (GCC 10.0.1 AVX2/AVX2) 1.2.0] PAD: libLilyPad-0.11.0.so [LilyPad (20200428143352) 0.12.1] SPU2: libspu2x-2.0.0.so [SPU2-X 2.0.0] CDVD: libCDVDnull.so [CDVDnull Driver 20200428143352 0.6.0] USB: libUSBnull-0.7.0.so [USBnull Driver 20200428143352 0.7.0] FW: libFWnull-0.7.0.so [FWnull Driver 20200428143352 0.7.0] DEV9: libdev9null-0.5.0.so [DEV9null Driver 20200428143352 0.5.0]
Description of the issue: Trying to load a game or the BIOS on integrated graphics works fine, but using NVidia PRIME render offloading which worked ~1 week ago in PCSX2 and still works on other games/apps.
$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x47 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 0 name:modesetting
Provider 1: id: 0x241 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0
$ __NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER="NVIDIA-G0" __GLX_VENDOR_LIBRARY_NAME="nvidia" glxgears -info
GL_RENDERER = GeForce 940MX/PCIe/SSE2
GL_VERSION = 4.6.0 NVIDIA 440.82
GL_VENDOR = NVIDIA Corporation
$ __NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER="NVIDIA-G0" __GLX_VENDOR_LIBRARY_NAME="nvidia" ./PCSX2
.........
Init SPU2
Init CDVD
Init USB
Init FW
Init DEV9
Plugins initialized successfully.
Patches: No CRC found, using 00000000 instead.
Opening plugins...
Opening GS
Error: GLLoader failed to get GL version
Closing plugins...
Closing GS
Plugins closed successfully.
Shutting down plugins...
Plugins shutdown successfully.
(p) GS plugin failed to open!(thread:MTGS)(thread:EE Core)
How to reproduce the issue: see above
Last known version to work:
My old build was installed to /usr/bin but now can't be opened to check the version as it throws an error:
PCSX2: symbol lookup error: PCSX2: undefined symbol: _ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE9_M_createERjj, version WXU_3.0
PC specifications: Laptop w/ GCC 10.0.1 on Fedora Linux 32 (Kernel 5.6.7 x64) on i7-7500U with GeForce 940MX.
Seems to work okay on Arch with these vars:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia ./PCSX2
Can you please be certain other 32-bit OpenGL applications can render using the NVIDIA GPU?
Yes, other 32-bit opengl programs still work fine:
[eric@t25 bin]$ file /usr/bin/glxspheres
/usr/bin/glxspheres: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=5d25ec2325a78c3be59b670dba599381ef6fac81, for GNU/Linux 3.2.0, stripped
[eric@t25 bin]$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxspheres
Polygons in scene: 62464 (61 spheres * 1024 polys/spheres)
Visual ID of window: 0x595
Context is Direct
OpenGL Renderer: GeForce 940MX/PCIe/SSE2
61.416660 frames/sec - 68.540993 Mpixels/sec
Just curious, what cmake flags do you use on Arch? Is it weird that "sudo make install" is putting a portable install into ../pcsx2/bin/ instead of /usr/bin as I told it to?
I suspect that the change is due to the libraries being used. With Fedora 31 the loader worked properly; with Fedora 32
- if the system is set-up to use just the integrated intel graphics, then it works
- if the system is set-up to use ONLY the discrete card (nvidia), then it works (i.e. the set-up is such that the intel driver is not loaded at all)
- if the system is set-up to use optimus (i.e. I use both drivers and select the renderer via the environment variables), then there are errors.
My feeling is that perhaps the environment variables are not passed properly to GLvnd when it is opened by GSdx.
I have found out that if I compile with EGL support instead of OpenGL, then the library is properly loaded and it works as expected.
I am also affected by this issue on Ubuntu 20.04 with a dedicated GTX1050 an Mesa Intel(R) HD Graphics 630 (KBL GT2) integrated graphics.
This is only happening when launching the application "with the dedicated graphics card" I can provide more info if needed
I can confirm that rebuilding with EGL support completely fixed the issue on my machine. I'm gonna go ahead and close this.
@whp199 could you provide your cmake commands please
Same as my original post except with -DEGL_API=TRUE added
Maybe I am a bit new to graphics but why would enabling EGL would make it play nicely again with the dedicated graphics card.
I this this issue is not really fixed. I can try to to fix it myself if I get more details.
@whp199 what is the log output you have once you compile with EGL?
We reopened this issue as Jibbity mentioned compiling with explicit EGL support isn't really the proper fix for the issue more then the work around
@tete17 here is my log output now:
Initializing plugins...
Init GS
Init PAD
Init SPU2
Init CDVD
Init USB
Init FW
Init DEV9
Plugins initialized successfully.
Patches: No CRC found, using 00000000 instead.
Opening plugins...
Opening GS
EGL: Supported extensions: EGL_EXT_platform_base EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_KHR_platform_x11 EGL_EXT_platform_x11 EGL_EXT_platform_device EGL_KHR_platform_wayland EGL_EXT_platform_wayland EGL_MESA_platform_gbm EGL_MESA_platform_surfaceless
EGL: select X11 platform
OpenGL information. GPU: GeForce 940MX/PCIe/SSE2. Vendor: NVIDIA Corporation. Driver: NVIDIA 440.82
INFO: GL_ARB_sparse_texture is NOT SUPPORTED
INFO: GL_ARB_sparse_texture2 is NOT SUPPORTED
INFO: GL_ARB_gpu_shader5 is available
INFO: GL_ARB_shader_image_load_store is available
INFO: GL_ARB_compute_shader is available
INFO: GL_ARB_shader_storage_buffer_object is available
INFO: GL_ARB_texture_view is available
INFO: GL_ARB_vertex_attrib_binding is available
INFO: GL_ARB_clear_texture is available
INFO: GL_ARB_multi_bind is available
INFO: GL_ARB_direct_state_access is available
Failed to init the freetype face
INFO: GL_ARB_texture_barrier is available
INFO: GL_ARB_get_texture_sub_image is available
Current Renderer: OpenGL (Hardware renderer)
Available VRAM/RAM:3840MB for textures
Opening PADGSdx Lookup CRC:0
GSdx Lookup CRC:0
Opening SPU2
Request SDL audio driver: pulseaudio
Opened SDL audio driver: pulseaudio
Ok this as much a "status updated" as a request for help.
I am capable of cross-compiling the latest master branch on my local machine and I am able to reproduce the issue. I am even capable of running a debugger through it which is more than what I was expecting.
My nvidia-smi output doesn't change when running the program with the above environment variables:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64 Driver Version: 440.64 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1050 Off | 00000000:01:00.0 Off | N/A |
| N/A 40C P8 N/A / N/A | 133MiB / 4042MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1186 G /usr/lib/xorg/Xorg 66MiB |
| 0 29143 G /usr/lib/xorg/Xorg 66MiB |
+-----------------------------------------------------------------------------+
The issue is fairly obvious just by the error message. The call to glGetString(GL_VERSION) return's NULL. This should be expected if no OpenGL context is created before hand but I can see the code (with the debugger) go through plugins/GSdx/Window/GSWndOGL.cpp:38 ie: void GSWndOGL::CreateContext(int major, int minor) without any trouble.
I have a couple of theories here but I am a total noob regarding opengl so I am bit lost:
- The nvidia opengl library is not properly loaded.
- Has something to do with
glXGetProcAddressnot returning null even tough the library does not support those features? https://dri.freedesktop.org/wiki/glXGetProcAddressNeverReturnsNULL/ - A bug in the opengl library for nvidia prime?
I really hope I am not saying anything completely ridiculous, please have patience with me. If anyone has more info or documentation that I could read through, maybe even a way to expose more debug info from opengl?
Another of the thigs that I tried to understand the problem was the following patch
Index: plugins/GSdx/Window/GSWndOGL.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- plugins/GSdx/Window/GSWndOGL.cpp (revision a30a6583c19b3172a873f095037282009a5d74ba)
+++ plugins/GSdx/Window/GSWndOGL.cpp (date 1589731714720)
@@ -102,6 +102,13 @@
fprintf(stderr, "Failed to create the opengl context. Check your drivers support openGL %d.%d. Hint: opensource drivers don't\n", major, minor );
throw GSDXRecoverableError();
}
+
+ PFNGLGETSTRINGIPROC gl_getString = (PFNGLGETSTRINGIPROC) glXGetProcAddress((const GLubyte*) "glGetString");
+ const char* version = (const char*)gl_getString(GL_VERSION, 0);
+ if (version == NULL) {
+ fprintf(stdout, "Version: %s", version);
+ throw GSDXRecoverableError();
+ }
}
void GSWndOGL::AttachContext()
This also returned null. In fact it returned null even with the integrated gpu which leads me to believe I am not allowed to calle it there...
Feedback and help are more that appreciated.
Small INFO. EGL isn't replacement of OpenGL but GLX(X11). It is a glue to connect surface/window to the GL driver.
So you have either EGL-OpenGL or GLX-OpenGL. X11 is kinds of deprecated due to Wayland. I really don't know what is the EGL status for the various HW vendor. But maybe it would be a good idea to test EGL everywhere and drop GLX

you guys make daily builds of pcsx2 and didn't fix this yet? I'm not trying to be rude but what about to disable that check it should work just fine then would it? also when I use the Windows version it work fine
The branch which removes the use of GLX (as EGL has taken its place) has been merged. This has mainly been tested on desktop AMD and NVIDIA set-ups, but since EGL has been reported as fixing the issue, hopefully this will solve your problems.
I'll go ahead and close this as assumed fixed.
Thanks, lg
On Sun, Aug 9, 2020 at 10:42 AM lightningterror [email protected] wrote:
I'll go ahead and close this as assumed fixed.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PCSX2/pcsx2/issues/3347#issuecomment-671025002, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYBVNG3A4XZ4C7C7W77SALR7ZOP3ANCNFSM4MXP5A5Q .
I'm still seeing this problem on Ubuntu 20.04 with both the 1.5.0 release from the repository and hand-built versions of 1.6.0 and 1.7.0 both with and without the EGL flag. Graphics card is GTX 950M.