pbrt-v4
pbrt-v4 copied to clipboard
1M emissive triangles use 9GB of GPU memory
(That's pushing 9kB per light source!)
Repro: in pbrt-v4-scenes toplevel, render the file:
WorldBegin
AreaLightSource "diffuse"
Shape "plymesh" "string filename" "landscape/geometry/mesh_00110.ply"
doh:
https://github.com/mmp/pbrt-v4/blob/44bb6a97fe4d4a0c2248a40edf18e30a3e5014e6/src/pbrt/lights.h#L457
With 1cc11a8:
CPU: before 3396 MB, after 1092 MB GPU: before 7783 MB, after 3705 MB
Around 1GB of the GPU usage is all of the fixed allocations for queues between the wavefront kernels. (All of the above still seem high...)
Baseline for that scene with no area lights: CPU 298MB, GPU 2525 MB.
So, CPU is still using about 800 bytes / light, GPU is using ~1180.
...and the light BVH is using 300 bytes / light. Changing the Image
member of DiffuseAreaLight
to an Image *
would save 200 bytes / light.
For reasons unclear, reported GPU memory usage jumps from ~1500MB to ~3500MB when all of the managed allocations are prefetched to the GPU.