amd / amd-fftw

FFTW code optimized for AMD based processors
GNU General Public License v2.0
48 stars 12 forks source link

Could not find fftwf_plan_many_[r2c|c2r] libfftw3.so #3

Closed aheumaier closed 3 years ago

aheumaier commented 4 years ago

Using this optimized fftw running GROMACS 2020 following this AMD Whitepaper results in the following error on including the lib running cmake:

(...)
-- Checking for module 'fftw3f'
--   Found fftw3f, version 3.3.8
-- Looking for fftwf_plan_many_dft in /usr/local/lib/libfftw3.so
-- Looking for fftwf_plan_many_dft in /usr/local/lib/libfftw3.so - not found
-- Looking for fftwf_plan_many_dft_r2c in /usr/local/lib/libfftw3.so
-- Looking for fftwf_plan_many_dft_r2c in /usr/local/lib/libfftw3.so - not found
-- Looking for fftwf_plan_many_dft_c2r in /usr/local/lib/libfftw3.so
-- Looking for fftwf_plan_many_dft_c2r in /usr/local/lib/libfftw3.so - not found
CMake Error at cmake/FindFFTW.cmake:105 (message):
  Could not find fftwf_plan_many_[r2c|c2r] in /usr/local/lib/libfftw3.so,
(...)

Expecting this functions to be implemented

Reproduce with:

Building amd-fftw on Ubuntu 20.04

~/amd-fftw$ ./configure --enable-sse2 --enable-avx --enable-avx2 --enable-shared  --enable-amd-opt --enable-amd-trans --enable-float
~/amd-fftw$ make -j48
~/amd-fftw$ sudo make install

Building GROMACS 2020 on Ubuntu 20.04

Run in ~/gromacs-2020/build$

#!/bin/bash
set -euo pipefail

rm -f CMakeCache.txt  
make clean

CMAKE_PREFIX_PATH=/usr/local/ cmake .. \
     -DGMX_BUILD_OWN_FFTW=OFF \
     -DGMX_FFT_LIBRARY=fftw3 \
     -DFFTWF_LIBRARY=/usr/local/lib/libfftw3.so \
     -DFFTWF_INCLUDE_DIR=/usr/local/include \
     -DREGRESSIONTEST_DOWNLOAD=ON \
     -DGMX_GPU=ON \
     -DCUDA_TOOLKIT_ROOT_DIR=/usr/lib/cuda/ \
     -DCMAKE_C_COMPILER=gcc-8 \
     -DCMAKE_CXX_COMPILER=g++-8 \
     -DCMAKE_C_FLAGS="-march=znver1 -O3" \
     -DCMAKE_CXX_FLAGS="-march=znver1 -O3"

make -j48
make check -j24
BiplabRaut commented 4 years ago

Dear Andreas, We looked into the issue reported by you. Please find the details below:-

You are building amd-fftw library in single-precision mode using --enable-float whereas GROMACS is being built with double-precision support -DGMX_FFT_LIBRARY=fftw3. In case you intend to build GROMACS with single-precision amd-fftw library, then you should build GROMACS in single-precision itself using -DGMX_FFT_LIBRARY=fftw3f.

In case you intend to build GROMACS in double-precision, then please build amd-fftw library first in double-precision mode (i.e. without –enable-float). You need to use below additional options to build GROMACS in double-precision: -DGMX_DOUBLE=on -DCMAKE_PREFIX_PATH=< fftw library path >

Hope the above information helps you in resolving your build errors. Please let us know if you have any further questions/issues related to amd-fftw.

You can reach out to our support mail-id toolchainsupport@amd.com for queries/issues related to amd-fftw or any other AMD tool chain.

Thanks.

aheumaier commented 4 years ago

Thank you very much for your quick response!,

I try to go for a single prescision. Unfortunatlely Gromaks 2020 doesn't support that target :

CMake Error at cmake/gmxOptionUtilities.cmake:79 (message):
  Invalid value for GMX_FFT_LIBRARY: fftw3f.  Pick one of: fftw3, mkl,
  fftpack[built-in]

And running with double precision isn't supported by using the CUDA target

CMake Error at cmake/gmxManageGPU.cmake:50 (message):
  GPU acceleration is not available in double precision!
Call Stack (most recent call first):
  CMakeLists.txt:213 (include)

Any suggestion how to go from here? Targeted are MD Simulations

BiplabRaut commented 3 years ago

I hope your issue is resolved already. You can always reach out to our support mail-id toolchainsupport@amd.com for queries/issues. Thank you.