Debugging Tools Tim Purcell NVIDIA. Programming Soap Box Successful programming systems require at least three ‘tools’ Successful programming systems.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Programming with OpenGL - Getting started - Hanyang University Han Jae-Hyek.
Fragment level programmability in OpenGL Evan Hart
Teaching Cg. Real-Time Graphics Has Come a Long Way Virtua Fighter (SEGA Corporation) NV1 50K triangles/sec 1M pixel ops/sec 1995 Dead or Alive 3 (Tecmo.
GPGPU Programming Dominik G ö ddeke. 2Overview Choices in GPGPU programming Illustrated CPU vs. GPU step by step example GPU kernels in detail.
SharePoint Forms All you ever wanted to know about forms but were afraid to ask.
Introduction to HT-IDE3000 Micro-C development System Department.
COMPUTER GRAPHICS SOFTWARE.
CS 450 MPX P ROJECT Introduction to Turbo C. W HY USE T URBO C? Many ANSI C compilers are available for free, however they lack certain features that.
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
1 | Introducing GPU PerfStudio 2.0 | GDC 2009 Introducing AMD GPU PerfStudio 2.0 Next Generation GPU Performance Analysis & Debugging Tool from AMD GPG.
Normal Map Compression with ATI 3Dc™ Jonathan Zarge ATI Research Inc.
GLSL Basics Discussion Lecture for CS 418 Spring 2015 TA: Zhicheng Yan, Sushma S Kini, Mary Pietrowicz.
Graphics Pipeline.
Shading CMSC 435/634. RenderMan Light Displacement Surface Volume Imager.
The University of North Carolina - Chapel Hill COMP Spring GPGP - Background Lecture Graphics Pipelines, OpenGL, Fragment Programs, First.
A Crash Course on Programmable Graphics Hardware Li-Yi Wei 2005 at Tsinghua University, Beijing.
GPU Simulator Victor Moya. Summary Rendering pipeline for 3D graphics. Rendering pipeline for 3D graphics. Graphic Processors. Graphic Processors. GPU.
Some Things Jeremy Sugerman 22 February Jeremy Sugerman, FLASHG 22 February 2005 Topics Quick GPU Topics Conditional Execution GPU Ray Tracing.
Compilation, Architectural Support, and Evaluation of SIMD Graphics Pipeline Programs on a General-Purpose CPU Mauricio Breternitz Jr, Herbert Hum, Sanjeev.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Your Interactive Guide to the Digital World Discovering Computers 2012.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Real-time Graphical Shader Programming with Cg (HLSL)
Integrated Development Environments (IDEs) CS 21a: Introduction to Computing I First Semester,
Geometric Objects and Transformations. Coordinate systems rial.html.
GPU Computation Strategies & Tricks Ian Buck Stanford University.
GPU Shading and Rendering Shading Technology 8:30 Introduction (:30–Olano) 9:00 Direct3D 10 (:45–Blythe) Languages, Systems and Demos 10:30 RapidMind.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
Interactive Time-Dependent Tone Mapping Using Programmable Graphics Hardware Nolan GoodnightGreg HumphreysCliff WoolleyRui Wang University of Virginia.
Instructor Notes GPU debugging is still immature, but being improved daily. You should definitely check to see the latest options available before giving.
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
Debugging and Profiling With some help from Software Carpentry resources.
GPGPU Tools and Source Code Mark HarrisNVIDIA Developer Technology.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
The Cg Runtime Cyril Zeller. Cg Pipeline Graphics programs are written in Cg and compiled to low-level assembly code... Cg Runtime API...
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
NVIDIA FX Composer 2 Shader Authoring for Everyone Philippe Rollin Aravind Kalaiah.
Havok FX Physics on NVIDIA GPUs. Copyright © NVIDIA Corporation 2004 What is Effects Physics? Physics-based effects on a massive scale 10,000s of objects.
Ray Tracing using Programmable Graphics Hardware
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
How to use a Pixel Shader CMT3317. Pixel shaders There is NO requirement to use a pixel shader for the coursework though you can if you want to You should.
CST 1101 Problem Solving Using Computers
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
Programmable Pipelines
A Crash Course on Programmable Graphics Hardware
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
UMBC Graphics for Games
Graphics Processing Unit
Debugging Tools Tim Purcell NVIDIA.
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Presentation transcript:

Debugging Tools Tim Purcell NVIDIA

Programming Soap Box Successful programming systems require at least three ‘tools’ Successful programming systems require at least three ‘tools’ Compiler Compiler Cg, HLSL, GLSL, RTSL, Brook… Cg, HLSL, GLSL, RTSL, Brook… Debugger Debugger Profiler Profiler

Ideal Fragment Program Debugger Automate ‘printf’ debugging Automate ‘printf’ debugging

‘printf’ Debugging MOV suspect register to output MOV suspect register to output Comment out anything else writing to output Comment out anything else writing to output Scale and bias as needed Scale and bias as needed Recompile Recompile Display/readback frame buffer Display/readback frame buffer Check values Check values Repeat until error is (hopefully) found Repeat until error is (hopefully) found

‘printf’ Debugging Examples

Ideal Fragment Program Debugger Automate ‘printf’ debugging Automate ‘printf’ debugging Intuitive and easy to use interface Intuitive and easy to use interface Features over performance Features over performance Debuggers don’t need to be fast Debuggers don’t need to be fast Should still be interactive Should still be interactive Easy to add to existing apps Easy to add to existing apps And remove And remove Touch as little GPU state as possible Touch as little GPU state as possible Report actual hardware values Report actual hardware values No software simulations! No software simulations!

Debugger Features Per-pixel register watch Per-pixel register watch Including interpolants, outputs, etc. Including interpolants, outputs, etc. Breakpoints Breakpoints Fragment program interpreter Fragment program interpreter Single step forwards or backwards Single step forwards or backwards Execute modified code on the fly Execute modified code on the fly And save it And save it

Debugger Features - Visualization Display register value at each pixel Display register value at each pixel Color channel masking Color channel masking Arbitrary code for visualization Arbitrary code for visualization Allows scale and bias of values Allows scale and bias of values Multiple visualization windows Multiple visualization windows Visualize each source register and result Visualize each source register and result MUL R2, R1, R0; MUL R2, R1, R0; =x

Debugging Options Today Graphic Remedy gDebugger Graphic Remedy gDebugger GLIntercept - [D. Trebilco] GLIntercept - [D. Trebilco] Microsoft Shader Debugger Tool Microsoft Shader Debugger Tool Apple OpenGL Shader Builder Apple OpenGL Shader Builder Imdebug – The Image Debugger [B. Baxter] Imdebug – The Image Debugger [B. Baxter] Shadesmith – [T. Purcell, P. Sen] Shadesmith – [T. Purcell, P. Sen] Relational Debugging Engine [Duca et al. 2005] Relational Debugging Engine [Duca et al. 2005]

GPU Vendor Debugging Options ATI RenderMonkey ATI RenderMonkey Nvidia FXComposer Nvidia FXComposer Won’t talk about these today Won’t talk about these today

Graphic Remedy gDebugger Pros Pros Breakpoints, stepping Breakpoints, stepping Watch windows Watch windows Performance analysis Performance analysis OpenGL 2.0 OpenGL 2.0 Cons Cons OpenGL only OpenGL only Currently no program debugging Currently no program debugging

gDebugger

GLIntercept Pros Pros Track all OpenGL state Track all OpenGL state Runtime shader edit and recompile Runtime shader edit and recompile Resource tracking and management Resource tracking and management Cons Cons OpenGL only OpenGL only No shader debugging No shader debugging No direct support for visualizations No direct support for visualizations

GLIntercept

Microsoft Shader Debugger Tool Pros Pros Direct3D debugging integrated into Visual Studio IDE Direct3D debugging integrated into Visual Studio IDE Full featured Full featured Assembly and high level debugging Assembly and high level debugging Vertex and fragment programs Vertex and fragment programs Watches, breakpoints, etc. Watches, breakpoints, etc. Cons Cons Only works with software rasterizer Only works with software rasterizer Slow and painful Slow and painful D3D only D3D only Shader changes require recompilation Shader changes require recompilation us/directx9_c/directx/graphics/Tools/ShaderDebugger.asp us/directx9_c/directx/graphics/Tools/ShaderDebugger.asp

Apple OpenGL Shader Builder Pros Pros Integrated development environment Integrated development environment Handy reference guide, resource manager Handy reference guide, resource manager Texture editor Texture editor On the fly edit and display of shader changes On the fly edit and display of shader changes Cons Cons Canned geometry Canned geometry Basically a shader tool (in the traditional sense) Basically a shader tool (in the traditional sense) –not GPGPU debugger ARB vertex/fragment programs only ARB vertex/fragment programs only No vendor specific GL extensions support? No vendor specific GL extensions support?

imdebug Printf-style debugger Printf-style debugger imdebug("rgb w=%d h=%d %p", 16, 17, testRGB); imdebug("rgb w=%d h=%d %p", 16, 17, testRGB); Readback memory (texture/frame buffer) and display in image window Readback memory (texture/frame buffer) and display in image window

imdebug

imdebug Pros Pros Simple addition of single printf-style statement to programs Simple addition of single printf-style statement to programs Displays hardware computed values – not software generated values Displays hardware computed values – not software generated values Scale and bias Scale and bias Source available for download Source available for download Cons Cons Can’t breakpoint shaders Can’t breakpoint shaders Can only watch what shader outputs Can only watch what shader outputs

Shadesmith Debugger in the spirit of imdebug Debugger in the spirit of imdebug Simply add a debug statement when binding shaders Simply add a debug statement when binding shaders Display window with scale, bias, component masking Display window with scale, bias, component masking Advanced features Advanced features Can watch any shader register contents without recompile Can watch any shader register contents without recompile Shader single stepping (forward and backward), breakpointing Shader single stepping (forward and backward), breakpointing Shader source edit and reload without recompile Shader source edit and reload without recompile

Shadesmith Implementation Insight Only one register modified per instruction Only one register modified per instruction Ignore CC for now Ignore CC for now Decompose fragment program into several smaller programs Decompose fragment program into several smaller programs One program per assembly instruction One program per assembly instruction Save register state on host Save register state on host Iterative deepening decomposition Iterative deepening decomposition

Iterative Deepening... ADD R0, R1, f[WPOS]; MAD R1, R0, R2, R3; TEX R2, R1, TEX0, RECT;...

Iterative Deepening... ADD R0, R1, f[WPOS]; MAD R1, R0, R2, R3; MOV o[COLR], R1; END... ADD R0, R1, f[WPOS]; MAD R1, R0, R2, R3; TEX R2, R1, TEX0, RECT;...

Iterative Deepening... ADD R0, R1, f[WPOS]; MAD R1, R0, R2, R3; TEX R2, R1, TEX0, RECT; MOV o[COLR], R2; END Later code more expensive than early code... ADD R0, R1, f[WPOS]; MAD R1, R0, R2, R3; TEX R2, R1, TEX0, RECT;...

Basic Shadesmith Flow Decompose program into smaller programs Decompose program into smaller programs Use iterative deepening approach Use iterative deepening approach Run programs required to determine watch values Run programs required to determine watch values One program per value watched One program per value watched Readback modified register to host Readback modified register to host Via glReadPixels() Via glReadPixels() Display register values per pixel Display register values per pixel Visualization windows Visualization windows Per-pixel values on mouseover Per-pixel values on mouseover

Relational Debugging Engine Build database of GPU state Build database of GPU state Including pipeline state, shader state Including pipeline state, shader state SQL-like queries generate visualizations SQL-like queries generate visualizations Including vertex programs Including vertex programs Raw text output available as well Raw text output available as well Built on top of Chromium Built on top of Chromium Can debug any OpenGL application without recompilation Can debug any OpenGL application without recompilation Current system assumes Cg shaders Current system assumes Cg shaders Approach is applicable to other GPU languages Approach is applicable to other GPU languages

Relational Debugging Engine

Sketch Thursday 1:45-3:30 Room 515A Sketch Thursday 1:45-3:30 Room 515A