WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
TCL16beta1 x86_64 with full Xorg (Xorg-7.7-3d.tcz) powers the laptop that serves as my family media player/entertainment center.

My sons would love to play this game on the entertainment center, but no luck:

Code: [Select]
$ 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

If I grab the missing library from Debian, the game errors out due to missing libGLdispatch.so.0 (provided by libglvnd0.deb). If I also grab that missing library, then the game does not complain about any missing libraries but fails silently.

I hope it's not naive to think that the game might work if libOpenGL.so.0 and libGLdispatch.so.0 are provided by proper TCL extensions.

« Last Edit: April 03, 2025, 11:52:27 AM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12010
help fixing game error: "unable to query the OpenGL version" TCL16 x86_64
« Reply #1 on: March 30, 2025, 08:41:33 PM »
Hi GNUser
Seems you are not the only person to run into this:
https://github.com/endless-sky/endless-sky/issues/8137
« Last Edit: March 31, 2025, 12:07:14 AM by Rich »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
help fixing game error: "unable to query the OpenGL version" TCL16 x86_64
« Reply #2 on: March 30, 2025, 10:13:57 PM »
Hi Rich. I discovered that both libraries are compiled from the same source tarball--this one: https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v1.7.0/libglvnd-v1.7.0.tar.gz

I will submit libglvnd.tcz and libglvnd-dev.tcz for the TCL16 x86_64 repo.
« Last Edit: March 31, 2025, 12:07:28 AM by Rich »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
help fixing game error: "unable to query the OpenGL version" TCL16 x86_64
« Reply #3 on: March 30, 2025, 11:28:26 PM »
I submitted those extensions. With libglvnd.tcz loaded I'm getting warmer but still not joy:

Code: [Select]
$ export FUSERMOUNT_PROG=/usr/local/bin/fusermount
$ ./Endless_Sky-v0.10.12-x86_64.AppImage
Unable to query the OpenGL version!

I can't figure this out. Xorg-7.7-3d is loaded so I should have 3d/OpenGL support, right? Any ideas where to go from here?

P.S. It's not a hardware issue because this same game runs on this same laptop with Devuan Daedalus. In Devuan there is no "Unable to query the OpenGL version" error. Running Devuan on this machine is only feasible for testing purposes.
« Last Edit: March 31, 2025, 12:07:45 AM by Rich »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
help fixing game error: "unable to query the OpenGL version" TCL16 x86_64
« Reply #4 on: March 30, 2025, 11:42:57 PM »
Here's the end of an strace in case it helps:

