<p>When creating a OpenGL context you have to specify a profile mask, which is a way of telling the driver whether you want to use compatibility ("legacy") features or not.</p>

<p>Drivers are required to implement all core profile features, but compatibility profile is optional - creating a compatibility context can fail even if the driver supports the version you've requested.</p>

<p>The output from <code>glxinfo</code> you've pasted shows that you can create GL context with version up to 4.5 only when using core profile. If you want to use compatibility profile, the highest version you can request is 3.0.</p>

<p>One reason of the problem you are having is that you:</p>

<ul>
<li>requested context version greater than 3.0, and</li>
<li>requested a compatibility profile (by setting <code>GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB</code> in <code>GLX_CONTEXT_PROFILE_MASK_ARB</code>).</li>
</ul>

<p>If removing compatibility bit doesn't help, you'll need to double check if other context attributes are correct.</p>

<p><em>What I described above is documented in a more detailed way <a href="https://www.khronos.org/registry/OpenGL/extensions/ARB/GLX_ARB_create_context.txt" rel="nofollow noreferrer">here</a>.</em></p>

CC BY-SA 4.0
2019-07-05T21:27:23.317Z
OK. Let me reference this answer while poking around a bit with the Qt documentation and my program. I'm not creating the context myself, but am creating a Qt OpenGL Widget and trying to specify which level of functions I'd like loaded. Unfortunately I have no idea how Qt is actually creating the context behind the scenes and adhering it to the widget surface.
RoboticForest
CC BY-SA 4.0
2019-07-06T13:33:07.907Z
It seems that you have to set correct `QSurfaceFormat` (major and minor version numbers and profile to `Core`). By default, surface format is initialized for OpenGL 2.0, so you won't be able to use GL 4+ with Mesa drivers.
joe_chip
CC BY-SA 4.0
2019-07-11T22:17:40.833Z
Thank you! I sat down today to pick this project back up and that last comment helped me get everything up and running. I'm now rendering under the 4.5 core profile. :-)
RoboticForest
CC BY-SA 4.0
2019-07-11T22:28:13.490Z
I just realized we haven't talked specifically about the shading language version string. Given what's been said so far, can I assume they are read the same way? If I use a compatibility profile than the max shading language version I can use is 1.3, and if I use a core profile the max version is 4.5?
RoboticForest
CC BY-SA 4.0
2019-06-29T11:47:43.260Z
2019-06-29T11:47:43.260Z
joe_chip
<p><strong>Note:</strong> I wasn't 100% certain if this question belonged here or in Ask Ubuntu. I figured since it was about OpenGL programming I'd put it here, but if I should move it to Ask Ubuntu, please let me know.</p>
<h1>Background</h1>
<p>I'm new to OpenGL and needed to figure out which version I could program in on my PC. A few Google/Stack Exchange searches shows that the usual solution is to run <code>glxinfo | grep version</code> and read the results, which I did and got the following:</p>
<pre><code>server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
</code></pre>
<p>The confusing part is the following three lines:</p>
<pre><code>OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
</code></pre>
<p>Everything I've read says to focus only on the Core Profile line, but I'm unable to draw anything unless I load functions and create a context under 3.0 or lower. Plus, when I call <code>glGetString(GL_VERSION)</code> I get <code>3.0 Mesa 18.0.5</code> printed to the terminal, but I'm not sure if that's because my hardware only supports 3.0 or if that's because I loaded functions for that level. Also, when I start writing shaders (I'm currently using Qt and an OpenGL Widget so haven't made a shader of my own yet) will I only be able to use GLSL 1.3 instead of 3.0+?</p>
<h1>My Question</h1>
<p>My big question is, what do the output strings actually mean? I can't find that answer. Which one tells me what my hardware can actually do? And, what do the other strings mean? Why am I getting a Core Profile of 4.5 when (as far as I can tell) I can't actually use 4.5? If my hardware <em>can</em> perform 4.5 operations, how do I make it do so?</p>

