PDA

View Full Version : Intel GMA + Linux + GLSL = problem?



Kalle
02-19-2009, 08:21 AM
Hi all,

I have a Compaq V6103EA laptop with an Intel GMA 950 graphics card. Its running Ubuntu 8.10, with the "xserver-xorg-video-intel" driver package and the mesa3d implementation.

I've been doing some OpenGL programming, and up until now, everything has worked very well. Currently I've been trying to learn a bit of GLSL, mainly by studying a source I got hold of. Here is a couple of issues have appeared:

When I compiled and executed the the code (which was originally written for windows/VC++), first I got a segfault at a call to glCreateShaderObject. I spend a long time trying to figure out what was wrong with the call, until I found something regarding the tests of GLEW_ARB_fragment_shader and GLEW_ARB_vertex_shader respectively. I tried changing them to GL_ARB_... , and then I the test failed. What does all of this mean? Which is the right one? And do I have capabilities of using these or not?

I not, as far as I know, this can have a couple of different reasons:

1. my graphics card doesn't support it
2. my graphics card driver doesn't support it
3. my opengl implementation (mesa) doesn't support it.

How can I tell which?

I know from this table (http://en.wikipedia.org/wiki/Intel_GMA#Table_of_GMA_graphics_cores_and_chipsets ), that my graphics card supports vertex/fragment shaders, so 1. shouldn't be the problem. And according to the official mesa website (http://www.mesa3d.org), the 7.x version implements OpenGL 2.1 which includes GLSL.

So how can I go about finding out what is causing my problem?
I'll happily supply you with additional information.

Thanks!

I also forgot to show you this (http://paste.ubuntu.com/120086/). It's the output of glxinfo. I think something seems strange with the OpenGL Version String (1.4 ?).

ZbuffeR
02-19-2009, 08:47 AM
GLEW_ comes from glew lib, it allows easier extension management.
So it is most probable you had this step wrong.
Install libglew-dev package, put back the original GLEW_ checks, then verify you do glewInit() correctly :
http://www.opengl.org/wiki/Getting_started#OpenGL_2.0.2B_and_extensions

Kalle
02-19-2009, 09:13 AM
GLEW_ comes from glew lib, it allows easier extension management.
So it is most probable you had this step wrong.
Install libglew-dev package, put back the original GLEW_ checks, then verify you do glewInit() correctly :
http://www.opengl.org/wiki/Getting_started#OpenGL_2.0.2B_and_extensions



really sorry, but my op contained some major errors! please read it again now that I've corrected it (and note the pastebin link). And also, I am using GLEW already.

ZbuffeR
02-19-2009, 10:36 AM
To run GLSL you need the GL_ARB_shading_language_100 extension.
It does not looks like it is exposed by your card+driver.
I am not sure what are the best Intel drivers to use on Linux.
Maybe someone more used to Intel can help ?

Groovounet
02-19-2009, 10:47 AM
Well, GLSL is not really yet. Some fragment shader ok, vertex shader crash.

'Advanced' OpenGL programming (behond OpenGL 1.4) on Intel chipset a waist of time.

overlay
02-19-2009, 12:43 PM
Regarding Mesa, they should not tell they support OpenGL 2.0 or OpenGL 2.1 because they support only part of the API. Mesa doesn't support a basic thing like linking of multiple shaders.

ref: http://www.mesa3d.org/shading.html
* Unsupported Features
Linking of multiple shaders is not supported

Kalle
02-19-2009, 02:15 PM
ok, so what you mean is that the problem is due to mesa, not my graphics card or driver?

perhaps this is a stupid question, but what alternatives do i have as an ubuntu user?

loicm
02-19-2009, 04:52 PM
GLSL in Mesa is actually not there yet, even though your Intel GPU exposes SM 3.0, you'll not be able to use GLSL then. The DRI driver you're using might give you access to the GL_ARB_fragment_program extension so that you can write pixel shaders using a set of low level assembly instructions. Seeing that in D3D10 assembly shaders have been removed, that really sounds a bit rough nowadays, but it's still currently the only solution to ship software that works almost everywhere on Linux.

PkK
02-20-2009, 03:45 AM
Hi all,
1. my graphics card doesn't support it
2. my graphics card driver doesn't support it
3. my opengl implementation (mesa) doesn't support it.


glxinfo. It will tell you GL version and extensions Please post the output here.
However AFAIK most Intel cards before the GM965 don't support GLSL.

Philipp

PkK
02-20-2009, 03:51 AM
Regarding Mesa, they should not tell they support OpenGL 2.0 or OpenGL 2.1 because they support only part of the API. Mesa doesn't support a basic thing like linking of multiple shaders.

ref: http://www.mesa3d.org/shading.html
* Unsupported Features
Linking of multiple shaders is not supported


That document is nearly two years old. It does not represent the current state of Mesa. I'm too lazy to completly check the current situation with Mesa, but this is the first example I found:

The document you linked to lists, among others:
* The inverse trig functions asin(), acos(), and atan() are not implemented
Three month after that document was written Mesa 7.0 was released, which does support these functions. From the release notes:
Implemented GLSL asin(), acos(), atan() functions.

Philipp

PkK
02-20-2009, 03:54 AM
GLSL in Mesa is actually not there yet, even though your Intel GPU exposes SM 3.0, you'll not be able to use GLSL then. The DRI driver you're using might give you access to the GL_ARB_fragment_program extension so that you can write pixel shaders using a set of low level assembly instructions. Seeing that in D3D10 assembly shaders have been removed, that really sounds a bit rough nowadays, but it's still currently the only solution to ship software that works almost everywhere on Linux.

To see it seems it's just the other way round: GLSL in Mesa is there (and works on newer hardware like the GMA965), but the GMA950 hardware does not support SM 3.0, only SM 2.0. There's an Intel hardware comparison chart in the article at http://en.wikipedia.org/wiki/Intel_GMA

Philipp

martinsm
02-20-2009, 05:11 AM
SM3 has nothing to do with GLSL. GLSL is supported also on SM2 hardware (GeForce FX).

PkK
02-20-2009, 12:17 PM
GSL has control structures like if/else for, etc. AFAIK SM3 added branch instructions which are needed for such control structures. OR in the words of the main Mesa developer, as posted on a Mesa mailing list: "The 945 hardware does not support loops/conditionals/etc which are needed for fragment shaders."

Philipp

Kalle
02-20-2009, 01:34 PM
...
glxinfo. It will tell you GL version and extensions Please post the output here.
...


It's already up there:


...
I also forgot to show you this (http://paste.ubuntu.com/120086/). It's the output of glxinfo. I think something seems strange with the OpenGL Version String (1.4 ?).


It seams my problem is with my hardware and I just have to bite the bullet and wait until I've bought something fancier (which I'm sort of planning to do).