61
David Hart, Ankit Patel, NVIDIA New Features in OptiX 6.0

New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

  • Upload
    others

  • View
    27

  • Download
    1

Embed Size (px)

Citation preview

Page 1: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

David Hart, Ankit Patel, NVIDIA

New Features in OptiX 6.0

Page 2: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

2

AGENDA

OptiX Overview

New features in OptiX 6

OptiX Performance tips

OptiX Debugging tips

General OptiX improvements

Summary / Q&A

Page 3: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

3

NVIDIA OptiXfor CUDA

NVIDIA VKRayfor Vulkan

Microsoft DXRfor DX12

Applications

NVIDIA® RTX™ Technology

NVIDIA GPU

NVIDIA RTX TECHNOLOGY

Page 4: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

4

10 years of work in computer graphics algorithms and GPU architectures

Page 5: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

5

OptiX Rendering Applications

PRODUCT DESIGNMEDIA & ENTERTAINMENT ARCHITECTURE

Courtesy of Image Engine. © NETFLIX Courtesy RED HYDROGEN - Media Machine Courtesy of Kohn Pedersen Fox

Page 6: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

6

BROAD SUPPORT FOR NVIDIA RTXRTX COMES TO 9M 3D CREATORS IN 2019

Page 7: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

7 Courtesy RED HYDROGEN - Media Machine

Courtesy of Autodesk

Courtesy of Sohrab Esfehani 

Courtesy Vladimir Petkovic Courtesy of Ian Spriggs

Courtesy of Mickael Riccoitti

Page 8: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

8

OptiX Scientific Applications

ELECTROMAGNETIC SIMULATIONS

FLUID DYNAMICS SOUND PROPOGATION[VRWORKS AUDIO]

Courtesy of Image Engine. © NETFLIX

Page 9: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

9

RT Cores

Traversal● Hardware accelerated with RT Cores● Includes custom primitives

Triangle intersection● Only works with triangles● Requires OptiX triangle API

Page 10: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

10

TerminologyRT Cores:- New in Turing- Hardware for ray traversal & ray-triangle intersection

RTX Software:- Technology stack for ray tracing- Driver software NVIDIA OptiX

for CUDANVIDIA VKRay

for VulkanMicrosoft DXR

for DX12

Applications

NVIDIA® RTX™ Technology

NVIDIA GPU

Page 11: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

11

OptiX deliveryOptiX SDK package contents

HeadersDocumentationSamplesLibraries

optix.51.dll [~40MB]optix.6.0.0.dll [~200KB]

Page 12: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

12

OptiX deliveryOptiX SDK package contents

HeadersDocumentationSamplesLibraries

optix.51.dll [~40MB]optix.6.0.0.dll [~200KB]

OptiX in NVIDIA drivernvoptix.dll

Page 13: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

13

AGENDA

OptiX Overview

New features in OptiX 6

OptiX Performance tips

OptiX Debugging tips

General OptiX improvements

Summary / Q&A

Page 14: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

14

OptiX Programming Model

You provide: A rendererCUDA programs for: Rays, Geometry, Shading, Miss, Exception

OptiX provides: plumbingCompilation, scheduling, traversal, memory management, etc.

OptiX does not make assumptions about yourinput data, output data, or algorithms

Page 15: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

15

OptiX Programs

Ray Generation

Intersection

Bounding Box

Closest Hit

Miss

Any Hit

* per entry point * per geometric primitive type

* per ray type

Page 16: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

16

Ray Generation

Any Hit

Intersection

Closest HitMiss

HIT

Scene Traversal

rtTrace()

YESNO

OptiX Program Model

Page 17: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

17

Getting Started with OptiX

developer.nvidia.com/optix

Tutorial (“Introduction to NVIDIA OptiX”, GTC 2018)

OptiX 6 Programming Guide

SDK samples

OptiX advanced samples (github)

Forum developer.nvidia.com/optix-forums

Page 18: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

18

AGENDA

OptiX Overview

New features in OptiX 6

OptiX Performance tips

OptiX Debugging tips

General OptiX improvements

Summary / Q&A

Page 19: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

19

New in OptiX 6

=> Support for RT Cores

RTX API: Maxwell+RT Cores: Turing+New Triangle API for hardware accelerated meshesNew attribute programsNew API for stack sizes, rtTrace, and morertTrace from bindless callable programsSeparate & parallel compilation of shadersMulti-GPU improvementsDenoiser is Turing accelerated

