Advances in Ray Tracing Developer Tools
March 21th, 2024 | S62398
Aurelio Reis | Director, NVIDIA Graphics Developer Tools
1
Agenda
1 Introduction
2 The Game Development Journey
3 Developer GPU Challenges
4 Advances In Tools
5 Case Studies
6 Conclusion + Q&A
2
The Game Development Journey
3
Game Development in 2024
Some New Challenges, Some Old Challenges, Many New Opportunities
Ideation Pre-Production Production Finalization Shipped
Cost
4
Game Development in 2024
Some New Challenges, Some Old Challenges, Many New Opportunities
Cheating
Continuous Content Delivery
AI/ML for Content Creation
Photorealistic Rendering vs Performance
Building Larger/More Complex Worlds
AI/ML for Autonomous Agents
Security
AI/ML for Graphics
Increasing Costs of Development
Alan Wake 2 | Remedy
Growing Load Times Cyberpunk 2077 | CD Projekt Red
Bugs & QA
Multi-Platform Development
5
2024: Ray Path Tracing in Games
Light Years Beyond Hybrid Ray Tracing
Alan Wake 2 | Remedy
Cyberpunk 2077 | CD Projekt Red
6
Technologies
• NVIDIA Ada Lovelace Architecture
• Path Tracing SDK
• RTXDI
• DLSS 3.5
• DLSS-FG
• DLSS-RR
• Reflex
• ACE
• Remix
Alan Wake 2 | Remedy
• SER (Shader Execution Reordering)
Cyberpunk 2077 | CD Projekt Red
7
Developer GPU Challenges
8
Developer GPU Challenges in 2024
Just Make It Faster, Less Buggy, Prettier. Easy Right?
Asynchronous Workloads
GPU Crashes
Memory Management
Slow Streaming/Load Times
Shader Programming
Ray Tracing Bugs
GPU Performance Issues
Alan Wake 2 | Remedy
GPU/CPU Bottlenecks Ray Tracing Performance
API Complexity
9
Developer Tools
Nsight Systems Nsight Graphics Nsight Aftermath
Nsight Perf SDK
10
Graphics Triage Workflow
Nsight Systems
Comprehensive workload-level analysis
Performance Yes
Game Issue? Yes
Start Here No No Finished
GPU limited? CPU limited? (for now)
Rendering Yes
Issue?
Yes
Nsight Graphics
Detailed graphics debugging/profiling
Rendering Fixed
11
Advances In Tools
12
Nsight Systems
Collect multiple seconds or minutes of trace data
CPU Core Utilization
GPU Scheduling
GPU HW Metrics
GPU Memory
Stutter Analysis
GPU Memory
CPU Sampling Profiler
w/ Call Stacks
CPU Tracing of GPU APIs
13
Nsight Systems
Powerful Memory Inspection Features
Allocated VRAM
w/ Physical Watermark
Resource Allocations
14
Nsight Systems 2024.2
New features
OpenXR Trace
D3D12 Work Graphs trace
System-wide trace of D3D12 and Vulkan (attach to multiple running apps)
15
Nsight Systems 2024.2
VRAM Demotions in D3D12
Excessive commitment of resources to VRAM memory causes memory demotion.
Nsight Systems visualizes resource migration from VRAM to SYSMEM (Green to Red migration on the timeline)
16
Nsight Systems 2024.2
Stutter caused by Resource Migration
17
Nsight Graphics
Empower Your Next-Gen Graphics
Debugging: Windows
C++ Frame Serialization Linux
Resource Viewer Android
Pixel History LuminOS
API inspection
GPU Crashes x64
ARM
Profiling:
GPU Trace
Shader Profiler D3D+11/12, DXR
Shader Timing Heatmap Vulkan 1.2, VRT
OpenGL 4.6
18
Nsight Graphics in 2023
What's The Story So Far?
• Opacity Micromap Support
• Ray Tracing Inspector
• DirectStorage Support
• D3D12 Work Graphs Support
• GPU Trace: Realtime Shader Profiler
• GPU Trace (Frameless Traces)
• Instruction Stats for GPU Trace
• Loads of Vulkan Extensions...
• So. Many. Bugs.
19
Nsight Graphics 2024.1
Starting Out The Year Strong
GPU Trace: Events List
20
Nsight Graphics 2024.1
Starting Out The Year Strong
GPU Trace: Incomplete Data Visualization
21
Nsight Graphics 2024.1
Starting Out The Year Strong
GPU Trace: Trace Analysis Improvements
22
Nsight Graphics 2024.1
Starting Out The Year Strong
GPU Trace: Real-Time Shader Profiler
Export to CSV
Improved Line Mappings
Hotspots view improvements
Shader Pipelines View improvements
General UI/UX improvements
23
Shader Debugging In 2023
24
Introducing the All-New Nsight Shader Debugger!
25
Nsight Shader Debugger
Because Writing Large Shaders Is Challenging
A fully HW accelerated GPU shader debugger
All code is running on the GPU, no CPU side emulation
• Supported APIs
Vulkan & Vulkan Ray Tracing
D3D12 & DXR soon!
• Features
HW Based
Conditional breakpoints
Step in/out/over
Locals/Watch variable inspection
Warps stopped per-line
Focus Picker
• Considerations
2 GPUs a required: 1 for system rendering and 1 for GPU debugging
Must compile shaders with debug symbols (good 'ole "-g" / "-Zi")
Must run tool in Administrator mode
26
Nsight Shader Debugger
2 GPUs Are Required
1 System, 2 GPUs 2 Systems, 1 GPU Each
Remote Connection
Host & Target Host Target
27
Nsight Shader Debugger
Because Writing Large Shaders Is Challenging
Focus Picker
28
Nsight Shader Debugger
Because Writing Large Shaders Is Challenging
Locals
Warp Info
Source Code
& Breakpoints
29
Nsight Shader Debugger
Because Writing Large Shaders Is Challenging
Conditional
Breakpoints
Breakpoints List
30
Nsight Shader Debugger
Because Writing Large Shaders Is Challenging
What's Next?
• Public Launch
• Nsight Shader Debugger SDK
• D3D12/DXR Support
• Work Graphs Support
• Mesh Shader Support
• DebugBreak via code??
• and... what would you like to see?
31
Nsight Aftermath
GPU Crashes Happen, Find Out Why
Faulting Warps
MMU Fault Identification
Source Line Correlation
32
Nsight Aftermath 2024.1
Full Resource History
33
Ray Tracing Inspector
● Visualize acceleration structures ● Navigate through the scene
● Analyze build flags ● Expose raw buffer data
34
Ray Tracing Inspector
● View traversal timing heatmaps ● Observe overlapping AABBs
● Hide & show geometry ● Change build flags
35
Case Studies
36
Ray Tracing Inspector with Alan Wake 2
(Remedy Entertainment)
● Poor performance in this underground scene
● Sorting by primitive count unveils some suspicious geometry
37
Ray Tracing Inspector with Alan Wake 2
38
Comparison of Traversal Heatmaps
Before After
Max Traversal Time: 38,000,000 clock cycles Max Traversal Time: 490,000 clock cycles
options options
39
GPU Trace: Real-Time Shader Profiler
40
GPU Trace: Real-Time Shader Profiler
Path tracing regime
41
GPU Trace: Real-Time Shader Profiler
Unit throughputs on timeline
42
GPU Trace: Real-Time Shader Profiler
Avg unit throughputs
43
GPU Trace: Real-Time Shader Profiler
SM occupancy with warp types
44
GPU Trace: Real-Time Shader Profiler
SM occupancy with warp types
45
GPU Trace: Real-Time Shader Profiler
No symbols
46
The Importance Of Shader Symbols
A quick PSA about Debug Symbols
Without Debug Info
• Debug Symbols are required for the tools to map
intermediate code to high level shader code.
• Without symbols you are left with intermediate code
or low-level assembly (called SASS in NVIDIA GPUs)
• Check out this great blog post by NVIDIA DevTech
With Debug Info
Louis Bavoil that goes into detail on why debug
symbols are so important and how to ensure that you
are generating them:
47
GPU Trace: Real-Time Shader Profiler
Sample distribution
48
GPU Trace: Real-Time Shader Profiler
Avg latency
49
GPU Trace: Real-Time Shader Profiler
Sample distribution
50
GPU Trace: Real-Time Shader Profiler
Any hit shader
51
GPU Trace: Real-Time Shader Profiler
Triangle normal used in anyhit
52
GPU Trace: Real-Time Shader Profiler
Normal used for alpha test?
53
GPU Trace: Real-Time Shader Profiler
Material
54
GPU Trace: Real-Time Shader Profiler
Material alpha is sampled using SampleGrad
55
Conclusions + Q&A
56
We're Hiring!
Graphics Developer Tools Software Engineer JR1976690
Graphics Profiler Tools Software Engineer JR1981013
57
Conclusions
Development Is Hard But We're Here to Make It Easier
• Find issues in shaders and fix bugs faster using a good Shader Debugger
• Use the Ray Tracing Inspector to ensure that your ray tracing backend is working properly
• Nsight Aftermath should be integrated into your application to help find and fix GPU crashes
• GPU Trace and the Realtime Shader Profiler are essential tools for analyzing performance
• Performance analysis is an ongoing process -- analyze, iterate and repeat to reach your target
• There are lots of resources available if you want to learn more about ray tracing, including the
free Ray Tracing Gems II eBook:
58
THANK YOU!
Questions?
@AurelioReis @NVIDIAGameDev
Get it at developer.nvidia.com/nsight-graphics
Contact us at NsightGraphics@nvidia.com
File bugs using the Feedback Button
Learn & explore by using the integrated samples
Check out more videos on YouTube: search 'NVIDIA Developer'
59