*

Quick hack: Performance debugging Linux graphics on Mesa

Robert Foss avatar

Posted on 29/06/2017 by Robert Foss

Debugging graphics performance in a simple and high-level manner is possible for all Gallium based Mesa drivers.

GALLIUM_HUD

GALLIUM_HUD is a feature that adds performance graphs to applications that describe various aspects like FPS, CPU usage, etc in realtime.

It is enabled using an environment variable, GALLIUM_HUD, that can be set for GL/EGL/etc applications. It only works for Mesa drivers that are Gallium based, which means that the most drivers (with the notable exception of some Intel drivers) support GALLIUM_HUD.

See GALLIUM_HUD options:

export GALLIUM_HUD=help
glxgears

Android

If you're building Android, you can supply system-wide environment values by doing an export in the init.rc file of the device you are using, like this.

# Go to android source code checkout
cd android

# Add export to init.rc (linaro/generic is the device I use)
nano device/linaro/generic/init.rc
export GALLIUM_HUD cpu,cpu0+cpu1+cpu2+cpu3;pixels-rendered,fps,primitives-generated

Linux

If you're using one of the usual Linux distros, GALLIUM_HUD can be enabled by setting the environtment variable in a place that it loaded early.

# Add export to /etc/environment
nano /etc/environment 
export GALLIUM_HUD cpu,cpu0+cpu1+cpu2+cpu3;pixels-rendered,fps,primitives-generated

Thanks

This post has been a part of work undertaken by my employer Collabora.

 

Original post

Comments (0)


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Latest Blog Posts

Virtme: The kernel developers' best friend

18/09/2018

When working on the Linux Kernel, testing via QEMU is pretty common. Here's a look at virtme, a QEMU wrapper that uses the host instead…

Cambridge XMPP Sprint

30/08/2018

Earlier this month, Collabora sponsored & hosted the XMMP Sprint, the first developer event in the XMPP community in a long time. Here's…

Testing Chromebooks with LAVA on kernelci.org

29/08/2018

In addition to Collabora's work to add support in mainline Linux kernel for several Chromebooks, these platforms are now being continuously…

Quick hack: git reset upstream

27/08/2018

Working with a git based project that has a defacto upstream repository means that you perioducally want to fetch the canonical master branch.…

En route to a robust GPU device selection in GL

21/08/2018

A look at the work and motivation behind implementing the Khronos EGLDevice extensions in Mesa. These extensions allow users of open source…

Cross-compilation made easy for GNOME Builder

03/08/2018

GNOME Builder is an Integrated Development Environment designed for the GNOME ecosystem. It most notably features a deep integration to…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2018. All rights reserved. Website sitemap.