How to install OpenGL on Amazon Linux 2 AMI t2.small type?

Terry asked:

I need to install Grass GIS on my Amazon Linux 2 AMI instance which is of type t2.small During the configuration of Grass GIS it stopped with

checking for GL/gl.h... no
configure: error: *** Unable to locate OpenGL includes.

To install OpenGL and/or its includes, I’ve tried following (all with sudo)

yum install libx11-dev
yum install libx11
yum install libX11
yum install libX11-dev
yum install libglu1-mesa-dev
yum install freeglut-devel
yum install freeglut3-dev
yum install mesa-common-dev

As far as I can remember, all of them returned a message of this kind (message translated into English)

amzn2-core
no package named libX11-dev which can be used

Question #1

I kept on searching and found this post which seems to say that in order to use OpenGL, the instance type should be G2 Is that right?

If that’s the case then I presume that the G2 type has a capable graphics hardware whereas my instance t2.small (or shortlyT2 ?) is likely to have no capable graphics hardware.

lspci | grep VGA gives: 00:02.0 VGA compatible controller: Cirrus Logic GD 5446

Question #2

Is it in any way possible to install OpenGL on t2.type (whether using yum or using the source codes and building OpenGL from scratch) ?

My answer:


Here we see compilation failed because a C include file was missing:

checking for GL/gl.h... no
configure: error: *** Unable to locate OpenGL includes.

You should use yum to search for the package containing the missing file.

[[email protected] ~]$ sudo yum provides */GL/gl.h
Loaded plugins: langpacks, priorities, update-motd
mesa-libGL-devel-17.0.1-6.20170307.amzn2.x86_64 : Mesa libGL development package
Repo        : amzn2-core
Matched from:
Filename    : /usr/include/GL/gl.h



mesa-libGL-devel-17.2.3-8.20171019.amzn2.0.1.x86_64 : Mesa libGL development
                                                    : package
Repo        : amzn2-core
Matched from:
Filename    : /usr/include/GL/gl.h



mesa-libGL-devel-17.2.3-8.20171019.amzn2.0.4.x86_64 : Mesa libGL development
                                                    : package
Repo        : amzn2-core
Matched from:
Filename    : /usr/include/GL/gl.h



mesa-libGL-devel-18.3.4-5.amzn2.0.1.x86_64 : Mesa libGL development package
Repo        : amzn2-core
Matched from:
Filename    : /usr/include/GL/gl.h

So now you can see the package name is mesa-libGL-devel and you can install it.

Note that without GPU hardware attached to the VM, this won’t buy you much. You can certainly compile the software but you’ll want an instance with a GPU in order to run it without having to wait forever for software rendering. (The Cirrus you see there is an emulated 1996-era SVGA card which is good for basic video and little else. It basically exists only for the relatively new Screenshot feature, and that level of video is about all it can do.)


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.