Faster scene initializing

Hello, I’m wondering if there’s anything that can help with the scene initializing phase in a render, i have a fluid sim with lots of data and the scene initializing & synchronizing objects period seem to take a considerable amount of time before the first sample actually starts to render.

My hardware
AMD Ryzen 9 3950X 16-Core Processor
RTX 2080 Ti
RAM 64GB DDR4 3600

All the relevant data and blender itself are on a pretty fast NVMe PCIe Gen4 SSD, so what can I do to speed that process? and what kind of hardware would help with that part of the process? is it just a software bottleneck in cycles?

1 Like

Hi,
Which Blender version are you using? I noticed a severe increase in initialization time when going from 2.82a to 2.83.
This is my results: Cycles init stats

3 Likes

I’m using version 2.83 yes

Can you try with 2.82a and see if that’s quicker? From my experience that would help you.
It would also assure me that there’s actually a regression problem in 2.83, i.e. I should report it.

1 Like

I just tried a few tests and the results varied slightly but generally the same

1 Like

Hmm…than it seems like we are dealing with separate issues. Don’t think I can help you further, but thanks for checking it out! :slight_smile:

1 Like

You’d have to analyze the scene to find out where exactly the problem is. Is it specific mesh modifiers? Or just a very high number of polygons? Motion blur? … ? Lots of possible causes, it’s hard to guess.

1 Like

Yeah it’s hard to upload the blend file to analyze the problem since it’s a fairly large fluid sim, the problem arise when i turn whitewater on, i didn’t use motion blur, it’s probably just high poly count
image
Whitewater is the foam, bubble etc

my main question is can you explain the process of scene initializing & synchronizing objects (not in detail just briefly) and what kind of hardware helps in that part of the process? like ssd, cpu, gpu or is it mostly a software bottleneck?

Hi, even you have 64 GB of RAM, is it possible you run out of RAM and the system starts swapping on your disk during open the file?

Cheers, mib

1 Like

I was monitoring my memory usage and it didn’t go above 8gb

1 Like

Hi, I’ll create a small .blend file that mimics what the FLIP Fluids addon is doing. Maybe it can be modified and help with reproducing this issue without using the addon.

The FLIP Fluids addon renders particles by instancing spheres over the vertices of a mesh. Here is a script that generates a grid of vertices:

import bpy

step = 0.04
isize = 250
jsize = 700
ksize = 1
print("Generating particles: ", isize * jsize * ksize)

mesh_cache = bpy.data.objects["mesh_cache"]
vertices = []
for k in range(ksize):
    for j in range(jsize):
        for i in range(isize):
            vertices.append((i * step, j * step, k * step))
            
mesh_cache.data.clear_geometry()
mesh_cache.data.from_pydata(vertices, [], [])

Changing the ksize variable can be a way to control the number of particles. The number of particles generated will be isize * jsize * ksize. Here are some values based on how many particles our users generally want to generate:

  • Small simulations: ksize= 1, # particles = 175k
  • Medium simulations: ksize= 10, # particles = 1.75M
  • Large simulations: ksize= 25, # particles = 4.38M
  • Larger simulations: ksize= 45, # particles = 7.88M

Here is a .blend file that includes the script and scene setup: instanced_vertices_script.blend

How to use the .blend file:

  1. Set value of ksize in the script
  2. Press Run Script to generate the vertices
  3. Set Instancing to Verts
  4. Press F12 to render the frame

Notes:

  • Materials can be applied to the child object of the mesh_cache object (particle_object)
  • The step of changing instancing from None to Verts can take a lot of time if there are many particles. The addon does this in a script before the render begins in the frame_change_post handler. This takes about 48s for me when ksize = 45
  • After pressing F12, it takes about 90s to complete the render.
3 Likes

Here’s my result on ksize = 45 & OptiX RTX 2080 ti
image
50 seconds were spent on scene initializing & synchronizing objects while 8 seconds for rendering

1 Like