intel / DML

Intel® Data Mover Library (Intel® DML)
https://intel.github.io/DML/
MIT License
81 stars 17 forks source link

SIGILL on many Intel CPUs #3

Closed kilobyte closed 2 years ago

kilobyte commented 2 years ago

Hi! I'm afraid that the detection of supported CPU extensions is flaky. On a bunch of machines I've tested, most examples die at an AVX instruction not supported by the CPU. This includes even Pentium 4 which you explicitly list as supported!

Machines I've tested:

uarch model
Gemini Lake J4115
Skylake i7-6700K
Pinnacle Ridge TR 2990WX
Pentium 4 f15 m4 s3
Braswell N3160
Pentium 4 f15 m4 s1 DNC (32-bit)
Phenom 2 Thuban

You check cpuid, but take only cache info. The presence of AVX/AVX2/AVX512/etc is readily available there.

Arvinos commented 2 years ago

Hello @kilobyte, Currently library doesn't support dynamic dispatcher. The problem will fixed as dispatcher will be added.

EgorKupaev commented 2 years ago

Hello, @kilobyte , currently the issue lies in the options used for compilation.

target_compile_options(dml_core_px
    PRIVATE $<$<C_COMPILER_ID:GNU>:-mavx2>
    PRIVATE $<$<C_COMPILER_ID:MSVC>:/arch:AVX2>)

And as prerequisites state:

Minimal CPU vector instruction set supported for not optimized code is Intel® Streaming SIMD Extensions 2 (Pentium® 4 processor or higher)

I think AVX2 instructions enabled wrongly.

As a workaround now you can remove these options from: sources/cores/CMakeLists.txt

EgorKupaev commented 2 years ago

As part of v0.1.4-beta was removed -avx2 flag for non-optimized version of the library, so basically when the library is built without -DDML_AVX512 it uses default compiler options.

Additionally, the library's system requirements were clarified in the documentation.