Page 20: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

20

Triangle API

OptiX interface to RTX (built-in) triangle intersection

No bounds program or intersection program needed

New “attribute program” lets you compute attributes for shading

Page 21: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

21

Attribute Programs

Compute intersection data for shaders

There is a default attribute program that produces U & V

You get barycentrics, then compute your own attributesshading normals, etc…

See:[host] rtGeometryTrianglesSetAttributeProgram()[device] rtGetPrimitiveIndex()[device] rtGetTriangleBarycentrics()

Page 22: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

22

Triangle API Example: OptiXMesh.cppoptix::GeometryTriangles geom_tri = ctx->createGeometryTriangles();geom_tri->setPrimitiveCount( mesh.num_triangles );geom_tri->setTriangleIndices( buffers.tri_indices, RT_FORMAT_UNSIGNED_INT3 );geom_tri->setVertices( mesh.num_vertices, buffers.positions, buffers.positions->getFormat() );

geom_tri->setAttributeProgram( createAttributesProgram( ctx ) );

size_t num_matls = optix_materials.size();geom_tri->setMaterialCount( num_matls );geom_tri->setMaterialIndices( buffers.mat_indices, 0, sizeof( unsigned ), RT_FORMAT_UNSIGNED_INT );

optix_mesh.geom_instance = ctx->createGeometryInstance();optix_mesh.geom_instance->setGeometryTriangles( geom_tri );

// Set the materialsoptix_mesh.geom_instance->setMaterialCount( num_matls );for( size_t idx = 0; idx < num_matls; ++idx ){ optix_mesh.geom_instance->setMaterial( idx, optix_materials[idx] );}

Page 23: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

23

Stack sizesNew API calls:

rtContextSetMaxTraceDepth()

rtContextSetMaxCallableProgramDepth()

Default is 5. Reduce them when you can. Max. is 31

In RTX Mode, rtContextSetStackSize() has no effect

Page 24: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

24

rtTrace from bindless callables

You can now call rtTrace() from inside a bindless callable program

They cost a little bit more than inline code

so balance your usage

Details are covered in the OptiX Programming Guide

“Calling rtTrace from a bindless callable program”

Page 25: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

25

rtTrace flags

Two new optional flags

rtTrace( topNode, ray, prd, RTvisibilitymask mask=RT_VISIBILITY_ALL, RTrayflags flags=RT_RAY_FLAG_NONE )

Page 26: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

26

rtTrace: 8 bit visibility mask

Hide/show geometry -- hardware support for skipping sub-trees

Allows for up to 8 visibility sets, replaces selectors & visit programs

See:rtGroupSetVisibilityMask()rtGeometryGroupSetVisibilityMask()

To use:rtTrace(top_object, ray, per_ray_data, mask=0xFF)

Page 27: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

27

rtTrace: ray flags

rtTrace( topNode, ray, prd, RTvisibilitymask mask=RT_VISIBILITY_ALL, RTrayflags flags=RT_RAY_FLAG_NONE )

RT_RAY_FLAG_DISABLE_ANYHITRT_RAY_FLAG_FORCE_ANYHITRT_RAY_FLAG_TERMINATE_ON_FIRST_HITRT_RAY_FLAG_DISABLE_CLOSESTHITRT_RAY_FLAG_CULL_BACK_FACING_TRIANGLESRT_RAY_FLAG_CULL_FRONT_FACING_TRIANGLESRT_RAY_FLAG_CULL_DISABLED_ANYHITRT_RAY_FLAG_CULL_ENABLED_ANYHIT

Copyright 2008 Lauren ManningCC BY 2.0 https://flic.kr/p/4QmeKr

Page 28: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

28

New geometry flags

RTgeometryflagsrtGeometrySetFlags()rtGeometryTrianglesSetFlagsPerMaterial()

RT_GEOMETRY_FLAG_DISABLE_ANYHITRT_GEOMETRY_FLAG_NO_SPLITTING

RTinstanceflagsrtGeometryGroupSetFlags()

RT_INSTANCE_FLAG_DISABLE_TRIANGLE_CULLINGRT_INSTANCE_FLAG_FLIP_TRIANGLE_FACING RT_INSTANCE_FLAG_DISABLE_ANYHIT RT_INSTANCE_FLAG_FORCE_ANYHIT

Page 29: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

29

