You are not logged in.

#1 2024-05-08 09:16:53

stefano
Member
Registered: 2011-04-09
Posts: 265

nvidia 390xx opengl issues [SOLVED]

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

#2 2024-05-08 11:01:08

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,892

Re: nvidia 390xx opengl issues [SOLVED]

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

#3 2024-05-08 13:13:38

seth
Member
Registered: 2012-09-03
Posts: 52,282

Re: nvidia 390xx opengl issues [SOLVED]

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 hmm

Offline

#4 2024-05-08 13:27:20

stefano
Member
Registered: 2011-04-09
Posts: 265

Re: nvidia 390xx opengl issues [SOLVED]

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

#5 2024-05-08 13:54:52

seth
Member
Registered: 2012-09-03
Posts: 52,282

Re: nvidia 390xx opengl issues [SOLVED]

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

#6 2024-05-08 14:06:45

stefano
Member
Registered: 2011-04-09
Posts: 265

Re: nvidia 390xx opengl issues [SOLVED]

seth wrote:

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

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

#7 2024-05-08 14:22:56

seth
Member
Registered: 2012-09-03
Posts: 52,282

Re: nvidia 390xx opengl issues [SOLVED]

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

#8 2024-05-08 14:38:03

stefano
Member
Registered: 2011-04-09
Posts: 265

Re: nvidia 390xx opengl issues [SOLVED]

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,

Offline

#9 2024-05-08 14:55:26

stefano
Member
Registered: 2011-04-09
Posts: 265

Re: nvidia 390xx opengl issues [SOLVED]

stefano wrote:
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

#10 2024-05-08 15:33:05

seth
Member
Registered: 2012-09-03
Posts: 52,282

Re: nvidia 390xx opengl issues [SOLVED]

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

#11 2024-05-08 15:47:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,892

Re: nvidia 390xx opengl issues [SOLVED]

FWIW something else I found

__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json

https://github.com/NVIDIA/libglvnd/blob … eration.md

Offline

#12 2024-05-09 10:22:40

stefano
Member
Registered: 2011-04-09
Posts: 265

Re: nvidia 390xx opengl issues [SOLVED]

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

#13 2024-05-09 12:31:45

seth
Member
Registered: 2012-09-03
Posts: 52,282

Re: nvidia 390xx opengl issues [SOLVED]

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

#14 2024-05-10 09:14:54

stefano
Member
Registered: 2011-04-09
Posts: 265

Re: nvidia 390xx opengl issues [SOLVED]

seth wrote:

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

#15 2024-05-10 11:13:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,892

Re: nvidia 390xx opengl issues [SOLVED]

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

Board footer

Powered by FluxBB