Ctest : Win32 + AVX2 fails virtually all cycles tests. #64624

Closed
opened 2019-05-14 22:02:41 +02:00 by Ray molenkamp · 10 comments
Member

System Information
Operating system: Win32
Graphics card: N/A

Blender Version
Broken: Master X86 on an AVX2 cpu on windows (i have no test metrics yet on linux32 bit)
Worked: no idea

Short description of error

Cycles is really unhappy with the combination of X86 and AVX2, see attached testing report for details.CyclesTestReport.205.zip

When run on AVX beyond a handful few actually broken tests all pass.

Exact steps for others to reproduce the error
run test suite on x86 + AVX2

**System Information** Operating system: Win32 Graphics card: N/A **Blender Version** Broken: Master X86 on an AVX2 cpu on windows (i have no test metrics yet on linux32 bit) Worked: no idea **Short description of error** Cycles is really unhappy with the combination of X86 and AVX2, see attached testing report for details.[CyclesTestReport.205.zip](https://archive.blender.org/developer/F7037266/CyclesTestReport.205.zip) When run on AVX beyond a handful few actually broken tests all pass. **Exact steps for others to reproduce the error** run test suite on x86 + AVX2
Author
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Sergey Sharybin was assigned by Ray molenkamp 2019-05-14 22:08:02 +02:00
Author
Member

think you had some ideas there, mind taking a peek?

think you had some ideas there, mind taking a peek?

Added subscriber: @brecht

Added subscriber: @brecht

Simply disabling AVX2 on x86 might work:

diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp
index 0cd991c6231..6064701fcbc 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -299,9 +299,13 @@ bool system_cpu_support_avx()

 bool system_cpu_support_avx2()
 {
+#  if defined(__x86_64__) || defined(_M_X64)
   CPUCapabilities &caps = system_cpu_capabilities();
   return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && caps.avx && caps.f16c &&
          caps.avx2 && caps.fma3 && caps.bmi1 && caps.bmi2;
+#  else
+  return false;
+#  endif
 }
 #else
Simply disabling AVX2 on x86 might work: ``` diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index 0cd991c6231..6064701fcbc 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -299,9 +299,13 @@ bool system_cpu_support_avx() bool system_cpu_support_avx2() { +# if defined(__x86_64__) || defined(_M_X64) CPUCapabilities &caps = system_cpu_capabilities(); return caps.sse && caps.sse2 && caps.sse3 && caps.ssse3 && caps.sse41 && caps.avx && caps.f16c && caps.avx2 && caps.fma3 && caps.bmi1 && caps.bmi2; +# else + return false; +# endif } #else ```
Author
Member

I'm still on Ivy Bridge so can't easily test this. patch looks like it would work though.

I'm still on Ivy Bridge so can't easily test this. patch looks like it would work though.

I would keep the system utilities as-is and will not do a kernel-specific tweaks in there. Would prefer something like this with a comment that 32bit kernel doesn't do vectorization and hence can not advertise BVH8:

P974: (An Untitled Masterwork)

diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index 837a8186064..dc9adcb1537 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -332,9 +332,11 @@ class CPUDevice : public Device {
     if (DebugFlags().cpu.has_sse2() && system_cpu_support_sse2()) {
       bvh_layout_mask |= BVH_LAYOUT_BVH4;
     }
+#if defined(__x86_64__) || defined(_M_X64)
     if (DebugFlags().cpu.has_avx2() && system_cpu_support_avx2()) {
       bvh_layout_mask |= BVH_LAYOUT_BVH8;
     }
+#endif
 #ifdef WITH_EMBREE
     bvh_layout_mask |= BVH_LAYOUT_EMBREE;
 #endif /* WITH_EMBREE */

I would keep the system utilities as-is and will not do a kernel-specific tweaks in there. Would prefer something like this with a comment that 32bit kernel doesn't do vectorization and hence can not advertise BVH8: [P974: (An Untitled Masterwork)](https://archive.blender.org/developer/P974.txt) ``` diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 837a8186064..dc9adcb1537 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -332,9 +332,11 @@ class CPUDevice : public Device { if (DebugFlags().cpu.has_sse2() && system_cpu_support_sse2()) { bvh_layout_mask |= BVH_LAYOUT_BVH4; } +#if defined(__x86_64__) || defined(_M_X64) if (DebugFlags().cpu.has_avx2() && system_cpu_support_avx2()) { bvh_layout_mask |= BVH_LAYOUT_BVH8; } +#endif #ifdef WITH_EMBREE bvh_layout_mask |= BVH_LAYOUT_EMBREE; #endif /* WITH_EMBREE */ ```
Author
Member

I tested sergeys patch with intels sde emulating an avx2 core (test took, 1.5 hours.. yikes..) and it makes most of the tests pass now (the failing ones seem unrelated to this issue and fail on avx/sse as well)

I tested sergeys patch with intels sde emulating an avx2 core (test took, 1.5 hours.. yikes..) and it makes most of the tests pass now (the failing ones seem unrelated to this issue and fail on avx/sse as well)

This issue was referenced by blender/cycles@7a497fb71a

This issue was referenced by blender/cycles@7a497fb71ae1113205981249b3d968f419e31e3e

This issue was referenced by fced0f0437

This issue was referenced by fced0f043786bf54fa1e2bc4a78c91883fee8ed8

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