[CLOSED] "No modes available" on integrated Intel GM45 (periodically)

Started by xolotl, January 01, 2011, 00:22:58

Previous topic - Next topic

xolotl

I'm having an occasional problem where lwjgl-based applications will error out saying "No modes available," in exceptions similar to this one:
Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.apocalyptech.Test.main(Test.java:32)
Caused by: java.lang.RuntimeException: org.lwjgl.LWJGLException: No modes available
        at org.lwjgl.opengl.Display.<clinit>(Display.java:136)
        ... 1 more
Caused by: org.lwjgl.LWJGLException: No modes available
        at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:643)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:133)
        ... 1 more

This is happening on my laptop with an integrated Intel GM45 chip, but the weirdest thing about it is that it's not really reproduceable.  I'd say about 60% of the time, LWJGL works just fine and I can use apps based on it, but sometimes an X session will simply refuse to let any lwjgl apps run on it.  Restarting X (or possibly the whole machine; I have yet to thoroughly check that out) will often fix the issue, and I may go through four or five boots before I get the issue again, but no matter how many times I try on an X session that's having issues, I'll get that error again.

Here's a small test app which will show the behavior; the exception will get thrown right at the call to "Display.setDisplayMode(dm);"
package com.apocalyptech;

import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

import org.lwjgl.input.Keyboard;

public class Test
{

    public static void main(String argv[])
    {
        try
        {
            DisplayMode dm = new DisplayMode(640, 480);
            Display.setDisplayMode(dm);
            Display.setTitle("Test");
            Display.setFullscreen(false);
            Display.create();

            while (true)
            {
                if (Keyboard.isKeyDown(Keyboard.KEY_Q))
                {
                    break;
                }
                Display.update();
            }
        }
        catch (org.lwjgl.LWJGLException e)
        {
            System.out.println("LWJGL Exception");
            e.printStackTrace();
        }
        catch (Exception e)
        {
            System.out.println("Other exception");
            e.printStackTrace();
        }

    }
}

The exception will also happen if I call Display.getAvailableDisplayModes().

Some further info: on X sessions where this is happening, all other X apps that I've tried work fine.  "xrandr" reports all the valid modes that I'd expect it to, glxinfo reports appropriate stuff (I'll stick that in this post as well, at the bottom), GL-based apps work fine (like glxgears, Frozen Bubble, Eschalon Book 1, etc), and the system otherwise appears to run just fine.  Not that perhaps other apps might not exhibit this behavior too, but so far lwjgl is the only one that I've found.  I'm sure that this is due to some weird obscure corner-case thing (and given that I can't even reproduce it reliably on the laptop where it's happening) I don't have too much hope to find a way around it (apart from restarting the X session or rebooting), but it'd be nice to get to the bottom of it.

Some relevant glxinfo output (trimmed to exclude big ol' blocks of data which don't seem as important) -
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
GLX version: 1.2
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset GEM 20091221 2009Q4 x86/MMX/SSE2
OpenGL version string: 2.1 Mesa 7.7.1


Oh, and this is on LWJGL 2.6, though I've also seen it with 2.5.

kappa

Looks like a driver bug, Intel GM45 are particularly know for this. Don't think we can do much on our side for this unless there is some sort of driver specific hack available that can be applied.