AVX for Linux (32-bit)

For Intel processors we've a lot of new instruction sets (AVX and AVX2 already exists, AVX512 is announced). Therefore an application has to check during run time which instruction sets are available. I've written for that purpopse some procedures, which are callable from C or C++.

A strange result is that: With Ubuntu (64-bit), AVX is properly indicated. The 32-bit version doesn't indicate AVX (same CPU, other OS). So, the reason is probably that AVX isn't supported from the 32-bit kernel. I've an Ivy Bridge processor, which supports AVX. Does anyone know more destails? Your help and tips are welcome.

Gunther

Welcome to the forum.

Your post is devoid of specifics, so don't expect much targeted advice.

Are you using the CPUID instruction to detect AVX? That should work. For the specifics, there are posts on intel's site (and probably other places) demonstrating what to write/read from which registers.

However, if you actually want to use AVX, simply detecting CPU support is insufficient. Even if the CPU implements AVX, it cannot be used without operating system support (e.g. to save/restore the registers across context switches).

Regards,
Alister

1 Like

Thank you for your warm words.:b:

Yes, that's necessary. My code follows the recommendations of Intel in every detail. That's for sure.

That's the tricky point. Under 64-bit Linux support both the CPU and the operating system the AVX instruction set. No problem. But under 32-bit Linux, it lacks the support of the operating system.

At the moment I'm writing a program for a more detailed analysis of the problem.

Gunther