Slow Cycles CLI render with proper tile sizes #76767
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76767
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: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce RTX 2080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 445.75
Blender Version
Broken: version: 2.90 (sub 0), branch: master, commit date: 2020-04-20 02:15, hash:
2a96e8be39
Short description of error
Rendering any file with smaller tile sizes in CLI is much slower than rendering inside of the GUI
Even on a 32 thread CPU 128x128 is faster than 16x16 by a long shot, even when there is less tiles than cpu threads
Exact steps for others to reproduce the error
CLI Render any Blend file with different tile sizes on CPU
ImywnvmB0k.mp4
Added subscriber: @derekbarker
Added subscriber: @LazyDodo
the scrolling of the console takes a significant amount of time, redirect it to a file and you should do much better
The time difference left between the two, can probably be explained by the fact the GUI version can apply the color transform on the GPU while the console one has to do it on the CPU (but i admit, i'm guessing here, well guessing at that's where the difference comes from, i'm sure about the color transform being gpu for GUI, cpu for CLI)
It seems writing to a file or just throwing it in to nothingness does help a bit but I've been running CLI for a long time never really noticed a slowdown like this, Though lately I am trying to achieve sub 500ms renders for web related stuff which I can actually do in cycles without denoising.
I know printing to CLI is slow but usually powershell has much less effect on programs printing a lot compared to the CMD. CMD is much slower than powershell and cygwin termnial
I ran it though the profiler yesterday to see what was up, all threads were fighting over a mutex inside conhost (the hosting app for both cmd and powershell) so while i didn't test it, i'm not expecting much of a difference between powerhsell and cmd in this instance.
Added subscriber: @iss
Changed status from 'Needs Triage' to: 'Needs User Info'
I would like to somehow bisect this report.
@derekbarker can you upload sample .blend file that demonstrates this issue as clearly as possible? Is there some version where this issue have been introduced, or did this work well at some point in time?
cube_279.blend
Render time in seconds
I don't think you are going to have a good time bisecting this, as the change is quite likely coming from the compiler (coughCRT*cough) change between 2.79 and 2.80
hmm interesting small repro case between 2013 and 2017 yields much better performance on 2017 not worse, so i can't just be the printing to the console from different threads, something else must have changed.
Added subscriber: @dr.sybren
d2757d149b
removed buffering on stdout, causing it to try and grab a lock on the console for every single character printed causing the regression.Reverting it gives the following stats (Render time in seconds)
@dr.sybren mind if we wrap that in a
#ifdef NDEBUG
? Willing to settle for an windows specific exclusion (kinda depending if someone can repro the regression on linux or not)This issue was referenced by
945e18f037
This issue was referenced by
e590526af6
Changed status from 'Needs User Info' to: 'Resolved'
Added subscriber: @Sergey
@Sergey do you have an opinion about this? I know that the Cycles logs are dear to you when we're rendering in Flamenco. I'm guessing that having multiple threads write to the console without mutex would cause them to jumble pretty badly?
the problematic mutex is not inside blender, it's one the CRT manages itself, the NDEBUG solution chosen was @Sergey 's preference
@dr.sybren, as long as we stick to GLOG for logging we are good.