Antarctica: Debug And Profiling

GPU Perf Studio 2 and CodeXL are used to debug and micro benchmark the new renderer.

http://developer.amd.com/tools-and-sdks/graphics-development/gpu-perfstudio-2/#download http://developer.amd.com/tools-and-sdks/heterogeneous-computing/codexl/

While these tools are made by AMD they can be used on any hardware for debug purpose. As profiling requires specific hardware counter you obviously need a radeon cards to get the most out of it.

GPU Perf studio 2 is more suited to GPU but only ships on Windows at the time of writing (dependency on .Net). CodeXL is more generic as it targets both CPU and GPU, and is available on Linux.

To set up GPU Perf Studio:

  • Click on "Connect" in the main window.
  • A"Server connection" pop up will appear. Set the path to stk executable built in Release mode (debug mode executable are sometimes instable when used through GPS2). Then click on the "connect in the pop up.
  • Stk will start (it is highly recommended to run it in windowed mode). Switch to GPS2 windows which will ask you confirmation about the API and the monitored application.
  • Disable STK frame limiter
  • Go back to STK and run it until there is a frame you want to debug and/or profile.
  • Switch to GPS2 again, and click on the pause button. GPS2 will then register all events to replay the frame.
  • You can now access Frame Debugger (list all glDraw*/glClear with complete context ie textures, vbo...) or API Trace (list all GL command with cpu time), and optionnaly gpu profiler (get gpu execution time of each command).


ASAN The "USE_ASAN" option in cmake on Linux allows gcc and clang to add ASAN support to the binary in debug mode. ASAN (for Adress SANitizer) is a Library that reports memory related error like use after free, double free, malloc/dealloc mismatch... It's basically a Valgrind-like tool but orders of magnitude faster. To enable it you must set some environnment var so that symbol are properly translated (and of course, have libasan installed). On Fedora 20 the following command should work :

  • ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ASAN_OPTIONS=symbolize=1 bin/supertuxkart

Even if stk was built with gcc.