Blender changes processor affinity unauthorized #50034

Closed
opened 2016-11-15 15:17:01 +01:00 by Kai Kostack · 14 comments

The current Blender version binds all CPUs of a system on its own authority to the Blender process, even after changed by user, and this is happening for each rendered frame repeatedly (see screenshot). This was never the case before 2.78 and I have never seen a program changing its own CPU bindings on Windows ever before.

Blender's compositor is also ignoring the threads count setting in the render panel and always attempts to take over all the power of the machine. This is probably not directly related to the first point, so that this might be worth creating a second task.

These behaviors make it difficult to use Blender in a more professional environment such as a render farm, because you have no control over what the Blender instances do anymore, if each one tries to hijack the entire system all the time. This can't be a good design in my opinion.

System: Windows 7 x64
Worked last: Blender 2.77
report.png

The current Blender version binds all CPUs of a system on its own authority to the Blender process, even after changed by user, and this is happening for each rendered frame repeatedly (see screenshot). This was never the case before 2.78 and I have never seen a program changing its own CPU bindings on Windows ever before. Blender's compositor is also ignoring the threads count setting in the render panel and always attempts to take over all the power of the machine. This is probably not directly related to the first point, so that this might be worth creating a second task. These behaviors make it difficult to use Blender in a more professional environment such as a render farm, because you have no control over what the Blender instances do anymore, if each one tries to hijack the entire system all the time. This can't be a good design in my opinion. System: Windows 7 x64 Worked last: Blender 2.77 ![report.png](https://archive.blender.org/developer/F401154/report.png)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @KaiKostack-3

Added subscriber: @KaiKostack-3

Added subscriber: @Sergey

Added subscriber: @Sergey

This was an intentional change to work around Windows stupidness when running on more than 64 logical processors.

Not sure why API will successfully change affinity when it's restricted externally, usually this is not supposed to happen.

There might be some work around for that.

This was an intentional change to work around Windows stupidness when running on more than 64 logical processors. Not sure why API will successfully change affinity when it's restricted externally, usually this is not supposed to happen. There might be some work around for that.
Author

An intentional change that ignores previous affinity settings just to overwrite it, is not really better than "Windows stupidness".

I would suggest to take these previous affinity settings into account within the 64 CPUs hack so that it becomes invisible again.

An intentional change that ignores previous affinity settings just to overwrite it, is not really better than "Windows stupidness". I would suggest to take these previous affinity settings into account within the 64 CPUs hack so that it becomes invisible again.
Sergey Sharybin self-assigned this 2016-11-15 17:28:27 +01:00

Added subscriber: @brecht

Added subscriber: @brecht

Not saying it's great to override manually specified affinity, just annoying that the whole 64+ threads on Windows is such a PITA :S

From a quick look around didn't find a reliable way of checking whether current CPU group is set by OS or by parent process which wants Blender to stick to a specific group only. So what about such policy:

  • Do not force any group/affinity if there's only one CPU group.
  • If there's more than one CPU groups, do not force group/affinity if the requested number of threads (in Preferences panel) is <= than number of threads in the current CPU group.

This way we will solve all regressions on a systems with single CPU group and will behave ok-ish on a systems with more than one CPU group.

Assigning to self, adding @brecht to check whether he have strong opinion here.

Not saying it's great to override manually specified affinity, just annoying that the whole 64+ threads on Windows is such a PITA :S From a quick look around didn't find a reliable way of checking whether current CPU group is set by OS or by parent process which wants Blender to stick to a specific group only. So what about such policy: - Do not force any group/affinity if there's only one CPU group. - If there's more than one CPU groups, do not force group/affinity if the requested number of threads (in Preferences panel) is <= than number of threads in the current CPU group. This way we will solve all regressions on a systems with single CPU group and will behave ok-ish on a systems with more than one CPU group. Assigning to self, adding @brecht to check whether he have strong opinion here.
Author

Appears good to me.

What about the compositor ignoring threads, should I create a separate report on this?

Appears good to me. What about the compositor ignoring threads, should I create a separate report on this?

Yes, think it's better to create separate report about compositor. I'm not fully sure yet why it happens tho, so would have a closer look tomorrow.

Feel free to assign that report to me.

Yes, think it's better to create separate report about compositor. I'm not fully sure yet why it happens tho, so would have a closer look tomorrow. Feel free to assign that report to me.
Author

I couldn't reproduce the compositor issue, so I assume a mistake from my side. It works correctly, don't bother.

I couldn't reproduce the compositor issue, so I assume a mistake from my side. It works correctly, don't bother.

@Sergey, the heuristic looks ok, I can't find anything in the Windows API docs to solve this completely.

@Sergey, the heuristic looks ok, I can't find anything in the Windows API docs to solve this completely.

This issue was referenced by blender/cycles@0835e5b394

This issue was referenced by blender/cycles@0835e5b394cc09022dc0a23d9223be07fbb44a2c

This issue was referenced by 751573ce6f

This issue was referenced by 751573ce6fff547b6a53769245814bc2d3fed17f

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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
4 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#50034
No description provided.