Bad performance with texture painting depending on multi-thread settings #51133
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
16 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#51133
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
Windows 6 64bit, Nvidia Quadro K4000
Blender Version
Broken: Newest official 2.78c (hash e92F235283)
Short description of error
The more I have threads enabled, the slower the texture painting performance is.
I get best performance when setting the threads manually to 1, from render settings.
Maximum I can have is 24 threads.
Exact steps for others to reproduce the error
Make a cube, unwrap, make new image (4096 x 4096), enter texture paint mode, start painting.
Go to render settings and experiment with different thread settings.
My other possibly related settings:
Window Draw Method: Triple Buffer
Region Overlap enabled
Changed status to: 'Open'
Added subscriber: @SakariLeppa
#58465 was marked as duplicate of this issue
Added subscriber: @dfelinto
Please attach a sample file as per the bug tracker instructions.
Changed status from 'Open' to: 'Archived'
More than a week without reply. Due to the policy of the tracker archiving for until required info/data are provided.
Added subscriber: @tsuiking
Changed status from 'Archived' to: 'Open'
I have the same problem.
System Information
os: Windows 10 64bit,
cpu: ryzen 7 1700,
gpu: amd rx480,
ram: 16 gb ram
Blender version:
2.79
Short description of error:
The performance will drop during texture painting on 3D view port if auto detection of threading is on.
The stroke will become laggy after several stroke. If I change the thread to 1, the performance will restore.
In addition, I change my threads manually, the lower number of threads, the better performance is.
P.s. threads:1 is the best and smooth.
Exact steps for others to reproduce the error:
Make a cube,
unwrap,
make new image (1024x 1024),
enter texture paint mode in 3d view port,
painting.
stroke become laggy after several stroke
File of my setting:
test.blend
thanks.
Yeah… threaded code of texpaint should probably be re-written, it’s not even using our scheduler, but launches it own set of threads.
And as we learned recently in another area (mesh normals computation), the more threads you have, the harder it is to get good results unless you manage to have totally lock-free code…
Will see if/when I can tackle that, but this is a TODO really, and am afraid this is not a top-priority task, for now I may just add an hard limit to the number of threads launched by that code (probably between 2 and 4 ?).
Also… I cannot reproduce the issue here with current master nor with official 2.79 release (linux64bit, 8 threads, also tried forcing to 48 threads with no issue). So could be a problem specific to windows threading implementation… Can you please check in your system monitor whether all or some of your CPU cores are fully occupied when you paint and it becomes laggy?
Thank you for your prompt reply.
Here is the print screen for your reference.
Yep, so cores are from from fully occupied, which indeed hints at wasted time in locking…
Added subscriber: @julien.hondaa
Added subscriber: @ndee
I wanted to bring this issue up again. Noticed the same behavior. And it seems many other people are having massive performance issues with multithreading too.
I also noticed that on one machine the Window Draw Method set to Full also helped.
My machine:
https://twitter.com/ndee85/status/1044231281045884929
Added subscriber: @gfxcoder
Added subscriber: @plasmasolutions
Added subscriber: @MartinLindelof
I can confirm this issue.
https://twitter.com/martin_lindelof/status/1044481672710885376
Also it's present for me in 2.80, switching from Eevee render to Cycles, and under Performance lock it to 1 thread instead of Auto-detect. Painting improves.
Added subscriber: @DanielPaul
I can confirm that
Added subscriber: @MeshVoid
Added subscribers: @SarunasAtkocaitis, @Jeroen-Bakker, @antoniov, @WilliamReynish, @Parabox, @OscarFranco, @stevewarner, @brecht, @TheX, @ZedDB
I'd almost want to set this as high priority, but it's also not a new issue in 2.80.
From the profile in #58465#635130, I'm guessing this is due to a high cost of starting threads on Windows, and if so switching to the task scheduler could fix it.
@mont29, could you try doing this? Would be great to have this fixed for 2.80.
Unless I'm missing something, this would not require major code changes. Just switching from the thread pool to task scheduler in
project_paint_op
, while leaving all the other threading logic untouched.Eh, didn’t though that would be high prio, this has been buging us since ages… Though with many poeple enjoying tens of threads nowadays, I guess it’s becoming more of an issue.
Am happy to work on it yes, not sure how big of a task that is though. ;)
If it's a big task we can reconsider. But glancing at the code I did not immediately see a reason for this to be more than a local change in
project_paint_op
. Surely threading can be improved for texture paint in many ways, the only thing to solve here would be to avoid creating threads all the time.This issue was referenced by
0721ee4587
Changed status from 'Open' to: 'Resolved'
Changed status from 'Resolved' to: 'Open'
Will keep that task open, since that commit is not really great in the long run, proper refactor needs to be done here after 2.80 is out.
@antoniov confirmed on blender.chat that performance is much better now with multi-threading, so it appears the main performance issue on Windows is solved.
Added subscriber: @zutxita
System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 419.35 / 4 core 8 thread Intel i7 870 CPU / 16GB of RAM
Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-11 13:50, hash:
06312c6d2d
Worked: (optional)
Short description of error
It lags a lot when paiting in Texture Paiting.
Exact steps for others to reproduce the error
Either with a textured brush or simple brush, when I try to texture paint it freeeeezees like hell. I've tried to change the multi-thread option to 1 but is still happening. It lags in Solid mode, in lookdev mode, in 2.8, in 2.79, in 2.79b... It happens with a Principled BSDF shader applied, with the textures unplugged or plugged into the shader, in cycles, in eevee, in workbench, I really don't know what else to do. I think I have a pretty good PC (is old but powerful) that in my opinion should take care of these kind of tasks.
Also I have a bevel modifer and a Subsurf modifier applied. It lags less (but it still lags) if I dissable them or hide them.
gear_rueda.blend
Changed status from 'Open' to: 'Resolved'
Added subscriber: @pauanyu_blender
Added subscriber: @Olliver
Hi, on my system Im also seeing performance downgrades when attempting to use more than 1 thread:
mCjrYksuvf.mp4