Particle with fluid physics unstable #39180

Closed
opened 2014-03-14 10:25:04 +01:00 by Simeon Conzendorf · 23 comments

System Information
Operating system and graphics card

  • Windows 7 64bit
  • Geforce GTX 660

Blender Version
Broken: 2.70 2525f9c = official RC2
Worked: 2.69 r60995 (also the example below doesn't crash on load)

Short description of error
The particle system with fluid physics seem to be very unstable, especially if you want to use interaction between 2 of them.

Exact steps for others to reproduce the error

  1. default Blender scene
  2. give the standard cube a particle system
  3. select "fluid" physic panel
  4. duplicate cube and position it beside the first
  5. make the particle system single user
  6. alt + a (play)

CRASH or sometimes one of the systems get's a very strange force.

  1. it get's even worser if you set up interaction: select cube1, in particle/physic/fluid set interaction to cube2 and vice versa. I hardly managed it to set up a particle fluid system with interaction.

If I save the blend file before pressing play and try to reload it, blender crashes.

sim10.blend

**System Information** Operating system and graphics card - Windows 7 64bit - Geforce GTX 660 **Blender Version** Broken: 2.70 2525f9c = official RC2 Worked: 2.69 r60995 (also the example below doesn't crash on load) **Short description of error** The particle system with fluid physics seem to be very unstable, especially if you want to use interaction between 2 of them. **Exact steps for others to reproduce the error** 01. default Blender scene 02. give the standard cube a particle system 03. select "fluid" physic panel 04. duplicate cube and position it beside the first 05. make the particle system single user 06. alt + a (play) CRASH or sometimes one of the systems get's a very strange force. 07. it get's even worser if you set up interaction: select cube1, in particle/physic/fluid set interaction to cube2 and vice versa. I hardly managed it to set up a particle fluid system with interaction. If I save the blend file before pressing play and try to reload it, blender crashes. [sim10.blend](https://archive.blender.org/developer/F81089/sim10.blend)

Changed status to: 'Open'

Changed status to: 'Open'
Lukas Tönne was assigned by Simeon Conzendorf 2014-03-14 10:25:04 +01:00

Added subscriber: @SimeonConzendorf

Added subscriber: @SimeonConzendorf

Added subscriber: @sebastian_k

Added subscriber: @sebastian_k

Crashes also on OSX.

Crashes also on OSX.

This issue was referenced by blender/blender-addons-contrib@ade6646755

This issue was referenced by blender/blender-addons-contrib@ade6646755224ce9178d280738727c1a968b28b6

This issue was referenced by ade6646755

This issue was referenced by ade6646755224ce9178d280738727c1a968b28b6
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit ade6646755.

Closed by commit ade6646755.

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'

Hello lukas,

thank you for fixing it so fast, but I think there could be more bugs related to my topic, i hope it's ok, that I reopen it.

I downloaded latest built from http://builder.blender.org/download/ - Hash: 2aaf243 from Sat Mar 15 02:26:16 2014
(I'm not able to compile blender)

Exact steps for others to reproduce the error (same as above)

  1. default Blender scene
  2. give the standard cube a particle system
  3. select "fluid" physic panel
  4. duplicate cube and position it beside the first
  5. make the particle system single user
  6. alt + a (play)

WORKS

  1. select cube1, in particle/physic/fluid set interaction to cube2 and vice versa
  2. alt + a (play)

CRASH

In 2.69 it works.

sim12.blend

Hello lukas, thank you for fixing it so fast, but I think there could be more bugs related to my topic, i hope it's ok, that I reopen it. I downloaded latest built from http://builder.blender.org/download/ - Hash: **2aaf243** from Sat Mar 15 02:26:16 2014 (I'm not able to compile blender) **Exact steps for others to reproduce the error (same as above)** 01. default Blender scene 02. give the standard cube a particle system 03. select "fluid" physic panel 04. duplicate cube and position it beside the first 05. make the particle system single user 06. alt + a (play) WORKS 07. select cube1, in particle/physic/fluid set interaction to cube2 and vice versa 08. alt + a (play) CRASH In 2.69 it works. [sim12.blend](https://archive.blender.org/developer/F81291/sim12.blend)
Member

I'm afraid there is no proper solution this time ...

The fluid interaction code totally relies on other object's data being available, it contains a function call to write the particle bvh tree data of the target object:
https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/particle_system.c;caf8684b5066720d4f4124092e23857dd462cb8b$4302

This is extremely bad, because it totally breaks with threaded depsgraph evaluation. Until the depsgraph can fully handle such object data <-> object data interaction (and the particle system implements it correctly) there is no way to make it work really. I would rather disable this feature entirely until we can do it right.

@SimeonConzendorf: Only thing you could try is to run Blender with 1 thread only (blender -t 1). You will still get errors due to unsynchronized particle systems, but with a bit of luck this won't be noticeable.

I'm afraid there is no proper solution this time ... The fluid interaction code totally relies on other object's data being available, it contains a function call to **write** the particle bvh tree data of the **target object**: https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/particle_system.c;caf8684b5066720d4f4124092e23857dd462cb8b$4302 This is extremely bad, because it totally breaks with threaded depsgraph evaluation. Until the depsgraph can fully handle such object data <-> object data interaction (and the particle system implements it correctly) there is no way to make it work really. I would rather disable this feature entirely until we can do it right. @SimeonConzendorf: Only thing you could try is to run Blender with 1 thread only (blender -t 1). You will still get errors due to unsynchronized particle systems, but with a bit of luck this won't be noticeable.

Added subscriber: @zeauro

Added subscriber: @zeauro

It seems to work fine with only one thread. No crash.
@ Lukas : is it possible to make the feature a single threaded task until you find a solution ?

It seems to work fine with only one thread. No crash. @ Lukas : is it possible to make the feature a single threaded task until you find a solution ?

Runing Blender with 1 thread only works for me too... this is a good workaround until there's a solution. Thank you so far.

Runing Blender with 1 thread only works for me too... this is a good workaround until there's a solution. Thank you so far.

Added subscribers: @LukasTonne, @Sergey

Added subscribers: @LukasTonne, @Sergey

@LukasTonne, we can add a mutex around bvh write?

@LukasTonne, we can add a mutex around bvh write?
Member

Yes, that's what i'd do here. Is a crappy workound for bad code but would prevent crash ...

Can store a mutex in every psys for this purpose, doesn't have to be global.

Yes, that's what i'd do here. Is a crappy workound for bad code but would prevent crash ... Can store a mutex in every psys for this purpose, doesn't have to be global.

You could have global rw mutex. Would be better than polluting storage with workarounds.

You could have global rw mutex. Would be better than polluting storage with workarounds.
Member

Particle storage is a mess anyway, at least a local mutex would avoid adding static vars and/or core init/free calls and keep this stuff inside psys. Also it would still allow some measure of threading of unrelated psys objects (although that probably won't matter much).

Particle storage is a mess anyway, at least a local mutex would avoid adding static vars and/or core init/free calls and keep this stuff inside psys. Also it would still allow some measure of threading of unrelated psys objects (although that probably won't matter much).

This issue was referenced by blender/blender-addons-contrib@5febb09639

This issue was referenced by blender/blender-addons-contrib@5febb0963998c40d7ddd8e71d9f9abe6feaea7ca

This issue was referenced by 5febb09639

This issue was referenced by 5febb0963998c40d7ddd8e71d9f9abe6feaea7ca
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit 5febb09639.

Closed by commit 5febb09639.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#39180
No description provided.