Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I want to find out which is my OpenGL version. I have access to Ubuntu via SSH. Which command shall I execute?

share|improve this question

4 Answers 4

up vote 37 down vote accepted

To know your OpenGL version in Ubuntu,

Install Glxinfo

sudo apt-get install mesa-utils

To Check OpenGL Version,

glxinfo | grep "OpenGL version"

You will get the output as follows,

glxinfo | grep "OpenGL version"
OpenGL version string: 1.4 (2.1 Mesa 7.7.1)
share|improve this answer

depending on what you're looking for:

Open GL Implementation

You can use glxinfo, from the mesa-utils package:

sudo apt-get install mesa-utils

glxinfo | grep "OpenGL version"

Development Libraries

this depends a little,

dpkg -s [package name]

will tell you version information, etc. of any package.

but you'll need to know what specific part/implementation, etc. of opengl you're interested in. i suspect, for you, it'll be:

dpkg -s libglu1-mesa
share|improve this answer

Note: I've added this answer at a later date, because none of the existing answers address a crucial aspects regarding ssh, and will give misleading values to those who follow the above instructions.

  1. Use X-forwarding when ssh-ing. This is enabled with ssh -X.

    Without x-forwarding:

    $ ssh MYCOMP
    $ glxinfo
    Error: unable to open display

    With x-forwarding:

    $ ssh -X MYCOMP
    $ glxinfo | grep -i opengl
    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: GeForce 8800 GT/PCIe/SSE2
    OpenGL version string: 2.1.2 NVIDIA 310.44
    OpenGL shading language version string: 1.20 NVIDIA via Cg compiler
    OpenGL extensions:

    I should note here that this is both the wrong graphics card, and wrong version numbers. ('Wrong' in terms of what you would expect).

  2. Set DISPLAY variable to :0, to allow access to the graphic card's driver from the remote session.

    $ ssh -X MYCOMP
    $ DISPLAY=:0
    $ glxinfo | grep -i opengl
     OpenGL vendor string: NVIDIA Corporation
     OpenGL renderer string: GeForce GTX 550 Ti/PCIe/SSE2
     OpenGL version string: 4.3.0 NVIDIA 310.14
     OpenGL shading language version string: 4.30 NVIDIA via Cg compiler
     OpenGL extensions:

    This lists the correct graphics card (the one on the remote computer), as well as the correct version numbers.

share|improve this answer
Thanks for your effort, this is a much better answer –  jakev Sep 5 '13 at 16:29

For those who only want the version number, for example to give it in argument of a program, you can use

$ glxinfo | awk '/OpenGL version/ {print $4}'

Note: optirun glxinfo | awk '/OpenGL version/ {print $4}' if you are using bumblebee

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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