Opticks : GPU ray trace accelerated optical photon simulation

Opticks :
GPU ray trace accelerated optical photon simulation

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

Simon C Blyth, IHEP, CAS — CHEP, Krakow, Poland — 21 October 2024


Outline

newtons-opticks.png
 


(JUNO) Optical Photon Simulation Problem...


Optical photons limit many simulations => lots of interest in Opticks

EXPT Reactor neutrino
Daya Bay neutrino oscillations
JUNO mass heirarchy + oscillations => NVIDIA CN Contacts
  Long baseline neutrino beam
DUNE FermiLab->Sanford, LAr TPC, => Assistance from Fermilab Geant4 Group
  Neutrinoless double beta decay, dark matter, other search
LZ LUX-ZEPLIN dark matter experiment, Sandford => NVIDIA US Contacts
LEGEND Large Enriched Germanium Experiment, Gran Sasso/SNOLAB
SABRE dark matter direct-detection, Australia
AMoRE Mo-based Rare process Experiment, S.Korea
nEXO next Enriched Xenon Observatory, LLNL
NEXT-CRAB0 High Pressure Gaseous Xenon TPC with a Direct VUV Camera Based Readout
  Neutrino telescope
KM3Net Cubic Kilometre Neutrino Telescope, Mediterranean
IceCube IceCube Neutrino Observatory, South Pole
  Air shower : gamma-ray and cosmic-ray observatory
LHAASO Large High Altitude Air Shower Observatory, Sichuan
  Accelerator
LHCb-RICH LHCb ring imaging Cherenkov sub-detector, CERN => NVIDIA EU Contacts

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 :


NVIDIA RTX Generations

~2x ray trace performance every ~2 years


NVIDIA® OptiX™ Ray Tracing Engine -- Accessible GPU Ray Tracing

OptiX makes GPU ray tracing accessible

OptiX features

User provides (Green):

Latest API Release : NVIDIA® OptiX™ 8.0.0 (Aug 2023)


Geant4 + Opticks + NVIDIA OptiX : Hybrid Workflow

https://bitbucket.org/simoncblyth/opticks

Opticks API : split according to dependency -- Optical photons are GPU "resident", only hits need to be copied to CPU memory


Geometry Model Translation : Geant4 => CSGFoundry => NVIDIA OptiX 7/8

Geant4 Geometry Model (JUNO: 400k PV, deep hierarchy)

PV G4VPhysicalVolume placed, refs LV
LV G4LogicalVolume unplaced, refs SO
SO G4VSolid,G4BooleanSolid binary tree of SO "nodes"

Opticks CSGFoundry Geometry Model (index references)

struct Notes Geant4 Equivalent
CSGFoundry vectors of the below, easily serialized + uploaded + used on GPU None
qat4 4x4 transform refs CSGSolid using "spare" 4th column (becomes IAS) Transforms ref from PV
CSGSolid refs sequence of CSGPrim Grouped Vols + Remainder
CSGPrim bbox, refs sequence of CSGNode, root of CSG Tree of nodes root G4VSolid
CSGNode CSG node parameters (JUNO: ~23k CSGNode) node G4VSolid

NVIDIA OptiX 7/8 Geometry Acceleration Structures (JUNO: 1 IAS + 10 GAS, 2-level hierarchy)

IAS Instance Acceleration Structures JUNO: 1 IAS created from vector of ~50k qat4 (JUNO)
GAS Geometry Acceleration Structures JUNO: 10 GAS created from 10 CSGSolid (which refs CSGPrim,CSGNode )

JUNO : Geant4 ~400k volumes "factorized" into 1 OptiX IAS referencing ~10 GAS


th CPU and GPU
  1. be simple and easy to serialize

The CSG prefix refers to : Constructive Solid Geometry which is the basis for finding intersects

Ada_cxr_overview_emm_t0_elv_t_moi__ALL.jpg


Analytic + triangulated geometry

cxr_min__eye_1,0,0__zoom_1__tmin_0.5__sSurftube_0V1_0:0:-1.jpg

Interactive ray traced visualization via OpenGL/OptiX interop

configure viewpoint, geometry exclusions via envvars

GuideTube : Torus Triangulated

GuideTube (39*2*2 = 156 G4Torus)
split in phi segments, radius breaks

Intersect with torus expensive on GPU

Triangulation using G4Polyhedron

G4Poly..::SetNumberOfRotationSteps

  NumberOfRotationSteps
HepPolyhedron Default 24
Top Right 48
Bottom Right 480

Adjustable: precision of intersect, number of triangles

GPUs evolved for triangles => fast even with many


How much parallelized speedup actually useful to overall speedup?

optical photon simulation, P ~ 99% of CPU time

Traditional simulation use:


amdahl_p_sensitive.png

parallel/amdahl.png

Summary

Opticks : state-of-the-art GPU ray traced optical photon simulation integrated with Geant4, with automated geometry translation into GPU optimized form.