You are not logged in.
I am having problems getting openGL to work with opencpn, an app that requires (optionally) openGL to optimize the display of nautical charts. My system is an old Lenovo W520 Thinkpad laptop with an nvidia Quadro 1000M GPU. According to glxinfo and eglinfo, the card supports openGL version 4.6 and EGL version 1.5, which is sufficient for opencpn:
stefano@hippias OpenCPN $ glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
Dedicated video memory: 2048 MB
Total available memory: 2048 MB
Currently available dedicated video memory: 1370 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro 1000M/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 390.157
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 4.6.0 NVIDIA 390.157
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.157
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
eglinfo reports a problem with Wayland, apparently (which I am not running on), but otherwise everything looks ok:
stefano@hippias OpenCPN $ eglinfo -B
GBM platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 24.0.6-arch1.2
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.0.6-arch1.2
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 17.0.6, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.6-arch1.2
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
Wayland platform:
eglinfo: eglInitialize failed
X11 platform:
EGL API version: 1.4
EGL vendor string: NVIDIA
EGL version string: 1.4
EGL client APIs:
Segmentation fault (core dumped)
Yet, opencpn's startup tests report to the app that openGL is unavailable and openGL rendering is disabled at launch. Here is the output from opencpn's own utility function to check openGL availability:
stefano@hippias build $ opencpn-glutil opengl-info
Error: EGL version is 1.4. EGL version 1.5 or greater is required.
{
"GL_ERROR" : 0,
"GL_USABLE" : false,
"GL_ERROR_STRING" : "Missing GL version"
}
So there is clearly a mismatch between the output from glxinfo/eglinfo and the report from opencpn's own utility. I am now trying to figure out where the problem lies. Opencpn's people I have been talking to (and who have suggested the test I just reported above) think that the nvidia driver may be the root cause of the problem, because it is not reporting the correct information and/or it is not providing the correct opengl capabilities.
TL;DNR: How can I test if my card/driver combination provides the opengl services it should provide?
Last edited by stefano (2024-05-10 09:15:18)
Offline
There's no mismatch, your card provides 1.4. What you see providing 1.5 is the software renderer, which will run on your CPU anyway. to "force that" try LIBGL_ALWAYS_SOFTWARE=1 opencpn-glutil opengl-info. But your not using the GPU with that.
Last edited by V1del (2024-05-08 11:02:02)
Offline
nvidia's GL library doesn't really care about LIBGL_ALWAYS_SOFTWARE
"__GLX_VENDOR_LIBRARY_NAME=mesa" but idk whether you can impact EGL this way
Offline
Neither options (the one suggested by @V1del and the later one @seth suggested) made any difference, unfortunately.
Stupid question by someone like me who knows nothing about graphic programming in general and openGL in particular: why are the openGL facilities unavailable if the card does infect provide openGL 4.6? I guess I'm missing which role EGL plays in this scenario. Is it the interface the app I'm trying to use goes through to reach the openGL library?
Offline
https://en.wikipedia.org/wiki/EGL_(API)
opencpn-glutil wants EGL 1.5 but the GPU/driver does only provide EGL 1.4
This can be as silly as some function not wired in the driver, see eg. https://bbs.archlinux.org/viewtopic.php … 7#p1976227
Offline
https://en.wikipedia.org/wiki/EGL_(API)
opencpn-glutil wants EGL 1.5 but the GPU/driver does only provide EGL 1.4This can be as silly as some function not wired in the driver, see eg. https://bbs.archlinux.org/viewtopic.php … 7#p1976227
I looked at the post you linked, but I'm such a noob on these topics that I didn't quite understand it. I guess I'm not even understanding if there is any possibility to fix this mismatch between what opencpn want and what nvidia-390 provides.
Offline
There isn't really a "mismatch" - opencpn says it requires the 1.5 EGL API - this might or not be true (maybe it doesn't use the API > 1.4) but your driver doesn't implement EGL 1.5, so you cannot use that.
The CMakeLists has
set(OPENGL_LIBRARIES "GL_static" "EGL" "X11" "drm")
so you can probably select the backend, try "X11", but idk how (does it come w/ a manpage?)
Offline
There isn't really a "mismatch" - opencpn says it requires the 1.5 EGL API - this might or not be true (maybe it doesn't use the API > 1.4) but your driver doesn't implement EGL 1.5, so you cannot use that.
Sorry for the confusion---by "mismatch" I meant exactly what you said: EGL 15. wanted vs. EGL 1.4 provided.
But things are slowly getting clearer.
The CMakeLists has
set(OPENGL_LIBRARIES "GL_static" "EGL" "X11" "drm")
so you can probably select the backend, try "X11", but idk how (does it come w/ a manpage?)
I'll ask, the app comes with ta full manual, but I could not find any mention of how to switch to a different backend,
Offline
seth wrote:There isn't really a "mismatch" - opencpn says it requires the 1.5 EGL API - this might or not be true (maybe it doesn't use the API > 1.4) but your driver doesn't implement EGL 1.5, so you cannot use that.
Sorry for the confusion---by "mismatch" I meant exactly what you said: EGL 15. wanted vs. EGL 1.4 provided.
But things are slowly getting clearer.The CMakeLists has
set(OPENGL_LIBRARIES "GL_static" "EGL" "X11" "drm")
so you can probably select the backend, try "X11", but idk how (does it come w/ a manpage?)
I'll ask, the app comes with ta full manual, but I could not find any mention of how to switch to a different backend,
And the answer is negative---that option in CMakeLists only applies to arm architectures.
So it seems there is no way out of the problem and I'll have to find a different navigation software solution.
Thanks to @seth and @V1del for their help.
Offline
You can probably run it in Xephyr, but mind you: this will be on software GL - no HW acceleration.
If the tool isn't particularly heavy, that doesn't matter.
Alternatively you'd have to try your luck w/ nouveau.
If this is a recent change in opencpn, you might also be able to build and run an older version?
Offline
FWIW something else I found
__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
Offline
Update:
Thanks to seth's suggestion, I can now successfully run opencpn inside Xephyr (a tool I was totally unaware of) with what appears to be software openGL. However, when the app starts, I'm getting these error messages to console:
stefano@hippias build $ Xlib: extension "NV-GLX" missing on display ":1".
MESA: error: ZINK: vkEnumeratePhysicalDevices failed (VK_ERROR_INITIALIZATION_FAILED)
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
Xlib: extension "NV-GLX" missing on display ":1".
MESA: error: ZINK: vkEnumeratePhysicalDevices failed (VK_ERROR_INITIALIZATION_FAILED)
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
I'm guessing I'm not starting Xephyr with the right parameters/extensions? I launched it with:
Xephyr -br -ac -noreset -resizeable -screen 1920x1080 :1 &
(blindly copying the command line from the wiki, basically)
Offline
Try (w/o Xephyr)
__GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json opencpn
to steer GLX and EGL away from nvidia
Offline
Try (w/o Xephyr)
__GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json opencpn
to steer GLX and EGL away from nvidia
This works!
Would you care to explain which software layer in the launch process is actually reading those two env variables? I'd like to understand better how you came to suggest this solution (for which I'm very grateful)
Offline
As linked above, libglvnd reads these and then determines which render device to return to the application, with these two exports you're guaranteed to tell the relevant GL loader that the render device you want is the mesa -- and by extension -- the software renderer of mesa.
See https://github.com/NVIDIA/libglvnd?tab= … chitecture as well. libglvnd is a general lib that by now is used by both mesa and nvidia so you're able to switch the relevant rendering
Last edited by V1del (2024-05-10 12:07:13)
Offline