pbrt-v4 icon indicating copy to clipboard operation
pbrt-v4 copied to clipboard

1M emissive triangles use 9GB of GPU memory

Open mmp opened this issue 2 years ago • 4 comments

(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"

mmp avatar Sep 13 '21 23:09 mmp

doh:

https://github.com/mmp/pbrt-v4/blob/44bb6a97fe4d4a0c2248a40edf18e30a3e5014e6/src/pbrt/lights.h#L457

mmp avatar Sep 13 '21 23:09 mmp

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...)

mmp avatar Sep 14 '21 12:09 mmp

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.

mmp avatar Sep 14 '21 13:09 mmp

...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.

mmp avatar Sep 14 '21 14:09 mmp