Triangle API + Motion Blur

Use rtGeometryTrianglesSetMotionVertices()instead of rtGeometryTrianglesSetVertices()

Motion blur currently requires SM traversalin the motion BVH & parent BVH

You can mix motion BVHs and static BVHsThe static BVHs will use RT Core traversalTry not to mix in the same Geometry Group

Page 30: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

30

AGENDA

OptiX Overview

New features in OptiX 6

OptiX Performance tips

OptiX Debugging tips

General OptiX improvements

Summary / Q&A

Page 31: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

31

Performance with RT Cores

Don’t forget Amdahl's Law

For RT Core speedup to be big, you need to be traversal bound

Both obvious and easy to forget

Imagine 50-50 shade vs traverse+intersect

Page 32: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

32

RT Cores

● Workload

● Scene Hierarchy

● Memory Traffic

● Round Trips

Page 33: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

33

Highest Performance Workloads

Coherent rays are betterPrimary rays

Short rays are betterAO / small t_max

Simple shadingtrivial shading, e.g., diffuse or normal

Big batchesCopyright 2007 Jared Tarbell

CC BY 2.0 https://flic.kr/p/2rgLnc

Page 34: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

34

Scene hierarchy

Hardware support for 1 level of instancingYou get 1 for free!

?

?

Page 35: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

35

Memory Traffic

RTX 6000 memory bandwidth: 672 GB/sec

672 GB/sec ÷ 10 GRays/sec = 67.2 bytes / ray

Includes traversal

It’s easy to exceed this budget in shaders

Copyright 2007 David González RomeroCC BY 2.0 https://flic.kr/p/44pqZf

Page 36: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

36

SM + RT Core round-trips

Some features run CUDA code mid-traversal

Let’s build a mental model of how the SMs & RT Cores interact

SM RT

Page 37: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

37

OptiX 5 traversal

12

3

5

4

6

7

8

SM 1:RG 2:TL 3:TL 4:IS 5:IS 6:TL 7:IS 8:IS 8:CH

“Mega” Kernel

Page 38: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

38

RTX traversal: custom primitives

12

3

5

4

6

7

8

RT 2:TL 3:TL 6:TL

SM 1:RG 4:IS 5:IS 7:IS 8:IS 8:CH

*NB: conceptual model of execution, not timing.

Page 39: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

39

RTX traversal: hardware triangles

12

3

5

4

6

7

8

RT 2:TL 3:TL 6:TL

SM 1:RG

4:IS 5:IS 7:IS 8:IS

8:CH

Page 40: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

40

RTX traversal: any-hit

1

23 5

46

78

RT 2:TL 3:TL 6:TL

SM 1:RG

4:IS 5:IS 7:IS 8:IS

4:AH 5:AH 7:AH 8:AH

Page 41: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

41

RTX traversal: 1 level instancing (2 lvl scene)

1

23 5

46

78

RT 2:TL 3:TL 6:TL

SM 1:RG

4:IS 5:IS 7:IS 8:IS3:XF 6:XF

Page 42: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

42

RTX traversal: 2 level instancing (3 lvl scene)

1

23 5

46

78

RT 2:TL 3:TL 6:TL

SM

4:IS 5:IS 7:IS 8:IS

3:XF 6:XF2:XF

Page 43: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

43

RTX traversal: the ideal

12

3

5

4

6

7

8

RT 2:TL 3:TL 6:TL

SM 1:RG

4:IS 5:IS 7:IS 8:IS

8:CH

The goal: uninterrupted traversal on RT core

Page 44: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

44

RTX Traversal: summary

Triangle API + RTX => 2x-10x faster -- first step to gigarays

Things that can impact RT Core traversal:intersection programany-hit program2 or more levels of instancingmotion blur

Shadow rays tend to be faster. (re-evaluate balance of shadow rays)

Page 45: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

45

Any-hit & early termination

Disable any-hit if you don’t need it!Use one of the *_DISABLE_ANYHIT instance or ray flags

For shadow-like rays and built-in triangles, we now recommendclosest-hit & rtTrace(,,,, RT_RAY_FLAG_TERMINATE_ON_FIRST_HIT)

For shadow-like rays and custom intersectioncontinue to use any-hit & call rtTerminateRay()

Page 46: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

46

Continuations: callables & rtTrace

The compiler wraps callable program & rtTrace invocations in continuations, which take longer to compile, and consume registers.

