OpenGL & GLSL 3.3 on an HD Graphics 4000 under Ubuntu 12.04
Asked Answered
P

3

19

I'm running that configuration :

  • Ubuntu 12.04
  • Intel HD Graphics 4000

glxinfo give me that parameters:

OpenGL renderer string: Mesa X11
OpenGL version string: 2.1 Mesa 8.0.4
OpenGL shading language version string: 1.20
OpenGL extensions:

My goal was to run OpenGL 3.3 (and so GLSL 3.3). If I'm easy with development issues, I'm lost in hardware and drivers, so does someone knows a way to achieve that with my configuration?

Paunchy answered 2/1, 2013 at 14:36 Comment(1)
After installing many different drivers, packages, I manage to upgrade to OpenGL version string: 3.0 Mesa 8.0.4 and OpenGL shading language version string: 1.30. Does anybody succeed to at least OpenGL 3.3?Paunchy
I
1

Unfortunally at this moment it looks like this is not possible, since the open source drivers provided by Intel are the only available. There is a version newer than yours (Mesa 9.0.1) but it still supports OpenGL 3.0 and GLSL 1.30, as you can read in the release notes at the Intel Open Source website.

The problem is that open source drivers are stuck with Mesa, which at this moment only supports GLSL 1.40, as you can see here: http://www.mesa3d.org/shading.html#support

I'm afraid that if you need to use an OpenGL 3.3 environment, you'll need to get a dedicated GPU with binary drivers available (nvidia or ati cards).

Intonate answered 11/2, 2013 at 7:40 Comment(0)
F
31

Great News!!!

Mesa 10 is out which means support for Opengl 3.3 and GLSL 3.3!

This is tested on my 4th Generation Core i5 Mobile Processor with an HD 4400 Graphics chipset.

Modern OpenGL development is now possible on integrated intel chipsets in linux! this is a huge step forward. Note that ubuntu 15.04 ship with Mesa 10.5

Here's me rendering a triangle using a GLSL 3.3 Shader :)

glsl 3.3 shader

Ok so in order to get the experimental drivers to make this work on Ubuntu 13.10 you're going to need to do a few things:

# Note this will take awhile!
1.) Add the PPA Repository
  $ sudo add-apt-repository ppa:oibaf/graphics-drivers
2.) Update sources
  $ sudo apt-get update
3.) Dist-upgrade (rebuilds many packages)
  $ sudo apt-get dist-upgrade
4.) Reboot!

In your code make sure you request a Opengl 3.3 context!

Run this command glxinfo | grep OpenGL you should get something like...

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.1.0-devel (git-f9cfe5c     saucy-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

Source Articles

http://www.phoronix.com/scan.php?page=news_item&px=MTQ5OTk

https://launchpad.net/~oibaf/+archive/graphics-drivers/

Fuse answered 15/12, 2013 at 0:4 Comment(7)
Thanks for your post, it is really helpful! Weirdly, while glxinfo does report Mesa 10.1 for me, still only OpenGL 3.0 is available. Do you have any idea why that might be? I posted the question here: #21566180 Thanks!Cecilececiley
#25936665 - could you please help me with this question? I have to force using a software renderer because my Ubuntu is running in VmWareMacruran
This doesn't seem to work quite yet in 14.04 (it is June now). glxinfo reports the same string for core profile but then: OpenGL version string: 3.0 Mesa 10.7.0-devel (git-f97166e 2015-06-01 trusty-oibaf-ppa) OpenGL shading language version string 1.30 And when I create a context with glut requesting version 3.3 I still get a version 3.0 context.Potency
@Potency Yes - canonical has not kept their promises... I'll update thisFuse
You need to ask for an opengl 3.3 core profile to get it. It is not by default as 3.3 is not backwards compatible. You can try overriding the reported version and see what happens by setting environment variables, e.g. MESA_GL_VERSION_OVERRIDE=3.3 MESA_GLSL_VERSION_OVERRIDE=330 ./my_programSmackdab
three will still be the error using glew : 'Error compiling 'lighting.vs': '0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, and 1.00 ES' @StuartAxonFortitude
I'm using the oibaf PPA mentioned above and running Ubuntu 15.04 64 bit. Things seem to be working OK, what program are you trying to run ?Smackdab
T
5

so Ive seen a lot of threads surrounding this and I thought here would be a good place to respond. Im running Ubuntu 15.04 with intel ivybridge. After using the "Intel Graphics installer for linux" application, glxinfo gives the following info regarding openGl:

OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.6.0
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 10.6.0
OpenGL shading language version string: 1.30

Now from this you can see that the core profile and glsl version are 3.3,but compatible openGl is only 3.0 thus if you want your code to run with 3.3 you need to specify both an opengl core profile and a glsl core profile. The following steps should work if youre using freeglut and glew:

  • the glsl #version should specify that you want the core profile:

#version 330 core

  • specify you want opengl 3.3:

glutInitContextVersion (3, 3);

  • and finally set glewExperimental to true before glewInit():

glewExperimental = GL_TRUE;

Edit:

Something I forgot to mention which seems to be relevant to most *nix users using freeglut is regarding depth testing,i,e what should be drawn( and what shouldn't) of a mesh from a particular view point:

To use depth testing on Linux, you not only need to enable depth testing via

(glEnable(GL_DEPTH_TEST);

but you also need to create your glut context to have a depth buffer (Windows seems to usually have a depth buffer by default, Linux doesn't).

Using freeglut that means you need to include GLUT_DEPTH in glutInitDisplayMode so that it creates the context to have a depth buffer, e.g.

glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);

p.s. I have only been using freeglut because the college module I took gave us demo code to run using it. Since then I would definitely recommend switching to glfw instead. The first part of my answer still pretty much applies, just with glfw methods instead.

Tavia answered 2/10, 2015 at 11:30 Comment(0)
I
1

Unfortunally at this moment it looks like this is not possible, since the open source drivers provided by Intel are the only available. There is a version newer than yours (Mesa 9.0.1) but it still supports OpenGL 3.0 and GLSL 1.30, as you can read in the release notes at the Intel Open Source website.

The problem is that open source drivers are stuck with Mesa, which at this moment only supports GLSL 1.40, as you can see here: http://www.mesa3d.org/shading.html#support

I'm afraid that if you need to use an OpenGL 3.3 environment, you'll need to get a dedicated GPU with binary drivers available (nvidia or ati cards).

Intonate answered 11/2, 2013 at 7:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.