Skip to content

apitrace

DavidMansolino edited this page Sep 3, 2019 · 9 revisions

apitrace

apitrace is a tool used for OpenGL debugging.

Installation

Linux

Install apitrace using default package manager:

sudo apt install apitrace apitrace-gui
sudo ln -sf /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/ /usr/bin/

Windows

Download the precompiled apitrace build from https://people.freedesktop.org/~jrfonseca/apitrace/apitrace-msvc-latest.7z and extract it in your software folder.

Then, add the following line to the end of your PATH in your .bash_profile:

~/software/apitrace-msvc/x64/bin

Now you can launch apitrace with apitrace.exe and the gui with qapitrace.exe.

macOS

Install Qt5 as documented here: https://github.com/cyberbotics/webots/wiki/Qt-compilation (note, you can skip QtWebKit and only install the macOS Qt component in the installer).

Then:

cd ~/software
git clone git://github.com/apitrace/apitrace.git
cd apitrace
mkdir build
cd build
cmake ..  -DCMAKE_PREFIX_PATH=~/Qt5.11.2/5.11.2/clang_64/
make
echo '[Paths]
Prefix = /Users/[your username]/Qt5.11.2/5.11.2/clang_64' > qt.conf

Run:

export QT_QPA_PLATFORMTHEME=qt5ct  # On Mojave, forcing the Qt light theme.
export VENDOR=AMD  # On MacBook Pro 2018, select the right GPU.
qapitrace ....

Usage

Generate a trace like this: apitrace trace [Webots executable]

Then open the Trace in the GUI to view results for each call, or each frame etc.

Note: in the preferences you can choose to only display draw events, this is very helpful to cut through extraneous OpenGL calls while debugging.

Clone this wiki locally