WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] fixing game error: "unable to query the OpenGL version" TCL16 x86_64  (Read 777 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
@GNUser
Have you tried to use another user like root, if the problem is with some rights.
I had not tried as root, that's a good thought. Alas, it makes no difference.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Hi Juanito. By hacking on this AppImage pretty hard and comparing how it behaves in TCL vs. Devuan, I was able to make a discovery: The AppImage depends on libGLX_mesa (in one place I think it also looks for libGLX_indirect, which is just a link to libGLX_mesa). This is where the files are located in the Debian/Devuan filesystem:

Code: [Select]
bruno@Devuan:/usr/lib/x86_64-linux-gnu$ ls -l libGLX_*
lrwxrwxrwx 1 root root     16 Mar 22  2023 libGLX_indirect.so.0 -> libGLX_mesa.so.0
lrwxrwxrwx 1 root root     20 Mar 22  2023 libGLX_mesa.so.0 -> libGLX_mesa.so.0.0.0
-rw-r--r-- 1 root root 455416 Mar 22  2023 libGLX_mesa.so.0.0.0

It's not obvious to me how to compile libGLX_mesa. Do you have time/interest in adding this to TCL16 x86_64's repo?
« Last Edit: March 31, 2025, 01:06:25 PM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
If these missing libraries find their way to repo, I'll give it another shot. If not, no biggie.

It seems games on Linux are a can of worms. I'm beginning to wish I hadn't messed with this.

Online patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 736
If you don't messing(plays) with things you stopping learning.
The best thing, how to learn things is by using "edutainment" as a guide.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Despite extensive experimentation I was not able to get precompiled games requiring 3d to work on TCL16 x86_64 with Xorg-7.7-3d.

Most such games I've tried (e.g., Endless Sky, Pioneer, Minecraft Java Edition) do not work at all on TCL16. Others (e.g., 0ad) work on TCL16 but sometimes crash. All of these games work perfectly on Devuan Daedalus.

Most if not all critical packages are at older versions on Devuan Daedalus than they are on TCL16, so extensions' age/version is most likely not the problem.

I solved my problem (well, more like worked around it) by converting the family media player into a dual-boot machine: TCL16 is the default OS, Devuan is there just for 3d games.

It seems precompiled games are making some assumptions about available libraries and/or location of libraries that are true for most distros but not true for TCL. But this is just a guess because I cannot pinpoint the problem--the error messages these games are giving are not specific enough.

IMHO TCL is already a perfect OS for general-purpose computing, routers, and a long list of other applications. It is currently not well suited for gaming but it may be just a matter of adding a small number of libraries and/or moving (or symlinking) some things.

I'm available to help with packaging and/or testing if the developers would like to fine tune TCL so that it also excels at running precompiled games. If gaming is outside TCL's target uses, that's fine too. Maybe it would be merciful to other distros to leave at least one domain where other distros can do a better job. We don't want to embarrass the competition too much :)
« Last Edit: April 03, 2025, 08:49:16 AM by GNUser »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15067
Are the games multi-lib?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Are the games multi-lib?
No. They are pure x86_64. My Devuan partition is not setup for multilib but can handle these games.

I know to stay away from multi-lib because it's unsupported on TCL and, on OSes that support it (e.g., Debian/Devuan), setting up multilib adds a lot of packages/complexity to the system.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Hi Juanito. The initial problem with these games is obvious. Endless Sky and Pioneer both need libOpenGL:

Code: [Select]
$ ./Pioneer-x86_64.AppImage
usr/bin/pioneer: error while loading shared libraries: libOpenGL.so.0: cannot open shared object file: No such file or directory

$ export FUSERMOUNT_PROG=/usr/local/bin/fusermount
$ ./Endless_Sky-v0.10.12-x86_64.AppImage
./Endless_Sky-v0.10.12-x86_64.AppImage: error while loading shared libraries: libOpenGL.so.0: cannot open shared object file: No such file or directory

This can be solved by loading libglvnd.tcz (which I recently submitted for TCL16 x86_64).

Once libglvnd is loaded, a new problem presents itself (one without an obvious solution):

Code: [Select]
$ tce-load -wi libglvnd
libglvnd is already downloaded.
libglvnd.tcz: OK
$ ./Pioneer-x86_64.AppImage
Info: ver 20250203 (586b518) on: Linux
Info: System Name: Linux
Host Name: x230
Release(Kernel) Version: 6.12.11-tinycore64
Kernel Build Timestamp: #1 SMP Sun Jan 26 16:50:13 UTC 2025
Machine Arch: x86_64
Domain Name: (none)
Info: Loaded mods:
Info: --------------------
Info: SDL Version (build) 2.0.10
Info: SDL Version (dynamic) 2.0.10
Info: SDL Versions match
Info: SDL_image Version (build): 2.0.5
Info: SDL_image Version (dynamic): 2.0.5
Info: SDL_image Versions match
Info: Assimp Version: 5.0.0
Info: FreeType Version: 2.10.1
Info: GLEW dynamic version: 2.0.0
Info: --------------------
Info:
Info: SDL video driver used: x11
Fatal: GLEW initialisation failed: Missing GL version
Both Endless Sky and Pioneer complain about missing GL version. Either I screwed up when I built libglvnd.tcz or else the libGL.tcz (or one of the other 3d libraries) is not providing the GL version.


