Page 1 of 1

OpenGL Issue

Posted: Sat Dec 21, 2024 6:22 am
by subutaka
Hi guys, awesome work you have here.

First will give some background, I compiled my binary for Debian Bookworm using the instructions and all went alright.
But when I tried to run it this message poped up:
Error: Unable to create OpenGL context: Could not create GL context: GLXBadFBConfig
So I googled it and a possible solution for other kind of software was to force the MESA version to 4.5 so I did it with the environmental variable:
export MESA_GL_VERSION_OVERRIDE=4.5


Then when it runs half crashes, a small black window with sound works but it cannot draw anything:
GPU info: 4.5 (Core Profile) Mesa 22.3.6 (core profile)

0:3(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, and 1.00 ES

0:3(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, and 1.00 ES

error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
Error: Vertex shader failed to compile. Your OpenGL driver said:
0:3(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, and 1.00 ES
Error: Fragment shader failed to compile. Your OpenGL driver said:
0:3(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, and 1.00 ES

Error: Failed to link shader objects. Your OpenGL driver said:
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
My original glxinfo output is the following:
OpenGL version string: 2.1 Mesa 22.3.6
after the export it says:
OpenGL version string: 4.5 (Compatibility Profile) Mesa 22.3.6
Should I recompile tinkering the source so it uses the right version of my driver? The weirdest thing is that the win version with wine runs almost smoothly. So... I am kind of lost.

Thanks in advance.

Re: OpenGL Issue

Posted: Sat Dec 21, 2024 7:10 am
by Bart
Ah, Linux. The gift that keeps on giving.

Try also exporting: MESA_GLSL_VERSION_OVERRIDE=450

It sounds like, for whatever reason, the Mesa drivers were providing an OpenGL 2.1 interface but that's not sufficient. If you run Supermodel with -legacy3d, it will likely work as is, but you don't want to use the legacy engine, which is a decade out of date.

Also, you should probably make sure that you have appropriate graphics drivers installed for your actual GPU.

Re: OpenGL Issue

Posted: Sat Dec 21, 2024 2:35 pm
by subutaka
Hi Bart, thanks for the super fast reply.

GNU/Linux geek here but not as knowledgeable as I would like to be.

Tried your solution and worked only using the legacy engine. When the emulator is run without the legacy option it shows:
Error: Unable to create OpenGL context: Could not create GL context: GLXBadFBConfig
same as before. The variables have the values:

Code: Select all

  echo $MESA_GLSL_VERSION_OVERRIDE
450 

Code: Select all

 echo $MESA_GL_VERSION_OVERRIDE
2.1
Regarding the GPU module, I chehcked and it should be the right one, taking into account that it is a very old computer and has only on-chip GPU:

Code: Select all

 lspci -k | grep -EA3 'VGA|3D|Display'
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)
        Subsystem: Lenovo Core Processor Integrated Graphics Controller
        Kernel driver in use: i915
        Kernel modules: i915
 
Maybe this sheds a bit more of light and we can make it work with the right engine.
Thanks again, have a good one.

Fede

Re: OpenGL Issue

Posted: Sat Dec 21, 2024 6:52 pm
by Bart
I'm not really sure but I know this problem has come up before. Sadly the archived forum is not searchable. Have you tried debugging with Claude or ChatGPT? This is not an uncommon issue.

I think what's happening is that by default, Mesa is creating an OpenGL 2.1 context. How old is your GPU?

Re: OpenGL Issue

Posted: Sat Dec 21, 2024 7:15 pm
by subutaka
Have not tried any IA model yet but was about to do so.
Is super old, it's a Intel(R) Core(TM) i5 CPU M 460 @ 2.53GHz, with integrated Intel HD Graphics, first generation from 2010, sadly it's all I got, I even process raw professional astronomy data with it. Will try to figure out how to stop or manage this OpenGL 2.1 context created by Mesa. I will keep in touch if some of you come up with a solution or will bring the one from ChatGPT.

Re: OpenGL Issue

Posted: Sat Dec 21, 2024 8:23 pm
by Ian
Try a much older version of supermodel, it should still work
I think the issue is you gpu doesn't support opengl 4.3

Re: OpenGL Issue

Posted: Sat Dec 21, 2024 8:43 pm
by Bart
Your GPU is older than Supermodel's first public release, which was April 2011 :) Unfortunately, I think you are stuck with either using the legacy engine or trying to use a version of Supermodel's new engine from several years ago.

The legacy engine is certainly far less accurate than the new engine but if you just want to play Daytona, Scud Race, Lost World, Star Wars, and the fighting games, it's not bad. Usually you won't know what you're missing if you're not obsessively comparing to actual hardware.

Re: OpenGL Issue

Posted: Mon Dec 23, 2024 11:56 am
by subutaka
Well, after a few minutes troubleshooting with ChatGPT, as Ian said, it seems the problem is my hardware and it doesn't support it, supermodel needs 3.2 and my GPU goes up to 2.1, correct me if I'm wrong please.
It suggested to "emulate" it using:

Code: Select all

LIBGL_ALWAYS_SOFTWARE=1 MESA_GL_VERSION_OVERRIDE=3.2 MESA_GLSL_VERSION_OVERRIDE=150 supermodel ../vs2.zip
but it didn't work, kept throwing the initial error of GLXBadFBConfig.
Also suggested that Mesa is using DRI3 (Direct Rendering Infrastructure 3) by default which might be incompatible with supermodel, but forcing it to DRI2 didn't work either. Also forcing to use iris driver runs but super slow, and memory and CPU intensive, my laptop was hot as a pan.

Keeps being weird that the windows version works, kind of slow sometimes but it does right out of the box. so, it seems the way to go is using wine version which is a bummer but at least can enjoy the emulator

Maybe this thread can be close, it is your call; of course I am open to more human suggestions.

Re: OpenGL Issue

Posted: Mon Dec 23, 2024 10:17 pm
by Bart
I guess the proprietary closed-source Windows drivers are able to achieve GL 4.3 compatibility by emulating features not directly implemented in hardware. IIRC, Mesa drivers are open source, and if the GPU wasn't designed for GL 4.3, presumably those open source drivers implement only what they readily can?