Huge CPU Memory+Time Expense
-> Hybrid Solution : Geant4 + Opticks
Not a Photo, a Calculation
Ray Tracing Tools can Help Optical Photon Simulation
https://nvidianews.nvidia.com/news/nvidia-reveals-the-titan-of-turing-titan-rtx
OptiX Raytracing Pipeline
Analogous to OpenGL rasterization pipeline:
OptiX makes GPU ray tracing accessible
NVIDIA expertise:
https://developer.nvidia.com/rtx
User provides (Yellow):
[1] Turing+ GPUs eg NVIDIA TITAN RTX
Outside/Inside Unions
dot(normal,rayDir) -> Enter/Exit
Pick between pairs of nearest intersects, eg:
UNION tA < tB | Enter B | Exit B | Miss B |
---|---|---|---|
Enter A | ReturnA | LoopA | ReturnA |
Exit A | ReturnA | ReturnB | ReturnA |
Miss A | ReturnB | ReturnB | ReturnMiss |
Direct Geometry Translation
Torus intersection
Double heavy quartic root finding
Alternative Approach To Try
First 2 change geometry, last 2 change modelling only
GPU Resident Photons
Thrust: high level C++ access to CUDA
OptiX : single-ray programming model -> line-by-line translation
Ray tracing Benchmark
NVIDIA OptiX 6.0.0 : RTX Mode
Ray trace performance improvements:
OptiX developers helped find the cause
GPU Scaling Performance
Opticks on IHEP GPU Cluster
OptiX : Almost perfect scaling for 1,2,4 GPUs
Masked Running
Repeatable bi-simulation of any photon subset
Create test geometries using solids, materials, surfaces from base geometry geocache
3-way "zip" : 2*code + randoms
NPY serialized arrays
In [11]: pdv = np.where(dv > 0.0001)[0] In [12]: ab.dumpline(pdv) 0 1230 : TO BR SC BT BR BT SA 1 2413 : TO BT BT SC BT BR BR BT SA 2 9041 : TO BT SC BR BR BR BR BT SA 3 14510 : TO SC BT BR BR BT SA 4 14747 : TO BT SC BR BR BR BR BR BR BR 5 14747 : TO BT SC BR BR BR BR BR BR BR ... In [20]: ab.b.ox[pdv,0] In [21]: ab.a.ox[pdv,0] Out[20]: Out[21]: A()sliced A()sliced A([ [-191.6262, -240.3634, 450. , 5.566 ], A([ [-191.626 , -240.3634, 450. , 5.566 ], [ 185.7708, -133.8457, 450. , 7.3141], [ 185.7708, -133.8456, 450. , 7.3141], [-450. , -104.4142, 311.143 , 9.0581], [-450. , -104.4142, 311.1431, 9.0581], [ 83.6955, 208.9171, -450. , 5.6188], [ 83.6954, 208.9172, -450. , 5.6188], [ 32.8972, 150. , 24.9922, 7.6757], [ 32.8973, 150. , 24.992 , 7.6757], [ 32.8972, 150. , 24.9922, 7.6757], [ 32.8973, 150. , 24.992 , 7.6757], [ 450. , -186.7449, 310.6051, 5.0707], [ 450. , -186.7451, 310.605 , 5.0707], [ 299.2227, 318.1443, -450. , 4.8717], [ 299.2229, 318.144 , -450. , 4.8717], ...
"Darkroom" Geometry Testing
Random Aligned Bi-Simulation
Future flags (next step point)
Mis-aligned + Deviation Summary
Example Solid : sInnerWater
3-way zipper snagged
Large Range 0.01% 0.50% 3% depending on extent
ab.mal (LV 19) aligned 999837/1000000 : 0.9998 : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 maligned 163/1000000 : 0.0002 : 2908,4860,5477,12338,17891,18117,28709,32764,37671,43675,45874,... 0 2908 : * : TO BT BR BR BT SA TO BT BR BR BR BT SA 1 4860 : * : TO BT BT BT SA TO BT BT BT BT SA 2 5477 : * : TO BT BT BT SA TO BT BT BT BT SA 3 12338 : * : TO BT BR BT SA TO BT BR BR BR BR BR BR BR BR ... ab.mal (LV 39) aligned 970094/1000000 : 0.9701 : 0,1,2,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,26,27 maligned 29906/1000000 : 0.0299 : 3,15,25,80,132,288,294,329,376,377,379,436,511,536,655,662,... slice(0, 25, None) 0 3 : * : TO BT SC BR BR BR BR BR BR BR TO BT SC BR BR BR BR BR SC BR 1 15 : * : TO BT SC BR BR BR BR BR SC BR TO BT SC BR BR SC BT SC BT SC 2 25 : * : TO BT SC BR BR BR AB TO BT SC BR BR BR BR BR BR BR 3 80 : * : TO BT BT SC BT BR AB TO BT BT SC BT BR BR SC BR AB ...
[1] https://bitbucket.org/simoncblyth/opticks/src/tip/notes/issues/alignment_options_review.rst
Interference : Mis-aligned <-> deviant
float vs double precision
[1] https://bitbucket.org/simoncblyth/opticks/src/tip/optixrap/cu/propagate.h
[2] https://devtalk.nvidia.com/default/topic/1036155/optix/double-precision-of-ray-lengths/
Raised photon ceiling 3M->60M
Issue : aimed for 100M, only reached 60M
tboolean-box test Geometry + input photons
Production Mode : does the minimum
Multi-Event Running : measure interval and launch
[1] TCURAND GPU randoms on host https://bitbucket.org/simoncblyth/opticks/src/tip/thrustrap/TCURAND.hh
Drastic Speedup >> 1000x
Simple Test Geometry, Input Photons
G4 extrapolation vs Opticks Times
Full geometry speedup expected to be more, as more ray tracing.
100 GeV muon, millions of photons
State-of-the-art GPU ray tracing[2] applied to optical simulation
Optical photons generated+propagated entirely on GPU
Status : validation iterations ongoing
[1] Open source project http://bitbucket.org/simoncblyth/opticks
[2] NVIDIA OptiX ray tracing engine
[3] using innovative Constructive Solid Geometry implementation on GPU
[4] scattering, boundary, reemission, absorption