fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#1 Post by Ophiuchus »

on my fedora 34 after updating to current master I get at start:

Code: Select all

[100%] Built target freeorion
Unable to load OpenGL entry points.

GLEW reported:
Unknown error
doing a fresh build directory via cmake had the same result. there are no log file written yet. the corresponding snap starts fine on the same machine.

in the commits all the changed files since the last known good build seem completely unrelated (except maybe the changes in GG/GG/Exception.h)

Code: Select all

git diff 3abfde43c65a6fb839849ccbf5bb31dd28ebc6c7..origin/master  --name-only 
.github/fedora-32/Dockerfile
.github/workflows/build-docker.yml
GG/GG/Exception.h
default/python/AI/AIDependencies.py
default/python/AI/CombatRatingsAI/__init__.py
default/python/AI/CombatRatingsAI/_ratings.py
default/python/AI/EspionageAI.py
default/python/AI/InvasionAI.py
default/python/AI/PolicyAI.py
default/python/AI/ProductionAI.py
default/python/AI/ShipDesignAI.py
default/python/AI/colonization/calculate_planet_colonization_rating.py
default/python/AI/colonization/calculate_population.py
default/python/AI/colonization/rate_influence.py
default/python/AI/freeorion_tools/__init__.py
default/python/AI/freeorion_tools/_freeorion_tools.py
default/scripting/ship_hulls/monster/SH_FLOATER.focs.txt
default/scripting/ship_hulls/monster/SH_JUGGERNAUT_1_BODY.focs.txt
default/scripting/ship_hulls/monster/SH_JUGGERNAUT_2_BODY.focs.txt
default/scripting/ship_hulls/monster/SH_KRAKEN_1_BODY.focs.txt
default/scripting/ship_hulls/monster/SH_KRAKEN_2_BODY.focs.txt
default/scripting/ship_hulls/monster/SH_KRILL_1_BODY.focs.txt
default/scripting/ship_hulls/monster/SH_SNOWFLAKE_1_BODY.focs.txt
default/scripting/ship_hulls/monster/SH_SNOWFLAKE_2_BODY.focs.txt
default/scripting/ship_parts/General/SP_ASH.focs.txt
default/scripting/ship_parts/General/SP_CLOUD.focs.txt
default/scripting/ship_parts/General/SP_DIM.focs.txt
default/stringtables/fr.txt
universe/Effects.cpp
util/VarText.cpp
there was also a normal system update, so it might be something on fedora side changed. trying to bisect.

edit1: note this is related to wayland. i got the error in a gnome wayland session, but no error in a gnome X11 session.

edit2: yes, it seems something with the system changed, the old "good" version has the same problem. not sure how to proceed
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#2 Post by Ophiuchus »

seems fedora has a way to rollback the upgrade i think is responsible (there are SDL, gcc, stdc changes). But one needs to have cached the necessary old packages (which i do not; note to self and others: configure keepcache in /etc/dnf/dnf.conf or make a dnf local plugin setup).

Code: Select all

    Upgrade       SDL2-2.0.22-2.fc34.x86_64                                 @updates
    Upgraded      SDL2-2.0.20-1.fc34.x86_64                                 @@System
    Upgrade       SDL2-devel-2.0.22-2.fc34.x86_64                           @updates
    Upgraded      SDL2-devel-2.0.20-1.fc34.x86_64                           @@System
    Upgrade       SDL2-static-2.0.22-2.fc34.x86_64                          @updates
    Upgraded      SDL2-static-2.0.20-1.fc34.x86_64                          @@System
Anybody knows if there is any mirror which has the old versions?

i also read such glew initialisation errors could come from getting confused with static/dynamic libraries, so maybe i will try that if nothing better comes up. Anybody knows which ones we need/how to set build parameters?

also not sure i should really put much effort into fixing this on fedora 34 as fedora 36 is released.

