printf Debugging Examples

Similar documents
Developer Tools. Robert Strzodka. caesar research center Bonn, Germany

Introduction to Shaders.

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Programmable Graphics Hardware

Lecture 2. Shaders, GLSL and GPGPU

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

Lecture 13: OpenGL Shading Language (GLSL)

Performance Tools. Raul Aguaviva, Sim Dietrich, and Sébastien Dominé

Shaders. Slide credit to Prof. Zwicker

GPGPU. Peter Laurens 1st-year PhD Student, NSC

The Ultimate Developers Toolkit. Jonathan Zarge Dan Ginsburg

Siggraph Agenda. Usability & Productivity. FX Composer 2.5. Usability & Productivity 9/12/2008 9:16 AM

12.2 Programmable Graphics Hardware

Programmable Graphics Hardware

What s New with GPGPU?

NVIDIA Nsight Visual Studio Edition 4.0 A Fast-Forward of All the Greatness of the Latest Edition. Sébastien Dominé, NVIDIA

Shaders CSCI 4229/5229 Computer Graphics Fall 2017

Shaders CSCI 4239/5239 Advanced Computer Graphics Spring 2014

Graphics Hardware. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 2/26/07 1

Could you make the XNA functions yourself?

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

Cg 2.0. Mark Kilgard

Squeezing Performance out of your Game with ATI Developer Performance Tools and Optimization Techniques

NVIDIA Authoring Tools for

OpenGL Performance Tools

Mikkel Gjøl Graphics

Graphics Hardware. Instructor Stephen J. Guy

NVIDIA Developer Tools for Graphics and PhysX

A Relational Debugging Engine for the Graphics Pipeline

Prospects for a more robust, simpler and more efficient shader cross-compilation pipeline in Unity with SPIR-V

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

CS427 Multicore Architecture and Parallel Computing

General Purpose computation on GPUs. Liangjun Zhang 2/23/2005

Shader Series Primer: Fundamentals of the Programmable Pipeline in XNA Game Studio Express

GPU Performance Tools

frame buffer depth buffer stencil buffer

Sung-Eui Yoon ( 윤성의 )

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

1.2.3 The Graphics Hardware Pipeline

COMP371 COMPUTER GRAPHICS

SHADER PROGRAMMING. Based on Jian Huang s lecture on Shader Programming

NVIDIA FX Composer. Developer Presentation June 2004

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

CSE 591: GPU Programming. Introduction. Entertainment Graphics: Virtual Realism for the Masses. Computer games need to have: Klaus Mueller

GPU Memory Model. Adapted from:

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

Why modern versions of OpenGL should be used Some useful API commands and extensions

CS GPU and GPGPU Programming Lecture 7: Shading and Compute APIs 1. Markus Hadwiger, KAUST

Today. Rendering - III. Outline. Texturing: The 10,000m View. Texture Coordinates. Specifying Texture Coordinates in GL

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

Cg Toolkit. Cg 2.0 January 2008 Release Notes

Programming shaders & GPUs Christian Miller CS Fall 2011

CS450/550. Pipeline Architecture. Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012

NVIDIA Parallel Nsight. Jeff Kiel

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

Shaders (some slides taken from David M. course)

INF Utilizing Ubiquitous Commodity Graphics Hardware for Scientific Computing. Bjørn-Hugo Nilsen. October 2007

EDAF80 Introduction to Computer Graphics. Seminar 3. Shaders. Michael Doggett. Slides by Carl Johan Gribel,

CSE 591/392: GPU Programming. Introduction. Klaus Mueller. Computer Science Department Stony Brook University

Cg Toolkit. Cg 2.0 May 2008 Release Notes

EECS 487: Interactive Computer Graphics

Mali Developer Resources. Kevin Ho ARM Taiwan FAE

Mention driver developers in the room. Because of time this will be fairly high level, feel free to come talk to us afterwards

Mobile graphics API Overview

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Introduction to OpenGL

RenderMonkey 1.6. Natalya Tatarchuk ATI Research

OpenGL View Library. Supervised by: Martin Madaras

Basics of GPU-Based Programming

Getting fancy with texture mapping (Part 2) CS559 Spring Apr 2017

WebGL and GLSL Basics. CS559 Fall 2016 Lecture 14 October

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

Lecture 25: Board Notes: Threads and GPUs

developer.nvidia.com The Source for GPU Programming

Practical Performance Analysis Koji Ashida NVIDIA Developer Technology Group

PROFESSIONAL VR: AN UPDATE. Robert Menzel, Ingo Esser GTC 2018, March

Bringing AAA graphics to mobile platforms. Niklas Smedberg Senior Engine Programmer, Epic Games

Cg: A system for programming graphics hardware in a C-like language

Order Matters in Resource Creation

Shader Programming CgFX, OpenGL 2.0. Michael Haller 2003

Direct Rendering of Trimmed NURBS Surfaces

AMD gdebugger 6.2 for Linux

OpenGL ES 2.0 : Start Developing Now. Dan Ginsburg Advanced Micro Devices, Inc.

GPU Computation Strategies & Tricks. Ian Buck NVIDIA

Understanding Shaders and WebGL. Chris Dalton & Olli Etuaho

TEAPOT: A Toolset for Evaluating Performance, Power and Image Quality on Mobile Graphics Systems

