1 / 29

Advanced Debugging and Profiling with gDEBugger ES

Advanced Debugging and Profiling with gDEBugger ES. Yaki Tebeka Avi Shapira. OpenGL ES debugging model. Application is sending API calls. Something happens here!. Why is OpenGL ES debugging difficult?. A general purpose debugger views the graphic system as a “ black box ”

holland
Download Presentation

Advanced Debugging and Profiling with gDEBugger ES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Debugging and Profiling with gDEBugger ES Yaki Tebeka Avi Shapira

  2. OpenGL ES debugging model Application is sending API calls Something happens here!

  3. Why is OpenGL ES debugging difficult? A general purpose debugger views the graphic system as a “black box” • A render context is a huge “global” state machine • Commonly used features use a lot of state variables • You cannot watch OpenGL ES state variable values • You cannot break on state variables access functions • You cannot view allocated graphic objects (textures, buffers, etc) • OpenGL ES is a low level API: few thousand calls per frame • OpenGL ES error model: It takes time to locate the place that generated the error

  4. Use an OpenGL ES debugger! An OpenGL ES debugger transforms your debugging task into a “white box” model • Lets you watch OpenGL ES state variable values • Lets you put a breakpoint on an OpenGL ES function • Lets you view allocated graphic objects (textures, etc) • Breaks automatically when an OpenGL error occurs • View the application call stack and source code when the application breaks • Displays the OpenGL ES calls log • Saves debugging time • Improves product quality

  5. Let’s jump into the water …

  6. Problem #1 • The rendered object does not appear on the screen.

  7. Remedy #1 • Use the State Variables view: • Break the application run when the relevant object is being rendered • Watch the values of the state variable associated with the described problem

  8. Problem #2 • A rendered objects material is incorrect. • This happens in a certain mode / scenario.

  9. Remedy #2 • Use the State Variables Comparison Viewer: • Break the application run when things are ok • Take a snapshot of the entire state machine • Break the application run when things go wrong • Compare the current state machine values to the saved snapshot

  10. But how do I… • Break the application run when the relevant object is being rendered? • Breakpoints Dialog • Interactive Mode Toolbar • “Draw Step” Command • Find the place that changed the state variable value? • Call Stack View • Source code Viewer • Locate geometry related problems • Raster mode toolbar: force OpenGL ES raster mode to points, lines or fill • View the rendered geometry to locate Skinning / Level of details / Culling problems

  11. If the problem is related to textures? • Use the Textures viewer • Lets you view textures allocated by the debugged application • Displays textures properties • Displays the bound textures for each bind target in each texture unit • Supports 1D, 2D, 3D, Cube map and rectangle textures • Textures data can be saved to disk as an image • Updates in real time

  12. If the problem is related to Shaders? • Use the Shaders Source Code Editor • Lets you view shaders and programs allocated by the debugged application • Displays shaders and programs properties • Displays programs active uniforms values • Displays the active program • Programs and Shaders can be edited, compiled, linked and validated “on the fly” • Updates in real time

  13. OpenGL ES profiling model Application is sending API calls Something happens here!

  14. A profiling nightmare… • A general purpose profiler views the GPU as a “black box” • A pipelined system • Pipeline stages are highly parallel • Pipeline stages are highly programmable (usually SIMD or MIMD arrays) • Few actions per processor cycle • Caching is used in different stages • Hardware uses a lot of algorithms • IHVs keep implementation details secret…

  15. Before you start the profiling effort • Clean your OpenGL ES usage! • Remove OpenGL ES errors • Remove redundant OpenGL ES calls • Redundant state changes • Repeatedly turning on and off the same mechanisms • Redundant API calls • etc.

  16. Remove OpenGL errors • OpenGL usually ignores commands that cause errors • These commands may have significant impact on render performance! • It’s easy to test for errors, but much harder to locate them: // End of frame test: GLenumopenGLError = glGetError(); if (openGLError != GL_NO_ERROR) { assert(0); // But, who generated this error? }

  17. Remove OpenGL errors - cont • gDEBugger ES enables you to “break on” • OpenGL errors • gDEBugger detected errors • NVIDIA GLExpert driver reports • When the debugged application breaks, view its call stack

  18. Remove redundant OpenGL calls • Calls Statistics view • Displays the number of times each OpenGL, WGL and extensions function call was called • Calls History view • Displays a log of OpenGL, WGL and extensions function calls • Call Stack and Source Code views • Enables you to trace the source code location that caused each redundant call

  19. Steps for optimizing render performance • Identify a performance bottleneck • Optimize the pipeline stage that causes the bottleneck • Repeat 1 and 2 until reaching the desired performance level or performance cannot be improved anymore • If you cannot improve performance anymore, you can add workload to pipeline stages that are not fully utilized (improve visual effects / visual fidelity)

  20. Profiling Demo

  21. Performance graph and dashboard views Displays performance counters graphs of: • gDEBugger • Win32 • ATI • NVIDIA

  22. Available performance counters (Desktop)

  23. Performance Analysis Toolbar • Turn off the graphic pipeline stages one after the other • If performance improves when turning off a certain stage, you have found a graphic pipeline bottleneck

  24. Commands include • Enter profiling mode • Eliminate draw commands • Eliminate raster operations • Eliminate fixed pipeline lights • Eliminate texture data fetch operations • Eliminate fragment shader operations

  25. Other gDEBugger features • Launch any OpenGL or OpenGL ES application for debug or profile session. Instrumentation or recompilation are not needed! • Adds breakpoints for any OpenGL, OpenGL ES or extensions entry point • Views a list of active and deleted OpenGL render contexts • Display debugged process events such as: thread created, dll loaded and unloaded, breakpoint hit, etc. • Forces OpenGL to render directly into the front buffer and controls the rendering speed • Forces the OpenGL Polygon Raster mode to see the rendered geometry • Supports debugging and profiling of OpenGL ES applications • gDEBugger ES is being used as an “out of the box” OpenGL ES emulator for the embedded systems on a Windows PC machine • Displays implementation-specific OpenGL run-time information such as pixel formats and available extensions • Saves textures as image files to disk • Views OpenGL state variables values in the watch view • Supports applications that render using multiple threads and multiple render contexts. • Saves performance counters data into a file (.csv). This enables you to do performance and regression tests for your application using different hardware and driver configurations. • Output an OpenGL calls log into a formatted HTML file, containing texture imaged, vertex and fragment shaders source code. • Supports GL_GREMEDY_string_marker extension that allows adding string markers into the reported and recorded calls log, making the calls log much clearer. • Support OpenGL 2.0 standard and additional extensions • And more…

  26. gDEBugger version 2.5 • The first public gDEBugger ES beta • Official version is planned to be shipped in September • OpenGL ES implementation on Desktop windows • Supports OpenGL ES 1.1 and EGL 1.1

  27. In the pipeline… • Linux port • On device debugging and profiling • EGL 1.2 support • OpenGL ES 2.0 support • Buffer Viewer • Dev Studio Integration

  28. Free gDEBugger License for Academic users! OpenGL ARB and Graphic Remedy Academic Program: • Annual program for all OpenGL Academic users • License of the full feature version for one year • Includes all software updates • A limited number of free licenses available fornon-commercial developers who are not in academia • More details: http://academic.gremedy.com

  29. Questions / comments www.gremedy.com info (at) gremedy.com NVIDIA booth Tue-Thu

More Related