Also o01eg did some work recently on creating a fedora34 docker build on github.. is this related?
Last edited by Ophiuchus on Wed May 18, 2022 7:31 am, edited 1 time in total.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#3 Post by o01eg »

Ophiuchus wrote: Wed May 18, 2022 7:12 am Also o01eg did some work recently on creating a fedora34 docker build on github.. is this related?
No, I just added test build for fedora:32, nothing other was changed.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#4 Post by adrian_broher »

My guess on this that it is related to GLEWs inability to load the entrypoints with the right function depending on the backend display server used: https://github.com/nigels-com/glew/issues/172 and https://github.com/nigels-com/glew/issues/328
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#5 Post by Geoff the Medio »

Can you build and use the latest master of GLEW from GitHub? Looks like some recent commits might have some relevant changes, though I'm not sure if the issue is fixed.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#6 Post by Ophiuchus »

adrian_broher wrote: Wed May 18, 2022 7:35 am My guess on this that it is related to GLEWs inability to load the entrypoints with the right function depending on the backend display server used: https://github.com/nigels-com/glew/issues/172 and https://github.com/nigels-com/glew/issues/328
probably you are right. i need freeorion only to run on wayland; but could not find a way yet to force this.
i cant remove the X libraries completely yet as i still need X11 as a backup on that machine (i guess at least/not sure) - probably i dont need opengl in X11.

(part of) GL related libraries on the system

Code: Select all

lrwxrwxrwx. 1 root root 15  1. Mai 2021  /usr/lib64/libEGL.so -> libEGL.so.1.1.0
lrwxrwxrwx. 1 root root 22  1. Mai 2021  /usr/lib64/libGLdispatch.so -> libGLdispatch.so.0.0.0
lrwxrwxrwx. 1 root root 21  1. Mai 2021  /usr/lib64/libGLESv1_CM.so -> libGLESv1_CM.so.1.2.0
lrwxrwxrwx. 1 root root 18  1. Mai 2021  /usr/lib64/libGLESv2.so -> libGLESv2.so.2.1.0
lrwxrwxrwx. 1 root root 16 26. Jan 2021  /usr/lib64/libGLEW.so -> libGLEW.so.2.1.0
lrwxrwxrwx. 1 root root 14  1. Mai 2021  /usr/lib64/libGL.so -> libGL.so.1.7.0
lrwxrwxrwx. 1 root root 15 30. Jan 2021  /usr/lib64/libGLU.so -> libGLU.so.1.3.1
lrwxrwxrwx. 1 root root 15  1. Mai 2021  /usr/lib64/libGLX.so -> libGLX.so.0.0.0
lrwxrwxrwx. 1 root root 18  1. Mai 2021  /usr/lib64/libOpenGL.so -> libOpenGL.so.0.0.0
lrwxrwxrwx. 1 root root     20 12. Okt 2021  /usr/lib64/libEGL_mesa.so.0 -> libEGL_mesa.so.0.0.
cmake configuration

Code: Select all

$ grep OPENGL CMakeCache.txt 
OPENGL_EGL_INCLUDE_DIR:PATH=/usr/include
OPENGL_GLX_INCLUDE_DIR:PATH=/usr/include
OPENGL_INCLUDE_DIR:PATH=/usr/include
OPENGL_egl_LIBRARY:FILEPATH=/usr/lib64/libEGL.so
OPENGL_glu_LIBRARY:FILEPATH=/usr/lib64/libGLU.so
OPENGL_glx_LIBRARY:FILEPATH=/usr/lib64/libGLX.so
OPENGL_opengl_LIBRARY:FILEPATH=/usr/lib64/libOpenGL.so
OPENGL_xmesa_INCLUDE_DIR:PATH=OPENGL_xmesa_INCLUDE_DIR-NOTFOUND
//ADVANCED property for variable: OPENGL_EGL_INCLUDE_DIR
OPENGL_EGL_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENGL_GLX_INCLUDE_DIR
OPENGL_GLX_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENGL_INCLUDE_DIR
OPENGL_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENGL_egl_LIBRARY
OPENGL_egl_LIBRARY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENGL_glu_LIBRARY
OPENGL_glu_LIBRARY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENGL_glx_LIBRARY
OPENGL_glx_LIBRARY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENGL_opengl_LIBRARY
OPENGL_opengl_LIBRARY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: OPENGL_xmesa_INCLUDE_DIR
OPENGL_xmesa_INCLUDE_DIR-ADVANCED:INTERNAL=1
hm really not sure what is necessary here.

