Bad performance with texture painting depending on multi-thread settings #51133

Closed
opened 2017-04-05 14:55:52 +02:00 by Sakari Leppä · 40 comments

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

**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
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @SakariLeppa

Added subscriber: @SakariLeppa

#58465 was marked as duplicate of this issue

#58465 was marked as duplicate of this issue
Bastien Montagne was assigned by Aaron Carlisle 2017-04-05 18:57:54 +02:00

Added subscriber: @dfelinto

Added subscriber: @dfelinto

Please attach a sample file as per the bug tracker instructions.

Please attach a sample file as per the bug tracker instructions.

Changed status from 'Open' to: 'Archived'

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.

More than a week without reply. Due to the policy of the tracker archiving for until required info/data are provided.

Added subscriber: @tsuiking

Added subscriber: @tsuiking

Changed status from 'Archived' to: 'Open'

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.

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](https://archive.blender.org/developer/F1608594/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 ?).

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?

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?

In #51133#476937, @mont29 wrote:
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.
texture pint-system.jpg

> In #51133#476937, @mont29 wrote: > 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. ![texture pint-system.jpg](https://archive.blender.org/developer/F1641848/texture_pint-system.jpg)

Yep, so cores are from from fully occupied, which indeed hints at wasted time in locking…

Yep, so cores are from from fully occupied, which indeed hints at wasted time in locking…

Added subscriber: @julien.hondaa

Added subscriber: @julien.hondaa
Member

Added subscriber: @ndee

Added subscriber: @ndee
Member

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:

  • Windows 10
  • Intel Core I5
  • Geforce gtx 750 ti
  • 16 gb ram

https://twitter.com/ndee85/status/1044231281045884929

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: - Windows 10 - Intel Core I5 - Geforce gtx 750 ti - 16 gb ram https://twitter.com/ndee85/status/1044231281045884929
Member

Added subscriber: @gfxcoder

Added subscriber: @gfxcoder
Member

Added subscriber: @plasmasolutions

Added subscriber: @plasmasolutions

Added subscriber: @MartinLindelof

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.

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

Added subscriber: @DanielPaul

I can confirm that

I can confirm that

Added subscriber: @MeshVoid

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.

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.

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. ;)

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.

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

This issue was referenced by 0721ee45873cbaa1f55b477122857e97cefe0332

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Changed status from 'Resolved' to: 'Open'

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.

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.

@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

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

**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](https://archive.blender.org/developer/F7613417/gear_rueda.blend)

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Added subscriber: @pauanyu_blender

Added subscriber: @pauanyu_blender

Added subscriber: @Olliver

Added subscriber: @Olliver

In #51133#690959, @brecht wrote:
@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.

Hi, on my system Im also seeing performance downgrades when attempting to use more than 1 thread:
mCjrYksuvf.mp4

│Blender & System Information:                                                                                             │
│ * Blender Version:                                                                                                       │
│   - 3, 1, 0                                                                                                              │
│ * Blender Last Commit Date:                                                                                              │
│   - 2022-02-21                                                                                                           │
│ * Blender Build Hash:                                                                                                    │
│   - ec5bbebf3ee1                                                                                                         │
│ * Blender Branch:                                                                                                        │
│   - master                                                                                                               │
│ * Blender Executable Location:                                                                                           │
│   - C:\Users\olliv\Desktop\Olliver\programs\Blender\blender-3.1.0-beta+v31.ec5bbebf3ee1-windows.amd64-release\blender.exe│
│ * Python Version:                                                                                                        │
│   - 3.10.2 (main, Jan 27 2022, 08:34:43) [MSC v.1928 64 bit (AMD64)]                                                     │
│ * Platform this Blender instance was built for:                                                                          │
│   - Windows                                                                                                              │
│ * Windows Platform Information:                                                                                          │
│   - Caption=Microsoft Windows 11 Pro                                                                                     │
│   - OSArchitecture=64-bit                                                                                                │
│   - Version=10.0.22000                                                                                                   │
│ * Hardware Information:                                                                                                  │
│   - GPU: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2                                                                           │
│   - GPU Driver Version: NVIDIA Corporation 4.5.0 NVIDIA 511.79                                                           │
│   - CPU MaxClockSpeed=3187                                                                                               │
│   - CPU Name=12th Gen Intel(R) Core(TM) i9-12900K                                                                        │
│   - CPU NumberOfCores=16                                                                                                 │
│   - Total System RAM: 34.088476672 GB                                                                                    │
│                                                                                                                          │
│This info text was generated by the Fast PBR Viewport Render addon!                                                       │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘```

Even with 1 thread its horribly slow however - so slow that Im not even sure if I would be satesfied if the performance was even 10x or 20x as good with it utilizing my entire CPU. Wouldnt mind if we could see some overall performance improvements in the texture painting space
> In #51133#690959, @brecht wrote: > @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. Hi, on my system Im also seeing performance downgrades when attempting to use more than 1 thread: [mCjrYksuvf.mp4](https://archive.blender.org/developer/F13179519/mCjrYksuvf.mp4) ```┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │Blender & System Information: │ │ * Blender Version: │ │ - 3, 1, 0 │ │ * Blender Last Commit Date: │ │ - 2022-02-21 │ │ * Blender Build Hash: │ │ - ec5bbebf3ee1 │ │ * Blender Branch: │ │ - master │ │ * Blender Executable Location: │ │ - C:\Users\olliv\Desktop\Olliver\programs\Blender\blender-3.1.0-beta+v31.ec5bbebf3ee1-windows.amd64-release\blender.exe│ │ * Python Version: │ │ - 3.10.2 (main, Jan 27 2022, 08:34:43) [MSC v.1928 64 bit (AMD64)] │ │ * Platform this Blender instance was built for: │ │ - Windows │ │ * Windows Platform Information: │ │ - Caption=Microsoft Windows 11 Pro │ │ - OSArchitecture=64-bit │ │ - Version=10.0.22000 │ │ * Hardware Information: │ │ - GPU: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 │ │ - GPU Driver Version: NVIDIA Corporation 4.5.0 NVIDIA 511.79 │ │ - CPU MaxClockSpeed=3187 │ │ - CPU Name=12th Gen Intel(R) Core(TM) i9-12900K │ │ - CPU NumberOfCores=16 │ │ - Total System RAM: 34.088476672 GB │ │ │ │This info text was generated by the Fast PBR Viewport Render addon! │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘``` Even with 1 thread its horribly slow however - so slow that Im not even sure if I would be satesfied if the performance was even 10x or 20x as good with it utilizing my entire CPU. Wouldnt mind if we could see some overall performance improvements in the texture painting space
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
16 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#51133
No description provided.