Multi-threaded operations in Blender

I’m getting no luck in my other thread, so I thought I’d rephrase my query:

  • What operations in Blender besides rendering are currently threaded to take advantage of multiple processing cores?
  • For what operations can we expect to see multi-threading in over the next few versions of Blender-- the compositing nodes, simulations, etc.?
  • I remember Ton mentioning something at Bconf '11 about multi-threading realtime animation in the 3D view-- how exactly would this work?
  • Are there any other areas where multi-threading would offer a performance boost?

We need multithreaded or even GPU accelerated fluid/smoke sims. You can get multithreaded fluid in an openMP build, but that should be in trunk for sure. Personally, I think the fluid sim should be rewritten completely. There are systems that can do high res sims in realtime even with rendering included.

Great example here: http://www.youtube.com/watch?v=Jl54WZtm0QE

Sculpting/multires is multithreaded (with OpenMP.) Not sure how much of a performance boost it gives though.

mesh selections should be multithreaded if possible, sometimes when there is hi-poly objects then selecting between objects takes lot of secons when selection occurs. At least now 2.64 BVH building is multithreaded that gives big boost.

Do you know if official builds are compiled with OpenMP ?

No, it isnt. I don’t know why not though.

That blows :frowning: I have had a lot of issues compiling Blender from the source due to my custom compiled ffmpeg thus I only use official builds for Linux 64bit. I should probably give it a try again. How do I compile from offical release source… Oops, BF is in violation of GPL, because they don’t supply source code with their official releases o_O WTF?! You gotta be kidding me?!

What do you mean they don’t supply the source code?

You can always get the source from their SVN repository:

https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Apart from SVN access, the source code for every release is available here. Of course to find that, one must have the ability to navigate websites (like the blender.org download page) - which some people don’t have.

its only not turned on with windows releases, because you need MSVC pro to compile with OpenMP and the builders do not have that, if i remember correctly

In relation to your first question, sculpt is multithreaded, softbodies/cloth and fluid particles are multithreaded, fluid sim is multi threaded (divided into sections along the y axis), In svn the compositor is now fully multithreaded

also the interface is now multithreaded, due to 2.6’s jobs system (nicknamed steve) so blender is capable of doing things in the background while you are doing somthing else, like editing the scene while its rendering for instance (results can be unpleasent so don’t :wink: )

multi threaded Viewport requires a complete overhaul of blender’s dependency graph (what depends on what) and thats still a long way to go

The source code has to come with the binaries, and not just “oh, you want code - get it on SVN”. To my knowledge, that’s how it suppose to be done.

Ahh, thanks man! I didn’t see it anywhere near the binaries and I was kinda surprised :slight_smile:

Regarding navigating websites, if the website has retarded UI, I can’t help it.

So official Linux binaries are compiled with OpenMP enabled ?

How exactly it can be achieved? I’d like to work on scene while baking AO map for example.

simple, as soon as you see the progress bar at the top, just keep working in the scene in a 3dview, you don’t need the UV editor open for it to bake

As far as I know, OpenMP is disabled on official OSX builds too (unless that’s changed recently). Official Linux builds should have it enabled though.

Regarding source code distribution, the GPL is intentionally not very specific about the exact method of distribution. It is certainly not required to include a copy of the source with the binary package though. Blender is not in violation.

One other note: multi-threaded selection is not what’s needed to speed it up; it’s more of an algorithm problem. Moreover, our current selection method is OpenGL-based, and you can’t have multiple threads writing to the GL at the same time.

Edit: forgot to say, you should be able to see if your build was compiled with OpenMP by checking the system info (from help menu.)

I have “-fopenmp” flags in system_info.txt

Does it mean it was compiled with OpenMP enabled ?

So if i understand well, this means that the “Threaded Sculpt” button i always had enabled in my Blender sculpt mode on windows does nothing at all ?

Yes.

If your build was compiled without OpenMP, then yes. But I’m not sure if Windows builds are compiled with OpenMP or not these days.

Official Windows Builds also come with OpenMP enabled.

mfoxdogg mentionned :

its only not turned on with windows releases, because you need MSVC pro to compile with OpenMP and the builders do not have that, if i remember correctly

As i use buildbot version from the official website, i assumed then that my builds were in such case.
But looking on the system info as you mentionned, i noticed on the buildbot version i’m working on currently

build cflags: b’/nologo /Ob1 /J /W1 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /openmp …
build cxxflags: b’/nologo /Ob1 /J /W1 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /openmp …

This is not really something i understand, but it looks like the openmp flag is there.

Though disabling/enabling the Threaded Sculpt button does not seem to make any difference.

edit :

Official Windows Builds also come with OpenMP enabled.

didn’t noticed your post as i was typing, thanks for the confirmation.