Hello Guest

[BUG] Linux bugs in Virtual Box

  • 1 Replies
  • 6218 Views
*

Offline Momoko_Fan

  • *
  • 38
  • jME3 lead developer
[BUG] Linux bugs in Virtual Box
« on: September 09, 2011, 00:28:04 »
I am trying to run LWJGL on Ubuntu 11.04 (32 bit) inside Virtual Box and apparently it doesn't work all too well. The weird thing is that other OpenGL applications like Blender work fine.

If I enable "3D acceleration" in the Virtual Box settings then I get this error:
Code: [Select]
Could not locate symbol glXCreateContextAttribsARB
Xrandr extension version 1.3
Using Xrandr for display mode switching
XF86VidMode extension version 2.2
Initial mode: 1280 x 920 x 24 @60Hz
OpenGL Warning: glXChooseFBConfig returning NULL, due to attrib=0xc, next=0x18
OpenGL Warning: glXChooseFBConfig returning NULL, due to attrib=0xc, next=0x18
XF86VidMode extension version 2.2
SEVERE: Failed to create display
org.lwjgl.LWJGLException: Could not choose GLX13 config
        at org.lwjgl.opengl.LinuxDisplayPeerInfo.initDefaultPeerInfo(Native Method)
        at org.lwjgl.opengl.LinuxDisplayPeerInfo.<init>(LinuxDisplayPeerInfo.java:52)
        at org.lwjgl.opengl.LinuxDisplay.createPeerInfo(LinuxDisplay.java:742)
        at org.lwjgl.opengl.Display.create(Display.java:855)
        at org.lwjgl.opengl.Display.create(Display.java:785)
(LWJGL debug logging was enabled)

The error above happens with both Sun JDK and OpenJDK, both LWJGL 2.7.1 and 2.8. Blender works fine, showing the following about debug opengl:
Code: [Select]
- Renderer:   Chromium
- Vendor:     Humper
- Version:    2.1 Chromium 1.9

So next I shutdown the VM and set 3D acceleration to off. This time I am getting a different exception:
Code: [Select]
org.lwjgl.LWJGLException: X Error - disp: 0x9d42218 serial: 97 error: BadDrawable (invalid Pixmap or Window parameter) request_code: 14 minor_code: 0
    at org.lwjgl.opengl.LinuxContextImplementation.nMakeCurrent(Native Method)
    at org.lwjgl.opengl.LinuxContextImplementation.makeCurrent(LinuxContextImplementation.java:121)
    at org.lwjgl.opengl.Context.makeCurrent(Context.java:193)
    at org.lwjgl.opengl.AbstractDrawable.makeCurrent(AbstractDrawable.java:44)
    at org.lwjgl.opengl.Display.makeCurrent(Display.java:732)
    at org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval(Display.java:897)
    at org.lwjgl.opengl.Display.create(Display.java:861)
    at org.lwjgl.opengl.Display.create(Display.java:785)
I had to actually get the stack trace from a debugger because it is masked by a different exception which happens in drawable.destroy()..

Above the log I am also seeing this message however I have allowSoftwareOpenGL flag enabled so it should work:
Code: [Select]
OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
Once again Blender works fine. Here's the opengl debug info:
Code: [Select]
- Renderer:   Software Rasterizer
- Vendor:     Mesa Project
- Version:    2.1 Mesa 7.10.2

Re: [BUG] Linux bugs in Virtual Box
« Reply #1 on: September 09, 2011, 04:18:12 »
I wonder if it's a problem with XCreatePixmap where LWJGL is trying to set the display to the host OS instead of the virtual box OS.

However, searching google, it looks like a drivers problem (and also others have said a problem using OpenJDK over Sun/Oracle), but it's odd that other OpenGL programs work.
cool story, bro