Page MenuHome

Ctest : Win32 + AVX2 fails virtually all cycles tests.
Closed, ResolvedPublic


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.

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

Related Objects

Event Timeline

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

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

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:

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

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)