Super LOW performance on CPU rendering in complex scene #92601
Labels
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
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#92601
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux-5.13.0-7614-generic-x86_64-with-glibc2.33 64 Bits
Graphics card: NVIDIA GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.82.00
Blender Version
Broken: version: 3.0.0 Beta, branch: master, commit date: 2021-10-29 09:04, hash:
f13826a572
Worked: 2.93.x
Short description of error
The CPU rendering performance on complex scenes is awful, making it not just way slower than in 2.93.x but making computers with 16 threads to work nearly at 50% or less of it's render capacity.
In a TR 2990WX the majority of the cores may be some times even at 0% in a more or less complex scene, but this happens too with a Ryzen 5950X as was checked by @leesonw
Example picture:
Exact steps for others to reproduce the error
@leesonw has an example scene that I shared with him privately since it has commercial assets on it.
Basically open the scene and render, check the CPU threads load.
Added subscribers: @leesonw, @juang3d
Added subscriber: @SteffenD
Added subscriber: @Raimund58
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Will read that as "Confirmed".
Yep, I was checking this with him yesterday.
Added subscriber: @silex
I also tested this scene from @juang3d. With Threadripper 3970X the CPU sits around 35% with one thread maxed 100%. Didn't see any sudden dips to 0%.
With increased number of particles 20 times the rendering performance is much worse and there are visible memory fluctuations. Around 16GB of data is dumped and loaded again. Memgraph is on the left.
If I render from the command line using
I no longer have the performance issues there are a few dips on 1 or 2 CPUs at the start but it settles down to 100% on all CPUs after a bit. @juang3d does this also happen for you? Is it only a case of when rendering with the UI? From this I am going to look at the image update and see if that is the culprit. I am not sure why this causes so much trouble but I am guessing that too many threads are trying to send data at the same time and something about this scene causes that.
I tested this, and while I still see a bit of inconsistency, the result is way better, check this picture:
You can see how it is not always at 100%, but goes sometimes to 70/90%, but not as often as with the UI, also you can see three big drowns in the graph, those corresponds when a new message with the Sample number appear (marked with arrows with the same color).
As the scene render progress this happens more often, as you can see in this picture:
But with the exception of those drowns, the load is more consistent.
It seems the main render loop in session.cpp is causing these pauses as the render time for each tile is not even between all the CPU so some finish early. The loop is session makes them work in lock step on each update iteration so every n samples the render halts for all threads to catch up then reassigns new work items. Here is a screen grap of a perf session showing all the rendering threads
They all line up waiting for the next iteration.
Added subscriber: @brecht
If background rendering makes a big difference then indeed the image display is likely to be a problem. The next step would be to then figure out which parts of that are making other threads wait, it's not obvious to me where the issue could be, but it should be quite clear in a profiler.
For background rendering, I guess the thing to look into is the
tbb::parallel_for
loops inpath_trace_work_cpu.cpp
. From the image, it looks like the top part would be much faster to render than the bottom part, so you could imagine poor work distribution being the problem. As far as I know,tbb::parallel_for
is supposed to use work stealing to do balancing. It may be that the grain size needs to be smaller. I'm not sure what that is by default. It would be interesting to set that to 1, 2, 4, 8, .. and see what happens. There may be other parameters in TBB than can be tweaked,It may also be that some CPU cores get assigned to another thread/process in the middle of working on a pixel sample, and the operating system doesn't schedule another CPU core to finish this work quickly, which then ends up blocking everything else. I would expect it to render enough samples at a time that this doesn't have a big impact, but maybe.
Added subscriber: @Memento
It seems this is caused by the starting and stopping of the profiling which was always on for the CPU. By disabling this the idling has been largely gone.
Some performance data on the three patches
UI - means rendered from within Blender
bg - means rendered from the command line using ##blender -b scene.blend -f 1##
@leesonw What do the first two columns mean? Just UI and Background... But what?
For the 1st column: I have 2 different patches so this column shows the results for which patch is applied or if no patch is applied.
Column 2: is rendering Juan's scene from within Blender
Column 3: is rendering Juan's scene from the command line blender - b etc...
Okay, thank you for your explanation. I guess UI and bg was accidentally swapped for the first row?
Yes thank you, not sure how I did that :-/ I have updated the table now with more details
This issue was referenced by blender/cycles@64337d890b
This issue was referenced by
456876208b
This issue was referenced by
32c7687859
Changed status from 'Confirmed' to: 'Resolved'