PCsuggest

  • Quick tip
  • SECURITY
  • NETWORKING
  • OpenWrt
  • HARDWARE

How to install glmark2 from source in Debian

Updated - March 14, 2018 by Arnab Satapathi

Glmark2 is a popular open source GPU benchmarking tool with OpenGL  2.0 and OpenGLES 2.0 support, available for Linux and Android platform.

It is developed with a goal of easy and effective GPU benchmarking for ARM hardware in embedded systems by the Linaro team.

Glmark2 binary packages are available in official Ubuntu repository, but not available in Debian repository, so we have to compile and install latest glmark2 form its git repository.

Contents

  • Install required softwares and development headers
  • Download glmark2 source from git
  • Configure, compile and install glmark2 in Debian
  • Fix libpng error while configuring
  • Conclusion

Install required softwares and development headers

To Download and compile latest debian glmark2 binary, we need some basic tools like g++ and git and development libraries.

  1. Build a basic binary compilation environment
    sudo apt-get install git g++ build-essential pkg-config
  2. Build a X11 and OpenGL development environment
    sudo apt-get install libx11-dev libgl1-mesa-dev
  3. Install jpeg and png image development headers
    sudo apt-get install libjpeg-dev libpng-dev       # install libpng12-dev on Ubuntu/Mint

Download glmark2 source from git

Now you can download the glmark2 source files either with git or the source zip file from glmark github website https://github.com/glmark2/glmark2 .

cd ~/

git clone https://github.com/glmark2/glmark2.git

cd glmark2/

Configure, compile and install glmark2 in Debian

Glmark2 uses the python based WAF build system, which requires an working python 2.x installation, now we are going to build debian glmark2 with X11 and opneGL support only, no OpenGLES, wayland or mir support.

./waf configure --with-flavors=x11-gl

./waf build -j 4

sudo ./waf install

Stripping the debian glmark2 binary will reduce the overall binary size hence it will  make the application launch faster.

sudo strip -s /usr/local/bin/glmark2

Now the compilation and installation is complete , run glmark2 and check the results.

glmark2

debian glmark2 performance testingNote: This will bulid the glmark2 binary and all the supporting data and supporting library under the build/src/ directory.

The default build prefix is /usr/local/ and it will be installed there. So the installation process requires root privilege. Checkout the main article about GPU benchmarking with glmark2 here .

amazon prime logo
Try AmazonPrime for free
Enjoy free shipping and One-Day delivery, cancel any time.

Fix libpng error while configuring

This step is optional, depending on your system, but in my case with Debain testing, it was necessary fix this problem.

sudo mv /usr/include/png.h /usr/include/png.h.bac

cd ~/glmark2/src/libpng/

sudo cp png.h /usr/include/

cd ~/glmark2

Conclusion

Actually this installation process is pretty easy, but sometimes returns many error messages due to improper library and header files.

So if there is any error during configuring and compilation process, you have to find out and solve it, if you need any further help just leave a comment and 🙂 dont forget to share it.

Filed Under: how to Tagged With: benchmark, gpu, stress testing

Your comments
  1. Jotaxpe says

    August 10, 2020

    Error: Glmark2 needs OpenGL(ES) version >= 2.0 to run (but version string is: '1.4 Mesa 18.3.6')!
    Error: main: Could not initialize canvas

    🙁

    Reply
  2. gaohuan says

    May 12, 2020

    Hi,Could you do me one favor?
    I followed your steps, but when i run glmark2, it throwed below error.
    root@liugaohuan-PC:~/glmark2# glmark2
    Error: main: Could not initialize canvas

    Reply
    • W says

      August 7, 2020

      This error occurs when you are trying to run glmark2 without graphical interface.

      Reply
  3. Nikhil says

    January 29, 2019

    I want to build the glmark2 for Null Windowing System. What command line argument should I give while building the source?

    Thanks in advance

    Reply
  4. Andy says

    March 2, 2018

    Thanks! Works well on Linux Mint 18.3.

    Reply
  5. gpmx says

    February 22, 2018

    now on debian buster you need to install libpng-dev. libpng12-dev don't exist for debian testing.

    root@sar-sda6:~# uname -a
    Linux sar-sda6 4.14.0-3-amd64 #1 SMP Debian 4.14.13-1 (2018-01-14) x86_64 GNU/Linux
    root@sar-sda6:~# apt-get install libjpeg-dev libpng-dev

    Reply
    • Arnab Satapathi says

      February 22, 2018

      I should update the package name ASAP.

      Reply
  6. gimbo says

    February 3, 2018

    work's even on a live kali usb stick
    with one little change on step 3
    sudo apt-get install libjpeg-dev libpng12-dev (change to libpng-dev)
    Thanks!!!

    Reply
    • Arnab Satapathi says

      February 3, 2018

      Seems like package name has been changed, thanks for the input.

      Reply
  7. Spirit/BLACKDIAMONT says

    July 28, 2017

    for Raspbian OpenGL-ES2 you need this additional packages
    apt-get install libegl1-mesa-dev libgles2-mesa-dev
    and add glesv2 to configure
    ./waf configure --with-flavors=x11-glesv2

    binary name is glmark2-es2
    happy benching! 🙂

    Reply
    • Arnab Satapathi says

      July 28, 2017

      Thanks !

      Reply
  8. Disgruntled Gherkin says

    October 17, 2016

    Worked for me in Devuan 1.0 Xfce, thanks. 🙂

    Reply
  9. Johannes says

    May 3, 2016

    thank you for that

    Reply
    • Arnab says

      May 3, 2016

      Thanks Johannes, I appreciate your feedback.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © PCsuggest.com · All rights reserved.

  • Home
  • About
  • Contact
  • Privacy Policy
  • Sitemap