The performance of Blender decreases as the number of buffered frame increases #108097

Closed
opened 2023-05-20 08:43:04 +02:00 by WannaR · 8 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.61

Blender Version
Broken: version: 3.6.0 Beta, branch: blender-v3.6-release, commit date: 2023-05-17 23:33, hash: a9358f5274b6
Worked: unknown

Short description of error
[Using machine translation]
I created the “game of life” that uses simulation zone. This simulation performed well at the beginning, but when I played it to about 4000 frames, the entire Blender got stuck and the frame rate of the simulation was also decrease to lower than 24fps. At this point the utilization of CPU and GPU was also decreasing. Strange.

begin.png

about4000frame.png

Exact steps for others to reproduce the error
use the attached .blend file (need blender 3.6)
play animation
observe frame rate changes

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.61 **Blender Version** Broken: version: 3.6.0 Beta, branch: blender-v3.6-release, commit date: 2023-05-17 23:33, hash: `a9358f5274b6` Worked: unknown **Short description of error** [Using machine translation] I created the “game of life” that uses simulation zone. This simulation performed well at the beginning, but when I played it to about 4000 frames, the entire Blender got stuck and the frame rate of the simulation was also decrease to lower than 24fps. At this point the utilization of CPU and GPU was also decreasing. Strange. ![begin.png](/attachments/fcace353-f546-4e97-84e3-fdb675f5f2b8) ![about4000frame.png](/attachments/ecf1a4a1-9690-4f94-b862-c2fb1ccc6b1a) **Exact steps for others to reproduce the error** use the attached .blend file (need blender 3.6) play animation observe frame rate changes
WannaR added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-05-20 08:43:05 +02:00

Hey, thanks for report this. Can you check, if on 4000...frame your RAM is full and your hard disk is start working?

Hey, thanks for report this. Can you check, if on 4000...frame your RAM is full and your hard disk is start working?
Iliya Katushenock added the
Interest
Geometry Nodes
Interest
Nodes & Physics
labels 2023-05-20 09:12:22 +02:00
Author

Hey, thanks for report this. Can you check, if on 4000...frame your RAM is full and your hard disk is start working?

Blender used about 1.6GB RAM with almost no SSD used which should not be a issue. Maybe the bottleneck is memory bandwidth? I'm using 16G DDR4 3200Mhz dual channel memory. Performance almost linearly decreases with frame count.

> Hey, thanks for report this. Can you check, if on 4000...frame your RAM is full and your hard disk is start working? Blender used about 1.6GB RAM with almost no SSD used which should not be a issue. Maybe the bottleneck is memory bandwidth? I'm using 16G DDR4 3200Mhz dual channel memory. Performance almost linearly decreases with frame count.

I can confirm the issue. It has to do with the Cache option (the in memory cache) as can be seen below. Performance remains "slow" even if you replay the parts of the simulation that's been cached. Baking the simulation does not experience the problem.

Using the cache - low FPS and degraded performance No cache - much higher FPS and flat performance
bad-cache.png good-no-cache.png
I can confirm the issue. It has to do with the Cache option (the in memory cache) as can be seen below. Performance remains "slow" even if you replay the parts of the simulation that's been cached. Baking the simulation does not experience the problem. | Using the cache - low FPS and degraded performance | No cache - much higher FPS and flat performance | | --- | --- | | ![bad-cache.png](/attachments/bfb50d88-3497-4ba3-96bf-67f604c01c6c) | ![good-no-cache.png](/attachments/f977c99d-0c35-435f-8a2a-5362b12366e1) |
Author

Still happened in the latest build (hash: e2a75814ac)

Still happened in the latest build (hash: `e2a75814ac`)

Some more information: It seems like the Timeline being opened has an effect on the situation.

  • Slow performance: If you have the timeline editor opened AND have the cache enabled
  • Fast performance: If you have the timeline editor opened AND have the cache disabled
  • Fast performance: If you have the timeline editor closed regardless of the cache option

A quick profile does show a problematic section of code inside timeline_cache_draw_simulation_nodes. It loops over each frame and 1) calls into ModifierSimulationCache::has_state_at_frame which also loops over frames in the cache (n^2 behavior) and 2) creates many small rectangles to draw the actual cached line which can maybe be made more efficient as well

Some more information: It seems like the Timeline being opened has an effect on the situation. - Slow performance: If you have the timeline editor opened AND have the cache _enabled_ - Fast performance: If you have the timeline editor opened AND have the cache _disabled_ - Fast performance: If you have the timeline editor closed regardless of the cache option A quick profile does show a problematic section of code inside `timeline_cache_draw_simulation_nodes`. It loops over each frame and 1) calls into `ModifierSimulationCache::has_state_at_frame` which also loops over frames in the cache (n^2 behavior) and 2) creates many small rectangles to draw the actual cached line which can maybe be made more efficient as well
Iliya Katushenock added the
Interest
User Interface
label 2023-06-12 14:56:02 +02:00
Member

Thanks for looking into this @deadpin.

@JacquesLucke @LukasStockner I guess ModifierSimulationCache::states_at_frames_ should become a map or VectorSet, or we should guarantee that it's sorted and use binary search here.

Thanks for looking into this @deadpin. @JacquesLucke @LukasStockner I guess `ModifierSimulationCache::states_at_frames_` should become a map or `VectorSet`, or we should guarantee that it's sorted and use binary search here.
Dalai Felinto added
Priority
High
and removed
Priority
Normal
labels 2023-06-12 15:41:29 +02:00
Member

Using binary search sounds good.

Using binary search sounds good.
Hans Goudey added
Type
Bug
and removed
Type
Report
labels 2023-06-14 16:55:29 +02:00
Member

Fixed by 6a05e5161b. Thanks for reporting!

Fixed by 6a05e5161bc7092cf3b25ea9f0164c5673f57bfb. Thanks for reporting!
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-06-16 17:58:47 +02:00
Hans Goudey added
Status
Resolved
and removed
Status
Archived
labels 2023-06-16 17:58:50 +02:00
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
5 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#108097
No description provided.