CC BY-SA 4.0
2019-06-27T09:03:15.290Z
It looks to me like you're using software emulation and if you want to use your GPU you need to install a different graphics driver. Installing new drivers really is a question for Ask Ubuntu though.
Dan Hulme
CC BY-SA 4.0
2019-06-27T16:46:37.807Z
How can you tell? Is it the simple fact that the version string and core profile version don't match?
RoboticForest
CC BY-SA 4.0
2019-06-27T18:47:18.390Z
No, it's because Mesa is an open-source OpenGL implementation. Usually you'd expect the GPU vendor's name to appear there.
Dan Hulme
CC BY-SA 4.0
2019-06-27T20:00:27.473Z
So, you're saying that Mesa is being my OpenGL driver instead of my Intel chip? I thought Mesa was a utility for getting OpenGL info from my hardware.
RoboticForest
CC BY-SA 4.0
2019-07-05T21:29:54.807Z
I've updated my drivers fully using Intel's update tool and, assuming [this article](https://www.gamingonlinux.com/articles/an-explanation-of-what-mesa-is-and-what-graphics-cards-use-it.9244) is correct, I'm using the integrated drivers for my hardware.
RoboticForest
<opengl><glsl><c++><hardware><compatibility>
What do the OpenGL version strings from glxinfo actually mean?
RoboticForest
# What do the OpenGL version strings from glxinfo actually mean?

(Asked by: username_0 on 2019-06-27)

**Note:** I wasn't 100% certain if this question belonged here or in Ask Ubuntu. I figured since it was about OpenGL programming I'd put it here, but if I should move it to Ask Ubuntu, please let me know.

# Background

I'm new to OpenGL and needed to figure out which version I could program in on my PC. A few Google/Stack Exchange searches shows that the usual solution is to run `glxinfo | grep version` and read the results, which I did and got the following:

```
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

```

The confusing part is the following three lines:

```
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30

```

Everything I've read says to focus only on the Core Profile line, but I'm unable to draw anything unless I load functions and create a context under 3.0 or lower. Plus, when I call `glGetString(GL_VERSION)` I get `3.0 Mesa 18.0.5` printed to the terminal, but I'm not sure if that's because my hardware only supports 3.0 or if that's because I loaded functions for that level. Also, when I start writing shaders (I'm currently using Qt and an OpenGL Widget so haven't made a shader of my own yet) will I only be able to use GLSL 1.3 instead of 3.0+?

# My Question

My big question is, what do the output strings actually mean? I can't find that answer. Which one tells me what my hardware can actually do? And, what do the other strings mean? Why am I getting a Core Profile of 4.5 when (as far as I can tell) I can't actually use 4.5? If my hardware *can* perform 4.5 operations, how do I make it do so?

**Tags:** opengl, glsl, c++, hardware, compatibility

> **Comments:**
> **username_1**: It looks to me like you're using software emulation and if you want to use your GPU you need to install a different graphics driver. Installing new drivers really is a question for Ask Ubuntu though.  
> **username_0**: How can you tell? Is it the simple fact that the version string and core profile version don't match?  
> **username_1**: No, it's because Mesa is an open-source OpenGL implementation. Usually you'd expect the GPU vendor's name to appear there.  
> **username_0**: So, you're saying that Mesa is being my OpenGL driver instead of my Intel chip? I thought Mesa was a utility for getting OpenGL info from my hardware.  
> **username_0**: I've updated my drivers fully using Intel's update tool and, assuming [this article](https://www.gamingonlinux.com/articles/an-explanation-of-what-mesa-is-and-what-graphics-cards-use-it.9244) is correct, I'm using the integrated drivers for my hardware.  

---

## 1 answers

### Answer by username_2 on 2019-06-29. Score: 3 | Accepted answer

When creating a OpenGL context you have to specify a profile mask, which is a way of telling the driver whether you want to use compatibility ("legacy") features or not.

Drivers are required to implement all core profile features, but compatibility profile is optional - creating a compatibility context can fail even if the driver supports the version you've requested.

The output from `glxinfo` you've pasted shows that you can create GL context with version up to 4.5 only when using core profile. If you want to use compatibility profile, the highest version you can request is 3.0.

One reason of the problem you are having is that you:

* requested context version greater than 3.0, and
* requested a compatibility profile (by setting `GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB` in `GLX_CONTEXT_PROFILE_MASK_ARB`).

If removing compatibility bit doesn't help, you'll need to double check if other context attributes are correct.

*What I described above is documented in a more detailed way [here](https://www.khronos.org/registry/OpenGL/extensions/ARB/GLX_ARB_create_context.txt).*

> **Comments:**
> **username_0**: OK. Let me reference this answer while poking around a bit with the Qt documentation and my program. I'm not creating the context myself, but am creating a Qt OpenGL Widget and trying to specify which level of functions I'd like loaded. Unfortunately I have no idea how Qt is actually creating the context behind the scenes and adhering it to the widget surface.  
> **username_2**: It seems that you have to set correct `QSurfaceFormat` (major and minor version numbers and profile to `Core`). By default, surface format is initialized for OpenGL 2.0, so you won't be able to use GL 4+ with Mesa drivers.  
> **username_0**: Thank you! I sat down today to pick this project back up and that last comment helped me get everything up and running. I'm now rendering under the 4.5 core profile. :-)  
> **username_0**: I just realized we haven't talked specifically about the shading language version string. Given what's been said so far, can I assume they are read the same way? If I use a compatibility profile than the max shading language version I can use is 1.3, and if I use a core profile the max version is 4.5?  

---

