Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28381 Discussions

SSE error in compilation with xHost option on AMD Zen 3 CPU

artu72
Beginner
3,692 Views

On a host with an AMD Ryzen 5800X CPU (zen 3 architecture), compiling a fortran 90 code with -xHost opion raises the error

catastrophic error: Function return parameter requires SSE register while SSE is disabled

corresponding to a row whit a square root of a quadruple precision floating point value.

If I replace -xHost option with a -march=core-avx2 one, the compilation goes fine. 

The compiler is ifort Version 2021.2.0 Build 20210228_000000

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
3,623 Views

If your CPU supports AVX2 (which it does), then yes, that's the right choice. It is what -xHost should do anyway. Do keep in mind that -fp-model:strict will reduce performance. You may want to use this only on the sources where you need that.

View solution in original post

0 Kudos
5 Replies
Steve_Lionel
Honored Contributor III
3,669 Views

Please provide an example source that demonstrates the problem. I'd also be interested in the output of compiling this source with the -# option (I'm not sure if that's the right one for Linux, but it might be.) I wrote the original compiler code to implement -xHost - it uses a CPUID instruction and looks at the feature bits returned if a non-Intel CPU. That was some years ago - the code may have been altered since then. But the -# output will at least show what features the driver THINKS the CPU has.

0 Kudos
artu72
Beginner
3,658 Views

Thank you for your kind reply. Meanwhile, I have found that the culprit is the -fp-model strict option. By removing it, the compilation is ok. I attach here a sample code that reproduces the problematic part. By compiling it with

ifort -O3 -xHost test-amd.f90 -o test-amd -fp-model strict

there is the error. By removing -xHost or -fp-model strict option, it works. I attach here also the output generated by inserting -# option. As said before, by issuing

ifort -O3 -march=core-avx2 test-amd.f90 -o test-amd -fp-model strict

it works again.

UPDATE: the fp-model source option gives the same behavior as strict one.

0 Kudos
Steve_Lionel
Honored Contributor III
3,646 Views

Thanks. The output you attached shows that the compiler believes the processor supports SSE4 and AVX1, at least. You've identified a compiler bug, to be sure. Do you have purchased support? If so, I'd encourage you to report this at the Intel Online Service Center. If not, hope that one of the Intel support engineers sees this and picks it up. I'll comment that for Fortran, source and strict are the same (they aren't for Intel C++.)

0 Kudos
artu72
Beginner
3,641 Views

Hi Steve, I will report the bug to the IT staff in my company, they have a corporate support. Thank you very much for the support. As workaround, can I use  -march=core-avx2 instead of -xHost to have the best code on my CPU?

0 Kudos
Steve_Lionel
Honored Contributor III
3,624 Views

If your CPU supports AVX2 (which it does), then yes, that's the right choice. It is what -xHost should do anyway. Do keep in mind that -fp-model:strict will reduce performance. You may want to use this only on the sources where you need that.

0 Kudos
Reply