Page MenuHome

Wrong CPU Features Detection (AVX)
Closed, ResolvedPublic

Description

System Information
Operating system: Linux (Solus 4.3)
Graphics card: integrated
CPU: i5-2520M

Blender Version
Broken: 2.95.5, 2.90.1

Short description of error
Executing

blender -b --cycles-debug

wrongfully detects AVX2 as supported:

./blender -b --debug-cycles
Blender 2.93.5 (hash a791bdabd0b2 built 2021-10-06 06:26:10)
Read prefs: /home/********/.config/blender/2.93/config/userpref.blend
I1031 12:00:53.643395  1170 blender_python.cpp:195] Debug flags initialized to:
CPU flags:
  AVX2       : True
  AVX        : True
  SSE4.1     : True
  SSE3       : True
  SSE2       : True
  BVH layout : EMBREE
  Split      : False
CUDA flags:
  Adaptive Compile : False
OptiX flags:
  CUDA streams : 1
OpenCL flags:
  Device type    : ALL
  Debug          : False
  Memory limit   : 0

Blender quit

This is the output of

lscpu | grep avx
lscpu | grep avx
Markierungen:                  fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts md_clear flush_l1d

Event Timeline

This (currently) reports how the debug flags are configured (ie you can turn kernels off using environment variables ie CYCLES_CPU_NO_AVX=1 to force sse41 kernels) not the actual CPU flags, even though it reports it'll consider AVX2 when you actually render it will pick the AVX kernel since the actual cpu doesn't support AVX2.

To be sure tested on an box without AVX2

I1031 10:09:50.180510 19252 python.cpp:160] Debug flags initialized to:
CPU flags:
  AVX2       : True
  AVX        : True
  SSE4.1     : True
  SSE3       : True
  SSE2       : True
  BVH layout : EMBREE
CUDA flags:
  Adaptive Compile : False
OptiX flags:
  Debug : False
HIP flags:
  HIP streams : False
Read blend: k:\BlenderGit\2022_full\bin\Debug\D6267.blend
I1031 10:09:51.064492 19252 device_impl.cpp:71] Will be using AVX kernels.
I1031 10:09:51.073210 19252 device_impl.cpp:71] Will be using AVX kernels.
I1031 10:09:51.077208 19252 sync.cpp:369] Used Scrambling Distance: 1

Now if this is a bug or not, personally I could go either way, I mean it clearly states it's the debug flags, on the other hand, I could see users expecting it to report actual CPU support.

I See. So I just misunderstood its purpose. Even more awesome that it still gets changed. Thank you very much. And thanks for the explanation, I apreciate your time.