Search by Tags

2D/3D Graphics Acceleration (GPU)

 

Article updated at 29 Oct 2021
Compare with Revision




Introduction

OpenGL for Embedded Systems, often also known as OpenGL ES or GLES, is a subset of the OpenGL API for 2D and 3D rendering of computer graphics. If your project requires a graphical user interface (GUI), you are advised to use OpenGL ES to have GPU graphics acceleration, either directly or abstracted by a high-level framework.

There are usually two paths to have hardware-accelerated graphics in your project:

  • Write your own OpenGL ES application: it gives you more control, but it is the hard way and few customers should follow this path. If you want or rather need to follow this path, this page has some code samples.
  • Use a graphics library/framework: choose a framework that supports OpenGL ES graphics acceleration, for example Qt, Crank or TotalCross. It abstracts away the OpenGL API and reduces your time-to-market.

Embedded Linux

Often, to use a graphics framework that has graphics acceleration, you need a graphics back-end. Toradex BSPs support the following graphics back-ends:

  • X11: Supported on pre-i.MX 8 Series modules on older BSPs including 4.0. Dropped on BSP 5.0 onwards. However, pre-i.MX 8 Series modules may still optionally support it.
  • Wayland: Supported on i.MX 8 Series modules as well as BSPs starting from 5.0. You should prefer to use Wayland whenever possible, but if X support is absolutely required, you may evaluate using the XWayland compatibility layer.

Those graphical back-ends, as well as OpenGL itself, are supported on both Embedded Linux offerings by Toradex:

Frameworks

See some GUI frameworks that support OpenGL ES acceleration:

Validation

Toradex validates OpenGL ES using the Multimedia Reference Image from the Toradex BSP Layers and Reference Images for Yocto Project. We run a simple application to validate that the API works and run the glmark or glmark2 benchmark to get a rough estimate of performance. We use a heatsink to run the tests, otherwise, throttling of the GPU clock may interfere with the test results.

Apalis iMX6

  • glmark2, OpenGL ES 2, X11 (glmark2-es2 -s 640x480)
  • Apalis iMX6Q score: 397
  • Apalis iMX6Q IT score: 324

Apalis iMX8

Two benchmarks are run on the Apalis iMX8QM with specific CPU cores: one on the 4x Arm Cortex-A53 and another on the 2x Arm Cortex-A72 cores.

  • HDMI screen, 4k + LVDS display, 1280x800
  • glmark2, OpenGL ES 2, Wayland (taskset -c 0-3 glmark2-es2-wayland -s 640x480 && taskset -c 4,5 glmark2-es2-wayland -s 640x480)
  • Apalis iMX8QM Cortex-A53 score: 1570
  • Apalis iMX8QM Cortex-A72 score: 1427

Apalis iMX8X

Note: Apalis iMX8X is phased out, and it is not available for purchase anymore. The latest supported BSP and TorizonCore version is 5.4.0.

  • HDMI screen, 1920x1080
  • glmark2, OpenGL ES 2, Wayland (glmark2-es2-wayland -s 640x480)
  • Apalis iMX8QXP 2GB ECC score: 950

Apalis TK1

OpenGL - NVIDIA downstream-based kernel:

  • glmark2, OpenGL, X11 (glmark2 -s 640x480)
  • Apalis TK1 score: 1156

OpenGL ES - NVIDIA downstream-based kernel:

  • glmark2, OpenGL ES 2, X11 (glmark2-es2 -s 640x480)
  • Apalis TK1 score: 1448

OpenGL - upstream-based kernel:

  • glmark2, OpenGL, X11 (glmark2 -s 640x480)
  • glmark2 currently does not work.

OpenGL ES - upstream-based kernel:

  • glmark2, OpenGL ES 2, X11 (glmark2-es2 -s 640x480)
  • Apalis TK1 score: 94

Colibri iMX6

  • glmark2, OpenGL ES 2, X11 (glmark2-es2 -s 640x480)
  • Colibri iMX6DL score: 197
  • Colibri iMX6DL IT score: 208
  • Colibri iMX6S IT score: 184

Colibri iMX8X

  • glmark2, OpenGL ES 2, Wayland (glmark2-es2-wayland -s 640x480)
  • Colibri iMX8QXP score: 929
  • Colibri iMX8DX score: 614

Verdin iMX8M Mini

  • HDMI screen, 1920x1080
  • glmark2, OpenGL ES 2, Wayland (glmark2-es2-wayland -s 640x480)
  • Verdin iMX8M Mini score: 366

Verdin iMX8M Plus

Test conditions:

  • BSP 5.2.0
  • Verdin iMX8M Plus Q 4GB WB IT
  • Qt demo stopped
  • Without heatsink
  • HDMI screen, 1920x1080

Test and result:

  • glmark2, OpenGL ES 2, Wayland (glmark2-es2-wayland -s 640x480)
  • Verdin iMX8M Mini score: 953

Samples

Warning: this section has not been updated since 2017.

If you still want to use the OpenGL ES API directly, this section may contain various code samples.

NVIDIA OpenGL ES 2.0 Samples

The sample programs from NVIDIA are available for download from our Samples page. These samples are only meant for the Tegra 2 and Tegra 3 based modules.

OpenEmbedded Build

You can cross-compile and add the samples to a Linux image using OpenEmbedded.

How to build using OpenEmbedded

Cross-compile From Source

It might be useful to build from source when developing an application.

How to cross-compile from source

ARM's OpenGL ES 2.0 Emulator and Samples

ARM provides an OpenGL ES emulator that maps OpenGL ES API calls to the OpenGL API, and it can be found here. It comes without samples, but you can also download the ARM Mali SDK for Linux, that is shipped with samples and can be built to run by the emulator but also on top of devices that support OpenGL ES and X11.

Cross-Compile From Source

It might be useful to build from source when developing an application.

How to cross-compile the samples

NXP (Formerly Freescale) i.MX 6 Graphics SDK

NXP (formerly Freescale) provides GPU SDKs shipped with OpenGL ES and OpenVG samples. You can build the samples from it for use on top of X11.

There are two versions of the GPU SDK, and both of them are available here, being:

  • The old SDK under the "Snippets, Boot Code, Headers, Monitors, etc." section and;
  • The new SDK under the "Software Development Kits" section once clicking "More".

At the time of writing, The old SDK revision is 1.0.0 (dated 01/25/2013) and the new SDK revision is 2.3 (dated 02/23/2016).

Cross-Compile Using the old SDK

The old SDK has OpenGL ES 1.1 and 2.0, and OpenVG samples. It is a Makefile based project with X11 and framebuffer support. Below are provided instructions on how to build the samples for X11.

How to cross-compile using the old SDK

Cross-compile using the new SDK

The new SDK has OpenGL ES 2.0 and 3.0, and OpenVG samples. It has its Makefiles generated by Python scripts and supports Android SDK+NDK, Ubuntu, Windows and Yocto builds, being the latter possible for X11, framebuffer and Wayland. Below are provided instructions on how to build the samples for X11, using OpenEmbedded/Yocto.

How to cross-compile using the new SDK

Windows CE

One possible framework to abstract the direct use of OpenGL ES API is Qt: Setting up Qt framework with VS2008 for WinCE with Toradex modules.

Samples

Simple OpenGL ES samples:

The Nvidia Khronos SDK contains samples for OpenGL ES1, OpenGL ES2, OpenMax and OpenVg.