Code: [Select]
$ strace -e trace=file ./Endless_Sky-v0.10.12-x86_64.AppImage
...
openat(AT_FDCWD, "/proc/meminfo", O_RDONLY) = 11
openat(AT_FDCWD, "/usr/local/share/drirc.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 11
openat(AT_FDCWD, "/usr/local/share/drirc.d/00-mesa-defaults.conf", O_RDONLY) = 11
openat(AT_FDCWD, "/usr/local/share/drirc.d/00-radv-defaults.conf", O_RDONLY) = 11
openat(AT_FDCWD, "/usr/local/etc/drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/bruno/.drirc", O_RDONLY) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/bruno", {st_mode=S_IFDIR|S_ISGID|0755, st_size=660, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/bruno/.cache", {st_mode=S_IFDIR|S_ISGID|0700, st_size=100, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/bruno/.cache", {st_mode=S_IFDIR|S_ISGID|0700, st_size=100, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/bruno/.cache/mesa_shader_cache", {st_mode=S_IFDIR|S_ISGID|0700, st_size=3100, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/bruno/.cache/mesa_shader_cache/marker", {st_mode=S_IFREG|0644, st_size=0, ...}, 0) = 0
openat(AT_FDCWD, "/home/bruno/.cache/mesa_shader_cache/index", O_RDWR|O_CREAT|O_CLOEXEC, 0644) = 12
syscall_435(0x7fffd6c69ad0, 0x58, 0x7f45075ee106, 0x8, 0x7f44fe5716c0, 0x7fffd6c69bc7) = 0x3d81
newfstatat(AT_FDCWD, "/proc/sys/dev/i915/perf_stream_paranoid", {st_mode=S_IFREG|0644, st_size=0, ...}, 0) = 0
openat(AT_FDCWD, "/proc/sys/dev/i915/perf_stream_paranoid", O_RDONLY) = 12
syscall_435(0x7fffd6c6a600, 0x58, 0x7f45075ee106, 0x8, 0x7f44fdd706c0, 0x7fffd6c6a6f7) = 0x3d82
syscall_435(0x7fffd6c6a5a0, 0x58, 0x7f45075ee106, 0x8, 0x7f44fdd706c0, 0x7fffd6c6a697) = 0x3d83
Unable to query the OpenGL version!
openat(AT_FDCWD, "/home/bruno/.local/share/endless-sky/errors.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4

Code: [Select]
$ cat /home/bruno/.local/share/endless-sky/errors.txt
Unable to query the OpenGL version!

P.S. Rich, this thread has morphed from an extension request (no longer needed because I already created and submitted the extension) to a help request (help fixing game error: "unable to query the OpenGL version"). Kindly change the thread title and move thread to a more appropriate category.



« Last Edit: March 31, 2025, 12:07:57 AM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15066
Do you get something analogous to this:
Code: [Select]
glxinfo | grep -i opengl
OpenGL vendor string: Broadcom
OpenGL renderer string: VC4 V3D 2.1
OpenGL version string: 2.1 Mesa 24.2.5
OpenGL shading language version string: 1.20
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 24.2.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Hi Juanito. glxinfo is present neither on my system nor in the repo:
Code: [Select]
$ glxinfo
sh: glxinfo: not found
$ provides.sh glxinfo
$
Let me do some hacking and try to get this information.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Code: [Select]
$ ./glxinfo | grep -i opengl
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 4000 (IVB GT2)
OpenGL core profile version string: 4.2 (Core Profile) Mesa 24.1.7
OpenGL core profile shading language version string: 4.20
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.2 (Compatibility Profile) Mesa 24.1.7
OpenGL shading language version string: 4.20
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 24.1.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:
I guess this suggests my system is setup correctly? Maybe my system is just missing the utility or text file that the game uses to determine the OpenGL version? The game is free software so I'll take a look at the source code to see if there are any clues there.
« Last Edit: March 31, 2025, 09:28:33 AM by GNUser »

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Hi Juanito. Game's source code has this in GameWindow.cpp:
Code: [Select]
// Check that the OpenGL version is high enough.
const char *glVersion = reinterpret_cast<const char *>(glGetString(GL_VERSION));
if(!glVersion || !*glVersion)
{
ExitWithError("Unable to query the OpenGL version!");
return false;
}
libGL-dev.tcz has /usr/local/include/GL/gl.h with this function prototype:
Code: [Select]
GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
It seems the game is going through proper channels to get the OpenGL version. I see that libGL.tcz is very new, so that excludes the GL version being too old.

I'm running out of ideas. I'll post the output of glxinfo | grep -i opengl when running Devuan on this same machine (game works fine) to see if there are any clues there.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Here's the output from Devuan running on this same laptop, where game has no issue even though the Mesa version is older (22.3.6 vs. TCL16's 24.1.7):
Code: [Select]
Devuan$ glxinfo | grep -i opengl
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) HD Graphics 4000 (IVB GT2)
OpenGL core profile version string: 4.2 (Core Profile) Mesa 22.3.6
OpenGL core profile shading language version string: 4.20
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.2 (Compatibility Profile) Mesa 22.3.6
OpenGL shading language version string: 4.20
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 22.3.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:
Any ideas why the game cannot query the OpenGL version when running in TCL16 x86_64?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15066
You could try strace again to find where it’s looking for gl.h and what it reports?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
I think it would only look for gl.h at compile time. The error I'm encountering happens at runtime when I try running the AppImage provided by the developers.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
Just an aside: My kids also like playing Minecraft (Java version). It works on Devuan but spits out similar errors on TCL. I'm hopeful that if we can fix this issue for Endless Sky, it will address similar problems in other games.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1599
You could try strace again to find where it’s looking for gl.h and what it reports?

Code: [Select]
$ export FUSERMOUNT_PROG=/usr/local/bin/fusermount
$ strace ./Endless_Sky-v0.10.12-x86_64.AppImage >strace.txt 2>&1

Hi Juanito. Here's a full strace in case it helps:

https://gnuser.ddns.net/public/strace.txt

I'm highly motivated to solve this. I'll be happy to provide whatever information you think may be helpful.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 736
When using strace it's default behavior is not to follow forks, so if the program forks you have trace for only the main process.

So if you add option -f it will follow the fork.
Code: [Select]
strace -f ./Endless_Sky-v0.10.12-x86_64.AppImage >strace.txt 2>&1
@GNUser
Have you tried to use another user like root, if the problem is with some rights.
« Last Edit: March 31, 2025, 11:13:21 AM by patrikg »