Error with avx512 support whilst installing GROMACS 2021.2 on Intel i9 machine

GROMACS version: 2021.2
GROMACS modification: No

System setup
-Intel i9-10980EX 3.00GHz (X-series processor - 18 cores, 36 threads, support instruction set extensions SSE4.1, SSE4.2, AVX2, AVX-512)
-Running Ubuntu 20.04 on Win 10 Windows Subsystem for Linux (WSL kernel is 5.10.16.3-microsoft-standard-WSL2)
-NVIDIA Quadro RTX 4000 (compute capability 7.5)
-Cuda 11.3
-GNU C/C++ - 9.3

I already have a Gromacs 2018 installed (and working). However, until a couple of weeks ago I didn’t need GPU support, so I’m installing the latest version of Gromacs with CUDA support.

My GROMACS configuration
cmake … -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=CUDA -DCMAKE_INSTALL_PREFIX=/hom/ubuntu/gromacs-2021.2-build -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11.0

The first link of cmake is:
The GROMACS-managed build of FFTW 3 will configure with the following optimizations: --enable-sse2;–enable-avx;–enable-avx2;–enable-avx512

My error:
In file included from …/…/…/dft/simd/n1f.h:21,

  •             from ../common/n1fv_2.c:70,*
    
  •             from n1fv_2.c:3:*
    

…/…/…/simd-support/simd-avx2.h:43:2: error: #error “compiling simd-avx2.h without avx2 support”

  • 43 | #error “compiling simd-avx2.h without avx2 support”*

I tried manually installing FFTW3 without specifying the instruction set, which works fine, but GROMACS still throws the above error. I went back to the manual installation of FFTW3 and reinstalled it several times adjusting the SIMD support. If I enable avx2 the FFTW3 make check crashes complaining of no support for avx2.

I am at a loss how to explain what’s going on. My earlier version of GROMACS (same machine, nothing much has changed), works fine minus CUDA support and my chip supports the requested instruction sets. Any suggestions are very much welcomed.

Hi acnash,

There’s a typo in your CMake line (it should be -DGMX_BUILD_OWN_FFTW=ON), but I presume that’s just when you wrote it here.

Run “make VERBOSE=1” and paste the entire exact compiler command used for the file where it’s failing.

However, if you indeed get the same error if you just try to compile FFTW yourself, then the error might rather be in the combination of FFTW3 and WSL rather than anything related to GROMACS.

Cheers,

Erik

Thanks for spotting that - yes, it was a typo here, not in the terminal.

Does GROMACS ever install without FFTW support? I ask because I installed GROMACS 2018* on this machine without problems.

I noticed, on launching Ubuntu WSL I have the word “(base)” before $ in the terminal window. This disappears on conda deactivate and then I can then successfully install FFTW3 manually.

With FFTW manually installed I assume I used -DGMX_BUILD_OWN_FFTW=OFF? Having done that I’m now sitting at 9% during the make - further than I got before. If this work, I’ll post somewhere the steps I had to go through to get CUDA, FFTW and Gromacs installed on Ubuntu WSL.

Looks like deactivating conda has partially solved my install issue. Unfortunately, make got to 95% before crashing out.

The process so far:

  1. Deactivate conda (the “(base)” no vanishes).
    2)Installed FFTW3 manually whilst specifying the necessary instruction sets. Before deactivating conda, this would always fail when I specify avx2.
  2. For gromacs configuration: cmake … -DGMX_GPU=CUDA -DCMAKE_INSTALL_PREFIX=/hom/ubuntu/gromacs-2021.2-build -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11.0 -DGMX_BUILD_OWN_FFTW=OFF (I can also turn -DGMX_BUILD_OWN_FFTW=ON and it doesn’t complain about avx2 when I perform make - however, I now get a different error we’ll ignore for a bit).
  3. sudo make -j 16

I now get the error:

[ 95%] Built target nblib
Scanning dependencies of target methane-water-integration
[ 95%] Building CXX object api/nblib/samples/CMakeFiles/methane-water-integration.dir/methane-water-integration.cpp.o
[ 95%] Linking CXX executable …/…/…/bin/methane-water-integration
/home/ubuntu/miniconda3/bin/…/lib/gcc/x86_64-conda-linux-gnu/9.3.0/…/…/…/…/x86_64-conda-linux-gnu/bin/ld: warning: libcufft.so.10, needed by /home/ubuntu/gromacs-2021.2/gromacs-build/lib/libgromacs.so.6, not found (try using -rpath or -rpath-link)
/home/ubuntu/miniconda3/bin/…/lib/gcc/x86_64-conda-linux-gnu/9.3.0/…/…/…/…/x86_64-conda-linux-gnu/bin/ld: /home/ubuntu/gromacs-2021.2/gromacs-build/lib/libgromacs.so.6: undefined reference to cufftExecC2R@libcufft.so.10' /home/ubuntu/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/ubuntu/gromacs-2021.2/gromacs-build/lib/libgromacs.so.6: undefined reference to cufftSetStream@libcufft.so.10’
/home/ubuntu/miniconda3/bin/…/lib/gcc/x86_64-conda-linux-gnu/9.3.0/…/…/…/…/x86_64-conda-linux-gnu/bin/ld: /home/ubuntu/gromacs-2021.2/gromacs-build/lib/libgromacs.so.6: undefined reference to cufftPlanMany@libcufft.so.10' /home/ubuntu/miniconda3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/ubuntu/gromacs-2021.2/gromacs-build/lib/libgromacs.so.6: undefined reference to cufftDestroy@libcufft.so.10’
/home/ubuntu/miniconda3/bin/…/lib/gcc/x86_64-conda-linux-gnu/9.3.0/…/…/…/…/x86_64-conda-linux-gnu/bin/ld: /home/ubuntu/gromacs-2021.2/gromacs-build/lib/libgromacs.so.6: undefined reference to `cufftExecR2C@libcufft.so.10’
collect2: error: ld returned 1 exit status
make[2]: *** [api/nblib/samples/CMakeFiles/methane-water-integration.dir/build.make:85: bin/methane-water-integration] Error 1
make[1]: *** [CMakeFiles/Makefile2:4437: api/nblib/samples/CMakeFiles/methane-water-integration.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

I have no idea!

Did you start the build from a completely fresh directory, e.g. by removing all the previous build files? It looks like you’re still using some components of the previous conda environment, which may mean you’ve got incorrect linking.

Quite right you are. I forgot to clean up the place after deactivating conda.
Now, having done that and using the same commands above Gromacs is now installed. Unfortunately, I’m running into the exact same problems I was having with my 2018 distribution:

Fatal error:
Cannot run short-ranged nonbonded interactions on a GPU because no GPU is
detected.

In short, I’m seeing a lot of “Cuda” whilst installing Gromacs (and I’ve specified the latest cuda library set, version 11.0 during the gromacs configure step), but I’m also seeing this:

ubuntu@DESKTOP-L2JG9M2:~/DE_NOVO_PROTEINS/EPOC_0/0$ nvidia-smi
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

I did install the latest drivers :-(

Update: Going through an NVIDIA forum and it looks like there is a Windows/NVIDIA bug when it comes to running the latest Cuda drivers under WSL.