Opticks : GPU Optical Photon Simulation for Particle Physics with NVIDIA OptiX

Integration of JUNO simulation framework with Opticks : GPU accelerated optical propagation via NVIDIA® OptiX™

Open source, https://bitbucket.org/simoncblyth/opticks

Simon C Blyth, IHEP, CAS — On behalf of the JUNO Collaboration — vCHEP, 19 May 2021


Outline

/env/presentation/newtons-opticks.png
 


JUNO_Intro_2


Optical Photon Simulation Problem...









Optical Photon Simulation ≈ Ray Traced Image Rendering

simulation
photon parameters at sensors (PMTs)
rendering
pixel values at image plane

Much in common : geometry, light sources, optical physics


Many Applications of ray tracing :


Ampere : 2nd Generation RTX

NVIDIA Ampere (2020):
"...triple double over Turing (2018, 10 GigaRays/s)..."

NVIDIA® OptiX™ Ray Tracing Engine -- http://developer.nvidia.com/optix

OptiX makes GPU ray tracing accessible

NVIDIA expertise:

https://developer.nvidia.com/rtx

User provides (Yellow):

[1] Turing+ GPUs eg NVIDIA TITAN RTX


NVIDIA OptiX 7 : Entirely new thin API (Introduced Aug 2019)

NVIDIA OptiX 6->7 : drastically slimmed down

Advantages

More control/flexibility over everything.

  • Fully benefit from future GPUs
  • Keep pace with state-of-the-art GPU ray tracing
Disadvantages

Demands much more developer effort than OptiX 6

  • Major re-implementation of Opticks required

NEWS: Major Progress on 6->7 (p11,..)


Geant4OpticksWorkflow


Geant4OpticksWorkflow 2


Opticks + JUNO Progress : Efficiency Hit Culling on GPU

On GPU Efficiency Culling

CUDA Thrust stream compaction


Mock angular efficiency test of GPU texture machinery :


New "Foundry" Model : Shared CPU/GPU Geometry Context

Simple intersect headers, common CPU/GPU types

https://github.com/simoncblyth/CSG "Foundry" model
csg_intersect_tree.h/csg_intersect_node.h/...
simple headers common to pre-7/7/CPU-testing
https://github.com/simoncblyth/CSG_GGeo
Convert Opticks/GGeo -> CSGFoundry
https://github.com/simoncblyth/CSGOptiX
OptiX 7 + pre-7 rendering

GAS : Geometry Acceleration Structure

IAS : Instance Acceleration Structure

CSG : Constructive Solid Geometry


[9]cxr_i0_t8,_-1 : EXCLUDE SLOWEST





Current JUNO Geometry : Auto-Factorized by "progeny digest"

ridx plc prim component note
0 1 3084 3084:sWorld non-repeated remainder
1 25600 5 5:PMT_3inch_pmt_solid 4 types of PMT
2 12612 5 5:NNVTMCPPMTsMask
3 5000 5 5:HamamatsuR12860sMask
4 2400 5 5:mask_PMT_20inch_vetosMask
5 590 1 1:sStrutBallhead 4 parts of same assembly, BUT not grouped as siblings (not parent-child)
6 590 1 1:uni1
7 590 1 1:base_steel
8 590 1 1:uni_acrylic3
9 504 130 130:sPanel repeated parts of TT

Increasing instancing : reduces memory for geometry -> improved performance


JUNO OptiX 7 : "Foundry" Geometry Scan


JUNO Geometry : OptiX 7 Ray Trace Times ~2M pixels : TITAN RTX

idx -e time(s) relative enabled geometry description
0 9, 0.0017 0.1702 ONLY: 130:sPanel
1 7, 0.0017 0.1714 ONLY: 1:base_steel
2 6, 0.0019 0.1923 ONLY: 1:uni1
3 5, 0.0027 0.2780 ONLY: 1:sStrutBallhead
4 4, 0.0032 0.3268 ONLY: 5:mask_PMT_20inch_vetosMask
5 1, 0.0032 0.3287 ONLY: 5:PMT_3inch_pmt_solid
6 2, 0.0055 0.5669 ONLY: 5:NNVTMCPPMTsMask
7 3, 0.0074 0.7582 ONLY: 5:HamamatsuR12860sMask
8 1,2,3,4 0.0097 1.0000 ONLY PMT
9 t8,0 0.0099 1.0179 EXCL: 1:uni_acrylic3 3084:sWorld
10 0, 0.1171 12.0293 ONLY: 3084:sWorld
11 t8, 0.1186 12.1769 EXCL: 1:uni_acrylic3
12 t0, 0.5278 54.2066 EXCL: 3084:sWorld
13 8, 0.5310 54.5298 ONLY: 1:uni_acrylic3
14 t3, 0.6017 61.7954 EXCL: 5:HamamatsuR12860sMask
15 t2, 0.6043 62.0620 EXCL: 5:NNVTMCPPMTsMask
16 t5, 0.6171 63.3787 EXCL: 1:sStrutBallhead
17 t6, 0.6196 63.6301 EXCL: 1:uni1
18 t7, 0.6226 63.9458 EXCL: 1:base_steel
19 t0 0.6240 64.0879 3084:sWorld
20 t4, 0.6243 64.1169 EXCL: 5:mask_PMT_20inch_vetosMask
21 t9, 0.6335 65.0636 EXCL: 130:sPanel
22 t1, 0.6391 65.6384 EXCL: 5:PMT_3inch_pmt_solid

JUNO ALL PMTs : 2M ray traced pixels in 0.0097 s : NVIDIA TITAN RTX, NVIDIA OptiX 7.0.0, Opticks


Acknowledgement : Opticks "Hackathon" Series for NVIDIA OptiX 6->7


LZ with Opticks (Images from Sam Eriksen, University of Bristol)