rlguy / Blender-FLIP-Fluids

The FLIP Fluids addon is a tool that helps you set up, run, and render high quality liquid fluid effects all within Blender, the free and open source 3D creation suite.
https://www.blendermarket.com/products/flipfluids
GNU General Public License v3.0
1.67k stars 188 forks source link

[Blender Bug] Render Crashes: Discussion, Tips, and Troubleshooting #518

Open Shayan012 opened 3 years ago

Shayan012 commented 3 years ago

System Information

Blender Version (including hash): 2.91.0 FLIP Fluids Version: 1.0.9 Operating System: Windows 10 64bit Version 20H2 CPU: AMD Ryzen 5 1600 GFX: RTX 3070 RAM: 16GB

Describe the bug

I've had this problem in two different projects now. I made a simulation with a high amount of voxels and whitewater particles. When I then try to render said animation in Cycles or Eevee, Blender more often than not just closes after a single frame is rendered (Sometimes it's a couple more than one, but then the same thing happens). When I just go to a frame and render it, it works fine and Blender doesn't close, and I can then manually save that frame. But when rendering it as an animation the problem occurs. This is obviously pretty annoying because it means I can't render a scene over night since I have to keep re-opening Blender every couple of minutes.

Side Note: Rendering Viewport Animations works without problems.

To Reproduce

Try to render an animation of a sim with very high detail in Eevee or Cycles.

Expected Behaviour

See above

Actual Behaviour

See above

rlguy commented 3 years ago

Hi Shayan012,

Thanks for the report! I am sorry to hear that you are experiencing render crashes. Here are some things to try, and some questions that might help narrow down what the problem could be.

The first thing to check is to make sure that the Lock Interface option is enabled. This is a requirement for stable rendering:

lock_interface

Some other things to try:

Here are some questions I have about the issue:

launch_render_operator

Hope this helps! Let us know if you have any questions or more info about your scene.

- Ryan

Shayan012 commented 3 years ago

Thanks for the detailed answer! I'll go through everything in the order you mentioned it:

  1. The Interface is Locked
  2. Restarting doesn't help
  3. I already had the newest drivers
  4. Changing to Optix didn't change anything, changing to CPU made Blender crash before it could even render anything.
  5. I don't have the newest version yet, but I will probably get it and try to see if it works.
  6. Rendering from Command Line actually works (I'm so happy) and hasn't even crashed once.
  7. Some of the larger frames have at least 8.2 million verts, 2.8 million tris and 7 million whitewater particles

Thanks a lot for the command line "solution"! I hope my info can help you in getting rid of this issue.

rlguy commented 3 years ago

Thanks for the update! From this info, I the cause of the crashes could be triggered by either of these issues:

Running out of GPU memory

At the large mesh size and number of particles, this could be exceeding 8GB of VRAM on the RTX 3070. Usually at around 6 million particles + large mesh, and a few textures I start to run out of VRAM and get crashes. Rendering fromt he command line can reduce the amount of resources used, but I am not sure by how much.

To test if this is the issue, you could try rendering a lower number of whitewater particles. Rendering particle instances requires a lot of memory in Blender. Reduction of particles for rendering can be done by setting the render display amount to 50% and testing for a crash.

If the render still crashes, this will be related to the next issue:

Crashes due to Blender viewport stability

There is a design issue in Blender where the viewport and render threads do not sync correctly and can cause a crash (Issue T60094). This becomes more troublesome as amount of geometry increases. This issue is the reason why the viewport needs to be locked during render to improve stability. Rendering from the command line will bypass this design issue since the viewport is no longer needed.

Unfortunately this issue is out of our control and will need to be fixed by the Blender developers. There is a comment here in the issue thread where a developer mentions the design issues will need to be handled in regular development:

Currently it's as stable as we can make it. It is indeed true that interface is better be locked, otherwise render thread might cause conflicts with the viewport (due to python handlers possibly modifying data while it's being drawn by the viewport).

There are ways around it, but needs some design changes. Will be handled outside of the bug tracker as a regular development.


Hope this info helps! I'll leave this issue open as a discussion thread since the help info could help others.