1

I need to upgrade my OpenGL version from 3.0 to 3.1. Stackexchange is full of postings that tackle specific situations, and it proved difficult for me to see the tree from the wood, not to mention to estimate the ageing of the trees, so to speak.

Therefore, I have collected the following information on my situation, only to ask another case-specific question. The questions are

  1. Whether the upgrade is possible
  2. Which steps must/can be taken to that end (please be as specific as possible)

The situation is the following:

  • OS: Ubuntu 14.04 LTS
  • Kernel, from uname -vr: 4.4.0-96-generic #119~14.04.1-Ubuntu SMP Wed Sep 13 08:40:48 UTC 2017
  • Device, from lshw -c video: VGA compatible controller GT218 [GeForce 210] NVIDIA --- this does support OpenGL 3.1 as from the vendor's specs
  • Driver from lshw -c video: nouveau
  • Nouveau info from dpkg -l | grep nouveau

    ii libdrm-nouveau2:amd64 2.4.67-1ubuntu0.14.04.2 amd64 [...] ii libdrm-nouveau2:i386 2.4.67-1ubuntu0.14.04.2 i386 [...] ii xserver-xorg-video-nouveau-lts-xenial 1:1.0.12-1build2~trusty1 amd64 [...]

  • OpenGL info from glxinfo | grep OpenGL

    OpenGL vendor string: nouveau OpenGL renderer string: Gallium 0.4 on NVA8 OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0 OpenGL core profile shading language version string: 3.30 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 3.0 Mesa 11.2.0 OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions:

Additional info available upon request. For example synaptic lists 28 installed packages responding to the search term 'mesa', but I could not say which one is relevant.

  • Ubuntu 14.04 comes with mesa10, which supports OpenGL up to 3.3 (though actual supported version depends on specific driver, Intel has best support usually). – spectras Sep 26 '17 at 9:33
  • May I ask how you know your OpenGL version is 3.0 and why you wanto to upgrade it? – spectras Sep 26 '17 at 9:40
  • @spectras In a mistake I had published the posting before finishing it. Perhaps now you see more relevant info. The upgrade is needed because an application I want to run is asking for it. – XavierStuvw Sep 26 '17 at 9:43
  • 2
    OpenGL core profile version string: 3.3 => your setup supports version 3.3. If the application says otherwise, it's either a bug in the application, or a lack of low-level support that's unlikely to get fixed by an update. – spectras Sep 26 '17 at 10:30
  • 1
    Can you try to start your application by lying to it and see if it misbehaves? Like, MESA_GL_VERSION_OVERRIDE=3.1 path/to/your/application – spectras Sep 26 '17 at 10:33
1

Summarizing comments: the application probably misbehaves.

OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0

This means you have Mesa 11.2 installed, and the maximum supported OpenGL version is 3.3.

Now, why does the application say otherwise? The most common way to query OpenGL version used to be a call to glGetString(GL_VERSION), and that's what the application uses.

Proof it uses that? The MESA_GL_VERSION_OVERRIDE environment variable alters the reported version to whatever you set it to. And setting it to 3.1 makes the application stop to complain.

Now, like all OpenGL functions, glGetString requires an OpenGL context to be active. However, since the release of OpenGL 3.2, to create en OpenGL context, you must state beforehand the version you want. This lets later versions enable compatibility when programs use an older version(*).

The fun thing is here: the version reported by glGetString depends on which version was selected when creating the context. This leads badly implemented and old applications that don't select a profile explicitly to believe the version they asked is the maximum version supported. And if the application did not select a version, a compatibility context is created automatically with an older version. I think this is the one you see on this line:

OpenGL version string: 3.0 Mesa 11.2.0

If this is the actual issue, upgrading will change nothing. But you can keep the MESA_GL_VERSION_OVERRIDE=3.1 trick. It should load a 3.1 profile and make the program happy while waiting for it to be fixed.


(*) About profiles. This is something new with OpenGL 3.2, OpenGL feature set can be selected at runtime, by letting the program request an OpenGL version, which the OpenGL implementation will “downgrade” to. That works from version 3.2 forward, leaving the question of what to do with all the older stuff, especially as OpenGL3 is a major revamp of the API (glBegin / glVector and stuff are gone). The choice was made to split the API in two profiles: Core and Compatibility. The compatibility context retains old, obsolete calls while the core context does away with them.

Support of a compatibility context is completely optional though, and while most vendors provide one that roughly matches the time of the split (from 3.0 to 3.2), few bother making newer versions of the compatibility context. That's what @Ruslan was suggesting in his answer: Mesa only supports the compatibility profile for OpengGL 3.0, but nVidia supports higher versions as well. That could make your program happy without having to lie to it.

  • 1
    Another problem may be that the application wants compatibility profile, and Mesa doesn't support it. – Ruslan Sep 26 '17 at 15:43
  • The comment and answer of @Ruslan add another dimension to the problem. Would you mind including his/her remarks into your answer? I guess that underlining the relationship between 'core' and 'compatibility' as it can be deduced from the info in the post, would clarify the matter. Else, it would be nice to indicate which other information one can ask the computer to that end. – XavierStuvw Oct 2 '17 at 8:03
  • @XavierStuvw> edited. As for asking, you got it all using glxinfo. Versions are the maximum supported, programs are free to request any version between 1.0 and that version. With a quirk: requesting a version below 3.0 can get you any higher version, on compatibility profile. – spectras Oct 2 '17 at 10:45
0

In case your application requires support of compatibility profile, you're out of luck with Mesa: it only supports Core profile, and this is where it does show you OpenGL 3.3 support.

If you need the application to work, you may want to try to install the official proprietary nvidia driver instead of nouveau. It supports fully both core and compatibility profiles, as well as lots of nvidia-specific extensions.

If you choose to install the official driver, you'll want the 340 series of it, packaged as nvidia-340 on Ubuntu (that's the version suggested by nvidia.com for GeForce 210).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.