"Couldn't find matching GLX visual"
#1
Hey guys, anyone know how to solve this?
Not sure if it's a problem with Rebirth or my config... when I try to start the game from the console I get this:

Error: Could not set 640x480x32 opengl video mode: Couldn't find matching GLX visual

Using -16bpp gives me the same error:

Error: Could not set 640x480x16 opengl video mode: Couldn't find matching GLX visual

I'm running Linux Mint 13 with 0.58.1 installed from the deb packages. I can provide more info if needed but don't know where to start looking for settings that might be relevant.

My gfx chip is Intel 945GM and according to hardinfo my OpenGL driver is "Tungsten Graphics, Inc. Mesa DRI 945GM / version 1.4 Mesa 8.0.4"

The windows exe runs fine under WINE but that seems unnecessarily clunky when there's a native Linux version available.
Reply
#2
(10-11-2014, 11:10 PM)TheObserver link Wrote:Hey guys, anyone know how to solve this?
Not sure if it's a problem with Rebirth or my config... when I try to start the game from the console I get this:

Error: Could not set 640x480x32 opengl video mode: Couldn't find matching GLX visual

Can you specify "console"? Do you mean the real virtual terminals you reach via the ALT-F*-Keys? Or just some terminal emulator (like "Konsole" for KDE). The latter ones should work. Running the game directly on a virtual terminal will not. At least not the OpenGL version. You can built the software rasterizer version (well I think you can, but I haven't done so in a long time), which should run there.

For OpenGL, the X server is a requirement. At least currently. So you need to have an X Server running and a correctly set DISPLAY variable so that the game can reach it. This is automatically the case when you star some terminal emulator under x.

If you already try this on X but get this error, try the following command:
Code:
glxinfo | grep OpenGL
It should print something like this:
Code:
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 660 Ti/PCIe/SSE2
OpenGL version string: 4.4.0 NVIDIA 331.17
OpenGL shading language version string: 4.40 NVIDIA via Cg compiler
just with some MESA and Intel codes and a much lower OpenGL version. If you don't get something like that on the same console you try to start the game, there is something wrong with either your GL setup / X server configuration or with the connection to the X server on the console you are trying this, and the game can't work.


"Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint Exupéry
Reply
#3
Yeah I meant starting it from a terminal window from the KDE desktop. There should be an X server running, I have other openGL apps that work fine and I've never seen this error before. (I launch things from the command line like that all the time so I can see the stdout.)

Here's what I get from glxinfo:

OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel® 945GM
OpenGL version string: 1.4 Mesa 8.0.4
OpenGL extensions:

^^ so, same as above.
Reply
#4
Hmm, that is interesting. I have a netbook with that very same GPU, and the last time I checked, rebirth did run on it. I've no idea why SDL does not find the visual. I'll test the current version on that system again.

Maybe SDL has some problems switching the video mode. You could try starting it with the -window switch.
"Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint Exupéry
Reply
#5
Okay, not sure what's going on. Command line params don't even seem to work? I set -16bpp in d2x.ini and that seemed to do *something*...

Code:
$ d2x-rebirth -window

Type /usr/local/games/d2x-rebirth/d2x-rebirth -help' for a list of command-line options.

D2X-Rebirth v0.57.3  Vertigo Enhanced  May 13 2012 10:08:40
This is a MODIFIED version of Descent 2, based on Full Version v1.2.
Copyright (C) 1994-1996 Parallax Software Corporation
DESCENT is a trademark of Interplay Productions, Inc.
Copyright (C) 1999 Peter Hawkins, 2002 Bradley Bell, 2005-2011 Christian Beckhaeuser

Using SDL_mixer library
sdl-joystick: found 0 joysticks

Error: Could not set 640x480x16 opengl video mode: Couldn't find matching GLX visual

^^ At this point I set -window in d2x.ini and tried again - still the same problem. Also:

Code:
$ d2x-rebirth -help

Type /usr/local/games/d2x-rebirth/d2x-rebirth -help' for a list of command-line options.

D2X-Rebirth v0.57.3  Vertigo Enhanced  May 13 2012 10:08:40
This is a MODIFIED version of Descent 2, based on Full Version v1.2.
Copyright (C) 1994-1996 Parallax Software Corporation
DESCENT is a trademark of Interplay Productions, Inc.
Copyright (C) 1999 Peter Hawkins, 2002 Bradley Bell, 2005-2011 Christian Beckhaeuser

Using SDL_mixer library
sdl-joystick: found 0 joysticks

Error: Could not set 640x480x16 opengl video mode: Couldn't find matching GLX visual

???
Reply
#6
Okay, I have *no idea* if this is related or not, but I didn't want to start a new thread. I *just noticed* that somehow I only had version 0.57.3 installed above. So I tried to compile my own binaries (pulled the unification dir from Github) and got this error:

Code:
Compiling d1x-rebirth . d1x-rebirth/main/bmread.cpp
In file included from common/main/wall.h:30:0,
                 from d1x-rebirth/main/bmread.cpp:42:
common/main/segment.h: In constructor ‘vertex::vertex(const fix&, const fix&, const fix&)’:
common/main/segment.h:311:21: error: no matching function for call to ‘vms_vector::vms_vector(<brace-enclosed initializer list>)’
common/main/segment.h:311:21: note: candidates are:
common/include/vecmat.h:36:8: note: vms_vector::vms_vector()
common/include/vecmat.h:36:8: note:   candidate expects 0 arguments, 3 provided
common/include/vecmat.h:36:8: note: constexpr vms_vector::vms_vector(const vms_vector&)
common/include/vecmat.h:36:8: note:   candidate expects 1 argument, 3 provided
common/include/vecmat.h:36:8: note: constexpr vms_vector::vms_vector(vms_vector&&)
common/include/vecmat.h:36:8: note:   candidate expects 1 argument, 3 provided
scons: *** [d1x-rebirth/main/bmread.o] Error 1
scons: building terminated because of errors.

It looks like I have something not installed? I should have everything - libsdl (both 1.2 and 2.0 including x64 & i386, -dev and -dbg), PhysFS 2.03 (just built & installed from src with no errors), libglu1-mesa (including i386 and -dev), NASM, and sdl_mixer. What is supposed to provide vms_vector?
Reply
#7
The source code you try to built here is not the one for the current 0.58.1 release, but the "unification" branch on github.

The error messages you get are not missing packages, but either a problem with the source code itself, or your compiler being to old. I remember kp added some C11-isms to the code, so you will need a fairly recent gcc to built it, but I forgot which version you exactly will need. If that is actually the issue, I think we should add a compiler version check to the SConstruct file.

For now, I think you should try to build the offical 0.58.1 source tarballs you can find on the download page.
"Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint Exupéry
Reply
#8
Okay, I compiled 0.58.1 successfully with no errors. For the record:

$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

This is the compiler that installs with still-officially-supported Ubuntu 12.04 derivatives - it's not bleeding-edge but it's new enough...

(I *really hope* the newer developments of dxx don't get pushed into incompatibility with "slightly old" systems for no good reason! I don't want to be locked out of everything fun because I don't constantly upgrade.  Sad )

Anyway, besides that, my freshly built 0.58.1 d2x-rebirth executable still gives me the "Couldn't find matching GLX visual" error. I've tried reinstalling/updating xserver-xorg as described here and here but that didn't change anything.

Worth reiterating that other OGL stuff seems to work fine, I am *only* having this problem with D2X so far...
Reply
#9
Well, I made a software render build of 0.58.1 using the code changes listed here, which works fine for a few minutes, then crashes with "*** buffer overflow detected ***: d2x-rebirth terminated" - pretty sure this is an ALSA problem and is an entirely different problem. It seems not to happen if I turn off all the music.  :-\

Regardless I'd still like to get the ogl renderer working - I like my coloured lights & transparency! open to suggestions here...
Reply
#10
Hmm, I really don't know what probelm SDL could have with choosing a GLX visual. I'd like to see what attributes SDL asked your driver for. Ine thing to see that would be to use apitrace. Unfortunately, I think it is not in your ubuntu version's repository. You could try building it for yourself from the source at github: https://github.com/apitrace/apitrace (Note, you don't need all thos Qt development libs, we don't need the gui, the command line version will do fine). If you get this running, you can run the game with it:
Code:
apitrace trace d1x-rebirth
This will create a .trace file in your current directory. You can then use
Code:
apitrace dump d1x-rebirth.trace
and will (well maybe, if we are unlucky, we get nothing at all) get something like this:
Code:
0 glXChooseVisual(dpy = 0x1670680, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3, GLX_BLUE_SIZE, 2, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_SAMPLE_BUFFERS, 1, GLX_SAMPLES, 4, GLX_X_VISUAL_TYPE, 32771, 0}) = &{visual = 0x167cdc0, visualid = 123, screen = 0, depth = 24, c_class = 5, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
1 glXCreateContext(dpy = 0x1670680, vis = &{visual = 0x167cdc0, visualid = 123, screen = 0, depth = 24, c_class = 5, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}, shareList = NULL, direct = True) = 0x17b5bd0
2 glXMakeCurrent(dpy = 0x1670680, drawable = 46137359, ctx = 0x17b5bd0) = True
In your case, it will probably end directly after the first line, but that first line is what interests me most.

Another thing we might consider is that there is just a bug in the mesa drivers you are using. Version 8.0.x is quite old. But updating mesa is really hard, since you would have to replace a lot of stuff, and all of this would have to bypass your distribution's mechanisms.
"Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint Exupéry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)