regcs / AliceLG

A Blender add-on for the use of Blender with the Looking Glass holographic displays.
GNU General Public License v3.0
101 stars 21 forks source link

[Rendering] Slow down during rendering animations #8

Open regcs opened 3 years ago

regcs commented 3 years ago

https://discord.com/channels/573562186597662720/601839543825465344/847574500220731463

regcs commented 2 years ago

It might be that the accumulation of image data blocks during quilt animation rendering contributes to this issue. In Alice/LG 2.0, I now switched to a more Blender-like behavior for the quilt render result: Instead of saving each quilt render result in a separate image data block this data block is now overwritten in each frame. Also camera data blocks are now deleted after each frame (6aa7d0885854238f2e00bf83b27aea40093784ad).

Since I can't reproduce the slow down, it is hard to tell if that resolved the issue. Therefore, I will keep this open until it is confirmed or falsified by users after the release of Alice/LG 2.0.

regcs commented 2 years ago

After some further tests done by a community member on Discord, it really seems to be a Blender issue. With a simplified version of Alice/LG's render pipeline, which rendered 48 views per frame of an animation (no quilt assembly or similar) the user reported the following render times:

[#] Rendering this frame took 49.953 s (i.e., 1.041 s per view)
[#] Rendering this frame took 50.067 s (i.e., 1.043 s per view)
[#] Rendering this frame took 50.364 s (i.e., 1.049 s per view)
[#] Rendering this frame took 50.380 s (i.e., 1.050 s per view)
[#] Rendering this frame took 50.169 s (i.e., 1.045 s per view)
[#] Rendering this frame took 50.900 s (i.e., 1.060 s per view)
[#] Rendering this frame took 51.466 s (i.e., 1.072 s per view)
[#] Rendering this frame took 52.395 s (i.e., 1.092 s per view)
[#] Rendering this frame took 55.423 s (i.e., 1.155 s per view)
[#] Rendering this frame took 55.665 s (i.e., 1.160 s per view)
[#] Rendering this frame took 56.215 s (i.e., 1.171 s per view)
[#] Rendering this frame took 56.504 s (i.e., 1.177 s per view)
[#] Rendering this frame took 56.880 s (i.e., 1.185 s per view)
[#] Rendering this frame took 58.579 s (i.e., 1.220 s per view)
[#] Rendering this frame took 57.806 s (i.e., 1.204 s per view)
[#] Rendering this frame took 58.260 s (i.e., 1.214 s per view)
[#] Rendering this frame took 58.564 s (i.e., 1.220 s per view)
[#] Rendering this frame took 59.222 s (i.e., 1.234 s per view)
[#] Rendering this frame took 59.133 s (i.e., 1.232 s per view)
[#] Rendering this frame took 54.840 s (i.e., 1.143 s per view)
[#] Rendering this frame took 54.169 s (i.e., 1.129 s per view)
[#] Rendering this frame took 54.643 s (i.e., 1.138 s per view)
[#] Rendering this frame took 54.560 s (i.e., 1.137 s per view)
[#] Rendering this frame took 54.849 s (i.e., 1.143 s per view)
[#] Rendering this frame took 55.673 s (i.e., 1.160 s per view)
[#] Rendering this frame took 56.100 s (i.e., 1.169 s per view)
[#] Rendering this frame took 57.027 s (i.e., 1.188 s per view)
[#] Rendering this frame took 57.600 s (i.e., 1.200 s per view)
[#] Rendering this frame took 56.818 s (i.e., 1.184 s per view)
[#] Rendering this frame took 57.177 s (i.e., 1.191 s per view)
[#] Rendering this frame took 57.796 s (i.e., 1.204 s per view)
[#] Rendering this frame took 66.658 s (i.e., 1.389 s per view)
[#] Rendering this frame took 67.260 s (i.e., 1.401 s per view)
[#] Rendering this frame took 68.176 s (i.e., 1.420 s per view)
[#] Rendering this frame took 69.214 s (i.e., 1.442 s per view)
[#] Rendering this frame took 69.325 s (i.e., 1.444 s per view)
[#] Rendering this frame took 69.331 s (i.e., 1.444 s per view)
[#] Rendering this frame took 70.226 s (i.e., 1.463 s per view)
[#] Rendering this frame took 71.780 s (i.e., 1.495 s per view)
[#] Rendering this frame took 72.474 s (i.e., 1.510 s per view)
[#] Rendering this frame took 82.408 s (i.e., 1.717 s per view)
[#] Rendering this frame took 67.940 s (i.e., 1.415 s per view)

A clear slow down is observed. Should file a bug report soon.

regcs commented 1 year ago

It seems, that the issue (now?) also exists for Cycles rendering.

We should gather some more information and file a complete bug report.

mdovey commented 3 months ago

I'm encountering this (AliceLG 2.2.2 and Blender 4.0.2), and it seems to be a memory leak. Memory use (as reported by Windows task manager) creeps up (in my case by about 50mb) for every view generated. There is a slight drop when the views are assembled into a quilt frame but only by about 50% of the memory used during the view generation. As a result the memory usage slowly increases, and rendering slows. At about 8-10GB memory usage (this is on a machine with 64GB of RAM) the rendering begins to grind to a halt, and eventually Blender crashes.

My work-around is to render 10 frames at a time. However, I have to completely close Blender in order to release the memory.

dr-one-life commented 2 months ago

I'm encountering this (AliceLG 2.2.2 and Blender 4.0.2), and it seems to be a memory leak. Memory use (as reported by Windows task manager) creeps up (in my case by about 50mb) for every view generated. There is a slight drop when the views are assembled into a quilt frame but only by about 50% of the memory used during the view generation. As a result the memory usage slowly increases, and rendering slows. At about 8-10GB memory usage (this is on a machine with 64GB of RAM) the rendering begins to grind to a halt, and eventually Blender crashes.

My work-around is to render 10 frames at a time. However, I have to completely close Blender in order to release the memory.

I had a similar issue while using the bpy.app.handlers.render_complete handler. This event will be fired inside of the rendering function, and not after it - this means you cannot just start the next render from there (it would be a recursive execution), but have to work with timers instead 🙈. However, the issue here seems to be a different one...