2.8 Builds are limited to 16 threads of processing #60585

Closed
opened 2019-01-17 04:30:48 +01:00 by Chris Clawson · 16 comments

Operating system: Windows 10 and Ubuntu 18.04 - 32 Core Threadripper 2990WX 64GB ECC memory
Graphics card: NVIDIA Quadro P2000
Last build tested: Jan 17 e57ee5934a , Jan 17 ad707115d5
Multi-thread editing features in both of the 64 bit Windows and Linux 64 builder.blender.org builds appear to be limited to 16 threads of computing. For example, Sculpt with smoothing brush runs the first 16 threads at 100% utilization, while leaving the other 75% of the CPU idle. Other features, such as mesh editing, seem to have the same restriction.
This issue was observed using htop in Ubuntu/Linux 18.04 and CPUID in Windows. Both provide realtime display of CPU thread utilization.
Update
Recreate the problem using Windows and the bmw27_cpu benchmark file.
Sculpting bmw27_cpu, with the smooth brush, works with any build, but only using the first 16 threads as described earlier. Other mesh editing exhibits similar limitations.

Operating system: Windows 10 and Ubuntu 18.04 - 32 Core Threadripper 2990WX 64GB ECC memory Graphics card: NVIDIA Quadro [P2000](https://archive.blender.org/developer/P2000.txt) Last build tested: Jan 17 e57ee5934a30 , Jan 17 ad707115d5bc Multi-thread editing features in both of the 64 bit Windows and Linux 64 builder.blender.org builds appear to be limited to 16 threads of computing. For example, Sculpt with smoothing brush runs the first 16 threads at 100% utilization, while leaving the other 75% of the CPU idle. Other features, such as mesh editing, seem to have the same restriction. This issue was observed using htop in Ubuntu/Linux 18.04 and CPUID in Windows. Both provide realtime display of CPU thread utilization. Update Recreate the problem using Windows and the bmw27_cpu benchmark file. Sculpting bmw27_cpu, with the smooth brush, works with any build, but only using the first 16 threads as described earlier. Other mesh editing exhibits similar limitations.
Author

Added subscriber: @ChrisClawson

Added subscriber: @ChrisClawson

Added subscriber: @brecht

Added subscriber: @brecht
Sergey Sharybin was assigned by Brecht Van Lommel 2019-01-17 19:23:32 +01:00

I can confirm this.

I can confirm this.

This issue was referenced by blender/cycles@a0825869a1

This issue was referenced by blender/cycles@a0825869a1cfb6f685ebd7fb6a2eca792c879e4b

This issue was referenced by c5eb10b110

This issue was referenced by c5eb10b1104bb0f15695be5d4394bbb8303ad092

This issue was referenced by be8202d90b

This issue was referenced by be8202d90bd9bd8e87d5111c45fb412925b2d472

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author

This report has led to correcting an important bug in Cycles rendering, but my intention was to report that my Threadripper never attempts to utilize more than 16 threads for any multi-threaded tasks.

Cycles, as of build 036ec5cae4 (Feb. 12) correctly uses all 64 threads in the AMD 32 core chip – but features such as Eevee and Workbench rendering, sculpt, compositor, and fluid simulation all make heavy use of the first sequential 16 threads of the CPU, but ignore the rest of the chip. This is also the case for any of the older 2.79 builds.

Please observe this limitation by running the included file in a AMD 32 Core Threadripper system, while monitoring CPU utilization, and do the following:

  1. Perform a Sculpt operation on the object.
  2. Render an Animation, using Eevee.
  3. Render an Animation, using Workbench.
  4. Render animation with Cycles CPU, and note that this is the only function which uses all 64 threads.
    bug28.blend
This report has led to correcting an important bug in Cycles rendering, but my intention was to report that my Threadripper never attempts to utilize more than 16 threads for any multi-threaded tasks. Cycles, as of build 036ec5cae4f7 (Feb. 12) correctly uses all 64 threads in the AMD 32 core chip – but features such as Eevee and Workbench rendering, sculpt, compositor, and fluid simulation all make heavy use of the first sequential 16 threads of the CPU, but ignore the rest of the chip. This is also the case for any of the older 2.79 builds. Please observe this limitation by running the included file in a AMD 32 Core Threadripper system, while monitoring CPU utilization, and do the following: 1. Perform a Sculpt operation on the object. 2. Render an Animation, using Eevee. 3. Render an Animation, using Workbench. 4. Render animation with Cycles CPU, and note that this is the only function which uses all 64 threads. [bug28.blend](https://archive.blender.org/developer/F6584613/bug28.blend)
Author

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'
Author

Sorry - I should have flagged this as "Open" in my previous comment.

Sorry - I should have flagged this as "Open" in my previous comment.

@Sergey, I can confirm this on Ubuntu. Commenting out numaAPI_RunProcessOnNode in threads.c avoids the problem.

To me it seems as if this is somehow inherited by threads. If that's the case I'm not sure what the right solution is, seems rather tricky to figure out all the places that might start a thread, some of them outside our control.

@Sergey, I can confirm this on Ubuntu. Commenting out `numaAPI_RunProcessOnNode` in `threads.c` avoids the problem. To me it seems as if this is somehow inherited by threads. If that's the case I'm not sure what the right solution is, seems rather tricky to figure out all the places that might start a thread, some of them outside our control.

@brecht, for our thread pool it's fairly simple fix. But is a good point about threads summoned by someone else.
Guess half-decent solution would be to not set affinity for main thread, but set it in thread pools (both Blender and Cycles) to:

  • Make sure data is localized per node/CPU group
  • Allow use of more than 64 threads on Windows

Wouldn't work if Cycles is indirectly initializes a threads (maybe in OIIO/OSL). Not sure if that's happening, and if so i don't think we can have any decent solution.

@brecht, for our thread pool it's fairly simple fix. But is a good point about threads summoned by someone else. Guess half-decent solution would be to not set affinity for main thread, but set it in thread pools (both Blender and Cycles) to: - Make sure data is localized per node/CPU group - Allow use of more than 64 threads on Windows Wouldn't work if Cycles is indirectly initializes a threads (maybe in OIIO/OSL). Not sure if that's happening, and if so i don't think we can have any decent solution.
Author

@Sergey, Please, let me repeat that Cycles currently works fine. All 64 threads are very active with a Cycles CPU render on the Threadripper. It is all the other functionality within Blender that has the 16 thread limitation.

@Sergey, Please, let me repeat that **Cycles currently works fine**. All 64 threads are very active with a Cycles CPU render on the Threadripper. It is all the ***other functionality*** within Blender that has the 16 thread limitation.

@ChrisClawson, I understand that, Those are all related issues, rooting to the fact that we've tried to give fastest core to the main thread. Cycles does special trickery to distribute its threads on all cores. Similar thing can be done for threads on Blender side. But we have no control over threads created by external libraries, like OpenJpeg and OpenEXR. Also, Cycles uses OIIO/OSL which might be creating threads as well, and those we also have no control over.

@ChrisClawson, I understand that, Those are all related issues, rooting to the fact that we've tried to give fastest core to the main thread. Cycles does special trickery to distribute its threads on all cores. Similar thing can be done for threads on Blender side. But we have no control over threads created by external libraries, like OpenJpeg and OpenEXR. Also, Cycles uses OIIO/OSL which might be creating threads as well, and those we also have no control over.

This issue was referenced by 76608f5ec5

This issue was referenced by 76608f5ec5e9737c7ef680a2234b8e3347b61c7b

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#60585
No description provided.