CS179 GPU Programming Introduction to CUDA. Lecture originally by Luke Durant and Tamas Szalay

A Survey of General-Purpose Computation on Graphics Hardware

Spring 2009 Prof. Hyesoon Kim

Homework 3: Programmable Shaders

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL

Profiling and Debugging Games on Mobile Platforms

Tutorial on GPU Programming. Joong-Youn Lee Supercomputing Center, KISTI

Working with Metal Overview

EE , GPU Programming

Transcription:

Programming Soap Box Developer Tools Tim Purcell NVIDIA Successful programming systems require at least three tools High level language compiler Cg, HLSL, GLSL, RTSL, Brook Debugger Profiler Debugging Ideal Fragment Program Debugger Automate printf debugging printf Debugging MOV suspect register to output Comment out anything else writing to output Scale and bias as needed Recompile Display/readback frame buffer Check values Repeat until error is (hopefully) found printf Debugging Examples 1

printf Debugging Examples printf Debugging Examples printf Debugging Examples Ideal Fragment Program Debugger Automate printf debugging Intuitive and easy to use interface Features over performance Debuggers don t need to be fast Should still be interactive Easy to add to existing apps And remove Touch as little GPU state as possible Report actual hardware values No software simulations! Debugger Features Per-pixel register watch Including interpolants, outputs, etc. Breakpoints Fragment program interpreter Single step forwards or backwards Execute modified code on the fly And save it Debugger Features - Visualization Display register value at each pixel Color channel masking Arbitrary code for visualization Allows scale and bias of values Multiple visualization windows Visualize each source register and result MUL R2, R1, R0; = x 2

Debugging Options Today Graphic Remedy gdebugger GLIntercept - [D. Trebilco] Microsoft Shader Debugger Tool Apple OpenGL Shader Builder Imdebug The Image Debugger [B. Baxter] Shadesmith [T. Purcell, P. Sen] Relational Debugging Engine [Duca et al. 2005] GPU Vendor Debugging Options ATI RenderMonkey Nvidia FXComposer Won t talk about these today Graphic Remedy gdebugger Breakpoints, stepping Watch windows Performance analysis OpenGL 2.0 OpenGL only Currently no program debugging http://www.gremedy.com/ gdebugger GLIntercept Track all OpenGL state Runtime shader edit and recompile Resource tracking and management OpenGL only No shader debugging No direct support for visualizations http://glintercept.nutty.org/ GLIntercept 3

Microsoft Shader Debugger Tool Direct3D debugging integrated into Visual Studio IDE Full featured Assembly and high level debugging Vertex and fragment programs Watches, breakpoints, etc. Only works with software rasterizer Slow and painful D3D only Shader changes require recompilation http://msdn.microsoft.com/library/default.asp?url=/library/enus/directx9_c/directx/graphics/tools/shaderdebugger.asp Apple OpenGL Shader Builder Integrated development environment Handy reference guide, resource manager Texture editor On the fly edit and display of shader changes Canned geometry Basically a shader tool (in the traditional sense) not GPGPU debugger ARB vertex/fragment programs only No vendor specific GL extensions support? http://developer.apple.com/graphicsimaging/opengl/shader_image.html imdebug Printf-style debugger imdebug("rgb w=%d h=%d %p", 16, 17, testrgb); Readback memory (texture/frame buffer) and display in image window imdebug http://www.billbaxter.com/projects/imdebug/ imdebug Simple addition of single printf-style statement to programs Displays hardware computed values not software generated values Scale and bias Source available for download Can t breakpoint shaders Can only watch what shader outputs Shadesmith Debugger in the spirit of imdebug Simply add a debug statement when binding shaders Display window with scale, bias, component masking Advanced features Can watch any shader register contents without recompile Shader single stepping (forward and backward), breakpointing Shader source edit and reload without recompile http://graphics.stanford.edu/projects/shadesmith/ 4

Shadesmith Implementation Insight Only one register modified per instruction Ignore CC for now Decompose fragment program into several smaller programs One program per assembly instruction Save register state on host Iterative deepening decomposition Iterative Deepening Iterative Deepening Iterative Deepening MOV o[colr], R1; END MOV o[colr], R2; END Later code more expensive than early code Basic Shadesmith Flow Decompose program into smaller programs Use iterative deepening approach Run programs required to determine watch values One program per value watched Readback modified register to host Via glreadpixels() Display register values per pixel Visualization windows Per-pixel values on mouseover Relational Debugging Engine Build database of GPU state Including pipeline state, shader state SQL-like queries generate visualizations Including vertex programs Raw text output available as well Built on top of Chromium Can debug any OpenGL application without recompilation Current system assumes Cg shaders Approach is applicable to other GPU languages 5

Relational Debugging Engine Profiling Profiling Not much from 3 rd parties GPU Architecture internals mostly secret ATIPixPlugin NVPerfHUD NVPerfKit Supported by gdebugger 2.0 release ATIPixPlugin NVPerfHUD NVPerfKit Instrumented Driver OpenGL and Direct3D support NVIDIA Developer Control Panel NVIDIA Plug-in for Microsoft PIX for Windows Access to performance counters via PDH Support for PerfMon, VTune, gdebugger, and more 6

NVPerfKit 7