« Last Edit: April 03, 2025, 09:49:37 AM by GNUser »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15067
Does this help:
Code: [Select]
export LD_PRELOAD=/usr/local/lib/libGLEW.so
Are you using glew or glew2?

Do you have freeglut loaded?
« Last Edit: April 03, 2025, 10:12:48 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15067
In your libglvnd extension you are duplicating files in the Xorg-7.7-3d, libGL, libGLESv2 and libEGL extensions:
Code: [Select]
/usr/local/lib/libGLX.so
/usr/local/lib/libGLX.so.0
/usr/local/lib/libOpenGL.so.0
/usr/local/lib/libOpenGL.so
/usr/local/lib/libGLESv1_CM.so
/usr/local/lib/libOpenGL.so.0.0.0
/usr/local/lib/libGLESv2.so
/usr/local/lib/libEGL.so.1.1.0
/usr/local/lib/libGLX.so.0.0.0
/usr/local/lib/libGLESv2.so.2.1.0
/usr/local/lib/libGLESv2.so.2
/usr/local/lib/libEGL.so.1
/usr/local/lib/libGLESv1_CM.so.1.2.0
/usr/local/lib/libGLESv1_CM.so.1
/usr/local/lib/libGL.so.1
/usr/local/lib/libGLdispatch.so.0
/usr/local/lib/libGLdispatch.so
/usr/local/lib/libEGL.so
/usr/local/lib/libGL.so
/usr/local/lib/libGLdispatch.so.0.0.0
/usr/local/lib/libGL.so.1.7.0

i.e. libGLESv1_CM.so, libGLESv1_CM.so.1, libGLESv2.so, libGLESv2.so.2, libEGL.so, libEGL.so.1, libGL.so, libGL.so.1

Loading libglvnd after Xorg-7.7-3d will not overwrite these symlinks, which may cause problems as the symlinks will still point to the libs in Xorg-7.7-3d, libGL, libGLESv2 and libEGL.

Conversely, if you load linglvnd before Xorg-7.7-3d, the symlinks will point to the libglvnd libs and not  Xorg-7.7-3d, libGL, libGLESv2 and libEGL, which will possibly cause issues with the x11 display.

Note the difference in lib names:
Code: [Select]
/usr/local/lib/libEGL.so.1.1.0
/usr/local/lib/libGLESv2.so.2.1.0
/usr/local/lib/libGLESv1_CM.so.1.2.0
/usr/local/lib/libGL.so.1.7.0

vs
Code: [Select]
/usr/local/lib/libEGL.so.1.0.0
/usr/local/lib/libGLESv2.so.2.0.0
/usr/local/lib/libGLESv1_CM.so.1.1.0
/usr/local/lib/libGL.so.1.2.0

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Hi Juanito. Your suggestions led me to the solution :)

glew, glew2, and freeglut were not loaded but do not seem to be needed.
Code: [Select]
$ tce-status -i | grep glew
$ tce-status -i | grep freeglut
$ tce-status -i | grep GL
libEGL
libGL
libGLESv2

The secret for these games to work are these two commands:
Code: [Select]
$ tce-load -wi libglvnd
$ export LD_PRELOAD=/usr/local/lib/libGL.so
Now Endless Sky, Pioneer, and Minecraft Java Edition are all working :) Gosh, I'm so happy I'll be able to ditch the dual-boot situation and do everything in TCL!

Do you think it's a fair assumption that the root cause here is that one or more binaries in these precompiled games is/are looking for libGL.so in the wrong place?

P.S. 0ad continues to crash but seems to be an issue unrelated to what we were trying to solve in this thread. The thread may be marked as Solved.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Hi Juanito. Let me do some experiments and see whether a more minimal version of libglvnd is sufficient. I'll report back in a few minutes.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15067
Do you think it's a fair assumption that the root cause here is that one or more binaries in these precompiled games is/are looking for libGL.so in the wrong place?

It's possible it was looking in something like /usr/lib/x86_64-linux-gnu/ or similar

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Do you think it's a fair assumption that the root cause here is that one or more binaries in these precompiled games is/are looking for libGL.so in the wrong place?
It's possible it was looking in something like /usr/lib/x86_64-linux-gnu/ or similar
Gosh, and to think a simple LD_PRELOAD was the answer. I would not have figured this one out without your help. Thanks a lot.

Regarding libglvnd, a trimmed-down extension that provides only the libraries not provided elsewhere (i.e., libGLdispatch, libGLX, libOpenGL) is sufficient. I'll send you a PM with new libglvnd.tcz submission.

Please trim libglvnd-dev.tcz as you think best. I'm not sure I could trim it myself and get it right.