Seize the opportunity if you see ways to trim

Calls very early or very late are better than right in the middlegoal: less live state, think about tail-recursion

Page 47: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

47

Achieving High Performance in OptiX

Peak RT Core throughput depends on your workload

Be judicious with:● traversal depth● complex shading● use of any_hit for cut-outs● motion blur

NB: # of polygons is less relevant!

Page 48: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

48

AGENDA

OptiX Overview

New features in OptiX 6

OptiX Performance tips

OptiX Debugging tips

General OptiX improvements

Summary / Q&A

Page 49: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

49

Common pitfalls in OptiXCrash?

Stack overrunIncrease stack size

Indexing user data out of boundsEnable exceptions & add bounds checks*

Copyright 2013 Ozzy DelaneyCC BY 2.0 https://flic.kr/p/ehadnq

Page 50: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

50

Common pitfalls in OptiX

Slow start?

shader compilationavoid dynamic program selection

large number of instances / scene graphmerge meshes, flatten scene

Page 51: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

51

Common pitfalls in OptiXSlow trace?

deep instancing: flatten / merge / bake, when you canlarge ray payload: trim payloadlarge any-hit program: trim / remove any-hit

use closest-hit w/ flagslarge number of variable updates:

use a buffer insteadshader re-compilationshader complexitymove callable programs to inline code*memory traffic & payload size

Page 52: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

52

OptiX debugging tips

Turn on exceptions rtContextSetExceptionEnabled()

Add an exception program rtContextSetExceptionProgram()

Print exception details rtPrintExceptionDetails()

Turn on usage report rtContextSetUsageReportCallback()

Page 53: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

53

OptiX 6 Known Issues

- Motion blur is not supported with no-accel enabled in RTX Mode

- Selectors not implemented in RTX Mode, use visibility masks instead.

- Nsight can not (yet) profile OptiX in RTX Mode. Coming soon.

Page 54: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

54

AGENDA

OptiX Overview

New features in OptiX 6

OptiX Performance tips

OptiX Debugging tips

General OptiX improvements

Summary / Q&A

Page 55: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

55

General OptiX improvements

Behind the scenes, OptiX 6 improved:

Separate & parallel shader compilation

BVH build times

BVH memory

Denoiser perf

Page 56: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

56

RTX Acceleration Structures

They are faster, ~80Mtris/sec buildRe-fit is usually >= 10x faster than buildBVH format is set automatically when using RTX Mode

BVH compaction: may save 1.5x-2x on memory in return for ~+10% build timeTo disable: rtAccelerationSetProperty( accel, "compact", "0" );

Page 57: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

57

Multi-GPU

OptiX 6 adds RTX support for multiple GPUs

Geometry & BVH replicateTextures replicate until memory gets tight,=> N GPUs are usually ~N x faster, but usually not N x memory

Simplified load balancingNo mixing Turing and pre-Turing devicesFor best performance: Use NVLINK & homogeneous GPUs

Slow GPUs bottleneck fast GPUsHeterogeneous GPUs can trigger multiple compiles.

Page 58: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

58

AGENDA

OptiX Overview

New features in OptiX 6

OptiX Performance tips

OptiX Debugging tips

General OptiX improvements

Summary / Q&A

Page 59: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

59

Best practices in OptiX

When possible…

● Use built-in triangles, instead of AABB & intersect programs● Flatten your scene to zero or one level of instancing● Share bottom level structures / merge meshes to a single bottom level structure● Use BVH refit instead of rebuilding● Distribute accel refits over multiple frames / update lazily, only when needed● Minimize payload size, attribute size, and trace recursion depth● Use closest-hit instead of any-hit with built-in triangles● Do use any-hit for cut-outs. (NB any-hit is out of order, may not be closest)● Pay attention to dependent memory access when reading vertex & material data.

Page 60: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

60

Summary

● RT Core support

● For fast trace, “Feed The RT Cores”○ Triangle api, one level of instancing○ Use sparingly: any-hit, deep hierarchy, motion blur

● New API: attribute programs, stack sizes, callable programs● Improvements to: BVH, compilation, multi-GPU, denoiser● OptiX runtime in the driver

Page 61: New Features in OptiX 6.0 David Hart, Ankit Patel, NVIDIA · 57 Multi-GPU OptiX 6 adds RTX support for multiple GPUs Geometry & BVH replicate Textures replicate until memory gets

Questions?