linuxunixavxsuseavx2

How to tell if a Linux machine supports AVX/AVX2 instructions?


I'm on SUSE Linux Enterprise 10/11 machines. I launch my regressions to a farm of machines running Intel processors. Some of my tests fail because my tools are built using a library which requires AVX/AVX2 instruction support. I get an Illegal exception error.

In Linux, is there any commands I can use to determine what is the CPU code/family name?

I believe AVX and AVX2 are available onward from Intel SandyBridge and Haswell family, respectively.


Solution

  • On linux (or unix machines) the information about your cpu is in /proc/cpuinfo. You can extract information from there by hand, or with a grep command (grep flags /proc/cpuinfo).

    Also most compilers will automatically define __AVX2__ so you can check for that too.