Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1M emissive triangles use 9GB of GPU memory #183

Open
mmp opened this issue Sep 13, 2021 · 4 comments
Open

1M emissive triangles use 9GB of GPU memory #183

mmp opened this issue Sep 13, 2021 · 4 comments

Comments

@mmp
Copy link
Owner

mmp commented Sep 13, 2021

(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
Copy link
Owner Author

mmp commented Sep 13, 2021

doh:

DenselySampledSpectrum Lemit;

mmp added a commit that referenced this issue Sep 14, 2021
The lights now all use an InternCache for their DenselySampledSpectrum
values, saving a significant amount of memory for scenes with many
area lights that have the same emission spectra. (Partial fix to issue #183.)
@mmp
Copy link
Owner Author

mmp commented Sep 14, 2021

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
Copy link
Owner Author

mmp commented Sep 14, 2021

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
Copy link
Owner Author

mmp commented Sep 14, 2021

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

Dolkar pushed a commit to Dolkar/pbrt-v4-myod-integration that referenced this issue May 8, 2023
The lights now all use an InternCache for their DenselySampledSpectrum
values, saving a significant amount of memory for scenes with many
area lights that have the same emission spectra. (Partial fix to issue mmp#183.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant