Fatal error C1001: Internal compiler error only in Release build by Visual Studio 2019

GROMACS version:2021.2
GROMACS modification: Yes
Here post your question

My environment:

Windows 10 Version: 1607
Visual studio version: 2019
FFTW: 3.3.9
cmake: 3.21.2
CUDA: 11.2

Visual Studio has build options like “Debug” and “Release” options when building the C++ project. The “Debug” option doesn’t optimize the code, so its output binary is very slow. My PC has GPU but binary file by “Debug” mode can calculate only 23s per day.

キャプチャ

However, I encountered following error only when I run the Release build of Visual Studio. Debug build didn’t return such errors.

46>C:\GROMACS\gromacs-2021.2\src\gromacs\simd\impl_x86_avx_512\impl_x86_avx_512_simd_float.h(194): fatal error C1001: Internal compiler error.
46>(compiler file 'd:\a01\_work\3\s\src\vctools\Compiler\Utc\src\p2\main.c', line 213)

Output by Release build (error occured):

Output by Debug build (error didn’t occured):

I have prepared the installation following the instruction below. I chose fftw option.

Source Code of Gromacs that I edited gmxManageNvccConfig.cmake in gromacs-2021.2\cmake as the instrction is uploaded to Google Drive. (Link is below.)
https://drive.google.com/drive/folders/1JaDc6AEmelEa3Q1QyWAa6FpEXTC_nOAc?usp=sharing

I’ve posted the exact same question in Visual Studio Community. If someone can infer any cause for this error I would appriciate it.

You may be able to work around it by compiling with AVX2 SIMD instead of AVX512, that is
cmake -DGMX_SIMD=AVX2_256

With this you may give up some performance in CPU-only runs (likely little to none in GPU runs), but nowhere near as much as you the performance you sacrifice with Debug mode.

Thank you so much, it avoided the error and succeed in compile.

I rebuilt the code in release mode and saw significant improvement in performance 23ns/day to 148ns/day for GROMACS Tutorial “Lysozyme in water” (all atomic simulation of 33876 atoms and dt=2fs).

Meanwhile, it remains unclear why Visual Studio cannot compile with the option of utilizing AVX512 instruction set. My CPU is Intel® Xeon® Gold 6134 so it should support it.

Good to hear!

The error suggest a compiler bug.