mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.89k stars 457 forks source link

[Question] Memory requirements for rendering the kroken scene #317

Closed knightcrawler25 closed 1 year ago

knightcrawler25 commented 1 year ago

Hey,

I was trying to render the kroken scene on the CPU with 32 GB of RAM and pbrt peaks out the memory and quietly stops processing the scene after a while (log.txt). After removing the displacement textures, the scene renders and consumes about 8 GB.

I was wondering what the requirements were for rendering with all the bells and whistles and if its even doable on a 8/16 GB GPU? My RTX 3060 Ti (8 GB) gives up even without the displacement textures :D

mmp commented 1 year ago

On the CPU, it looks like it's about 44GB to render it as is, though memory use peaks around 56GB while the BVHs are being built before rendering. On the GPU, it looks like it's about 23GB.

Memory use can be tuned using the --displacement-edge-scale command-line option, which adjusts the tessellation rate. With a value of 5, CPU memory usage is about 14GB and it's about 9GB on the GPU.

(There should probably be a FAQ about --displacement-edge-scale...)

pbrt4bounty commented 1 year ago

Confirmed.. I managed to render here in a computer with 16 gb RAM and RTX 3060 12 gb VRAM applying the Matt trick.

knightcrawler25 commented 1 year ago

Ah I didn't realize there was an option to control tessellation. Works perfectly now :)

Thanks for sharing the stats as well.