also if i remember correctly, freeorion communicated using X on wayland, so probably GG is using GLX and not EGL?
Geoff the Medio wrote: Wed May 18, 2022 8:42 am Can you build and use the latest master of GLEW from GitHub? Looks like some recent commits might have some relevant changes, though I'm not sure if the issue is fixed.
will try, but i think i can/need to tell the glew build which libraries to actually use. and which ones are the right ones?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#7 Post by Geoff the Medio »

I assume it needs to be a load time selection, not build-time.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#8 Post by Ophiuchus »

Geoff the Medio wrote: Wed May 18, 2022 9:25 am I assume it needs to be a load time selection, not build-time.
yes. it is possible also that load time selection is influenced by build-time(?). the glew cmake seems to have flags for such.

but is the theory valid that freeorion is not able to use EGL ?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#9 Post by Geoff the Medio »

I don't understand the question, so can't comment usefully on its answer.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#10 Post by Ophiuchus »

I upgraded to fedora 36, (and pulled the master) but the problem did not change.

then i found some other hint https://stackoverflow.com/questions/458 ... s-not-work

somebody claimed that glew always throws an exception after glewInit - i thought: well.. before it did not and maybe you are talking about an older version of glew, but lets try.

And actually the game runs fine on wayland if i simply skip that error in code.

And even more interesting, it seems to run natively on wayland now (i usually check using xev or xeyes if an application leaks its data via X).

Not sure how to proceed - should I make a PR?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#11 Post by Geoff the Medio »

If calling glGetError() after glewInit gets it working, then sure. You could add a loop to clear any GL errors after the init call:

Code: Select all

    GLenum glew_status = glewInit();

    // clear any GL errors after glewInit, as it tends to cause some that can be ignored
    GLenum gl_err = GL_INVALID_ENUM;
    while (gl_err != GL_NO_ERROR)
        gl_err = glGetError();

louh
Space Krill
Posts: 3
Joined: Mon Jun 06, 2022 2:02 am

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#12 Post by louh »

For what it's worth, I managed to get past this problem by rebuilding libGLEW with SYSTEM=linux-egl-glvnd. I posted to the support forum before stumbling across this thread. Apologies. (build environment: Fedora 36 / Wayland / EGL / OpenGL / libglvnd).

hifron
Krill Swarm
Posts: 11
Joined: Sun Jul 03, 2022 8:35 pm

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#13 Post by hifron »

When compiling on Linux with cmake, there is warning that OpenGL needs some new policy from some new version of cmake to use new entry OpenGL points, but not sure if it helps... (already fixed on FO master, but probably is not solution to this problem)

GLEW commit from 13.june on GLEW master may fixed this problem?

And what says glewinfo command?

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#14 Post by Ophiuchus »

hifron wrote: Sun Jul 10, 2022 8:53 am GLEW commit from 13.june on GLEW master may fixed this problem?
hm does not help with the libraries which come with fedora 34/36
hifron wrote: Sun Jul 10, 2022 8:53 am And what says glewinfo command?
i attach the output
Attachments
GLEWError_glewinfo.txt
(193.7 KiB) Downloaded 113 times
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: fedora 34, sudden "Unable to load OpenGL entry points." crash (WAYLAND only)

#15 Post by Ophiuchus »

Still not working on fedora 37 - glew-2.2.0
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Post Reply