Amit Tomar
Amit Tomar

Reputation: 4858

Crash on using the opengl graphics system

I have made a Qt/Qml Application which works fine in the raster mode.

QApplication::setGraphicsSystem("raster");

But as soon as I change it to opengl, it crashes with the following messages:

hijackWindow() context created for QmlApplicationViewer(0xbfce6e5c) 1 
QGLContext::makeCurrent(): Failed.
QGLFramebufferObject: Unable to resolve framebuffer object extensions - make sure there is a current context when creating the framebuffer object.
QGLWindowSurface: Failed to create valid FBO, falling back 
QGLPixelBuffer: Unable to find a context/format match - giving up.
QGLWindowSurface: Failed to create valid pixelbuffer, falling back 
QGLContext::makeCurrent(): Failed.
QGLWindowSurface: Using plain widget as window surface QGLWindowSurface(0x932b428) 
QGLContext::makeCurrent(): Failed.
QGLShader: could not create shader 
Vertex shader for simpleShaderProg (MainVertexShader & PositionOnlyVertexShader) failed to compile
QGLShader: could not create shader 
Fragment shader for simpleShaderProg (MainFragmentShader & ShockingPinkSrcFragmentShader) failed to compile
QGLShaderProgram: could not create shader program 
Errors linking simple shader: "" 
QGLShader: could not create shader 
Vertex shader for blitShaderProg (MainWithTexCoordsVertexShader & UntransformedPositionVertexShader) failed to compile
QGLShader: could not create shader 
Fragment shader for blitShaderProg (MainFragmentShader & ImageSrcFragmentShader) failed to compile
QGLShaderProgram: could not create shader program 
Errors linking blit shader: "" 
QGLContext::makeCurrent(): Failed.
QGLShader: could not create shader 
Warning: "" failed to compile! 
QGLContext::makeCurrent(): Failed.
QGLContext::makeCurrent(): Failed.
QGLShader: could not create shader 
Warning: "" failed to compile! 
QGLContext::makeCurrent(): Failed.
QGLContext::makeCurrent(): Failed.
QGLContext::makeCurrent(): Failed.
QGLContext::makeCurrent(): Failed.
The program has unexpectedly finished.

Platform : Ubuntu 12.04 - 32 bit - Intel i5 - Qt 4.8


Edit 1 :

I tried a way around using this approach mention on SO . It did work, but I got worst of the performance even with such a powerful platform !?

Is there something I am missing ? Can some one list down what all should be ensured on a platform to make sure that the Application actually works in the opengl mode and not fall back to the native mode.

eg. graphics card / drivers / opengl support etc ?


Edit 2 :

When I tried running glxinfo command, one of the line says : direct rendering: No Is it something I should be worried about ?


Edit 3 :

I was trying to install some drivers and noticed that direct rendering: No changed to a Yes after I was done.

Upvotes: 0

Views: 4065

Answers (1)

datenwolf
datenwolf

Reputation: 162164

Sounds like you have no OpenGL drivers for your GPU installed, so you're falling back into software rasterizer mode, which is sloooooow. The relevant lines of glxinfo are the OpenGL renderer string and the OpenGL version string. The GLX strings are uninteresting, as GLX is just a transport for the OpenGL commands over a network, the X11 protocol extensions used to create OpenGL contexts and that's mostly independent from the GPU and its driver.

What's the output of /usr/sbin/lspci | egrep 'VGA|Graphics' ?

When executing on the system your GPU is installed in Direct Rendering: No is a warning sign, that the OpenGL drivers installation is incomplete. However you can use OpenGL over a remote connection as well, and with well written programs this can be even quite performant (not over dialup, but within a LAN).

Upvotes: 1

Related Questions