Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

Verify that both the operating system and the processor support Intel(R) AVX and F16C instructions.

keith_correa
Beginner
2,064 Views

Hello!

I have an application compiled using the /QxAVX compiler flag and on a multi-boot test machine running Windows 2019 Server, Windows 10 and Windows 11, I get the following error when running the application on Windows 11: Please verify that both the operating system and the processor support Intel(R) AVX and F16C instructions.

The same application runs fine on Windows 2019 Server and Window 10 on the same machine.

CoreInfo for the processor is attached. In the attachment, a '*' indicates support and a '-' indicates no support.

It shows that F16C is supported so any idea what could be causing this?

0 Kudos
4 Replies
Theshe
Novice
2,048 Views

AVX requires support from the CPU and also from the operating system.

 

There is a CPUID flag to check for AVX support by the CPU.

 

The feature test bit for AVX is #28 in the register ECX, after the CPUID instruction was called with EAX set to 1:

https://en.wikipedia.org/wiki/CPUID#EAX=1:_Processor_Info_and_Feature_Bits

 

(this alone does not mean the OS actually supports AVX)

 

To check if AVX support is actually enabled in the operation system, you have to check XCR0, by calling _xgetbv():

https://www.felixcloutier.com/x86/xgetbv

 

Bit #2 of the XCR0 value indicates that AVX support has been enabled by the OS:

https://en.wikipedia.org/wiki/Control_register#XCR0_and_XSS

MadhuK_Intel
Moderator
2,023 Views

Hi,


Thank you for posting in Intel communities.


Could you please provide the details of the Intel Compiler, intel OneAPI toolkit version, and Visual Studio version (if you are using it)?

Could you please provide a sample reproducer code and the steps to reproduce your issue at our end?


Best Regards,

Madhu


0 Kudos
keith_correa
Beginner
2,014 Views

Using this code, I found that usage of XSAVE/XRSTORE were not enabled by the OS. After a lot of digging, I found that the Windows driver "hwpolicy" which loads on boot was disabled from the registry. Changing the Start value to Boot fixed the problem and all is well now. Thanks to all that replied to me.

0 Kudos
MadhuK_Intel
Moderator
1,991 Views

Hi,


>"fixed the problem and all is well now."


Glad to know that your issue is resolved. Thanks for sharing the solution with us. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Madhu


0 Kudos
Reply