[gmx-users] gromacs-2020 build gcc/nvcc error

Ryan Woltz rlwoltz at ucdavis.edu
Thu Jan 30 23:30:35 CET 2020


Dear Szilárd,

         Thank you so much for your help. I performed the following steps
and it seems to have built successfully, I'll let you know if it does not
run correctly as well.

rm -r gromacs-2020/
sudo apt-get install gcc-8 g++-8
tar -xvzf gromacs-2020.tar.gz
cd gromacs-2020/
mkdir build
cd build
CMAKE_PREFIX_PATH=/usr/:/usr/local/cuda/ cmake ../ -DGMX_BUILD_OWN_FFTW=ON
-DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=ON
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -DCMAKE_BUILD_TYPE=release
make
make check
sudo make install
source /usr/local/gromacs/bin/GMXRC

Lastly, when I was building in default and ran into trouble I like to build
in debug so it gives details about building and helps me identify source of
the problems or identify relevant information to pass to you so you can
better help me. I appreciate your comment about not building in debugging
mode, but is there a way to run release in verbose mode? When I had
problems with other programs I'd usually build my first time in debugger
mode so I can monitor the process, then make clean and rebuild in default.
Is there a better way to do this?

Once again you help was greatly appreciated,

Ryan

PS again a few notes (if you have time to comment on anything incorrect) I
have for people needing a fix in the future and maybe myself if I do this
again in a few years and forget how.

CUDA version (nvcc --version) is 9.1. This is a little confusing to me
because you referenced CUDA 10.1 and I completely rebuilt this computer in
September 2019, so unless there is a new driver since then it should be
10.1? I grabbed the newest drivers I could find but my computer is
outputting 9.1 so I guess that is my version.

when building gromacs and I specify gcc/g++ verison 5, 8, or 9 it fails
with the original error message regarding glibc 23.2.

CMAKE_PREFIX_PATH=/usr/:/usr/local/cuda/ cmake ../
-DGMX_GPLUSPLUS_PATH=/usr/bin/g++-8 -DCUDA_HOST_COMPILER=gcc-8
-DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=/usr/bin/gcc-8
-DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=ON
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -DCMAKE_BUILD_TYPE=release

Do you know why this is? When I started this adventure I just had sudo
apt-get install gcc g++ build-essentials. Then I used gcc-5 g++-5 and
specified the version in the build step, which failed. after taking that
out and running sudo apt-get install gcc-9 g++-9 it passes "CMAKE" but
fails in "make". Based on your suggestions I ran the commands at the top of
the email to which then worked. Would this have worked if I had just
installed gcc-8 g++-8 from the beginning and ran CMAKE with no version
specification?


On Thu, Jan 30, 2020 at 5:50 AM Szilárd Páll <pall.szilard at gmail.com> wrote:

> Dear Ryan,
>
> On Wed, Jan 29, 2020 at 10:35 PM Ryan Woltz <rlwoltz at ucdavis.edu> wrote:
>
> > Dear Szilárd,
> >
> >          Thank you for your quick response. You are correct, after
> > issuing sudo apt-get install gcc-9 g++-9 CMake was run with:
> >
>
> gcc 9 is not supported with CUDA, as far as I know version 8 is the latest
> supported gcc in CUDA 10.2 (officially "native support" whatever they mean
> by that is for 7.3 on Ubuntu 18.04.3, see
> https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)
>
> CMAKE_PREFIX_PATH=/usr/:/usr/local/cuda/ cmake ../ -DGMX_BUILD_OWN_FFTW=ON
> > -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=ON
> > -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -DCMAKE_BUILD_TYPE=Debug
> >
>
> Don't use a Debug build unless you want to debug the GROMACS tools (it's
> slow).
>
> Make sure that you cmake configuration does actually use the gcc version
> you intend to use. The default invocation as above will pick up the default
> compiler toolchain (e.g. /us/bin/gcc in your case, you can verify that by
> opening the CMakeCache.txt file or using ccmake) -- and I think the lack of
> proper AVX512 support in your default gcc 5 (which you are stil; using) is
> the source of the issues you report below.
>
> You can explicitly set the compiler by passing CMAKE_CXX_COMPILER at the
> configure step; for details see
>
> http://manual.gromacs.org/current/install-guide/index.html?highlight=cxx%20compiler#typical-installation
>
> Cheers,
> --
> Szilárd
>
>
> > However now I'm getting an error in make
> >
> > make VERBOSE=1
> >
> > error:
> >
> > [ 25%] Building CXX object
> >
> >
> src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/kernels_simd_2xmm/kernel_ElecEwTwinCut_VdwLJEwCombGeom_F.cpp.o
> > In file included from
> >
> >
> /home/rlwoltz/protein_modeling/gromacs-2020/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512.h:46:0,
> >                  from
> > /home/rlwoltz/protein_modeling/gromacs-2020/src/gromacs/simd/simd.h:146,
> >                  from
> >
> >
> /home/rlwoltz/protein_modeling/gromacs-2020/src/gromacs/nbnxm/nbnxm_simd.h:40,
> >                  from
> >
> >
> /home/rlwoltz/protein_modeling/gromacs-2020/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_ElecEwTwinCut_VdwLJEwCombGeom_F.cpp:49:
> >
> >
> /home/rlwoltz/protein_modeling/gromacs-2020/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h:
> > In function ‘void gmx::gatherLoadTransposeHsimd(const float*, const
> float*,
> > const int32_t*, gmx::SimdFloat*, gmx::SimdFloat*) [with int align = 2;
> > int32_t = int]’:
> >
> >
> /home/rlwoltz/protein_modeling/gromacs-2020/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h:422:28:
> > error: the last argument must be scale 1, 2, 4, 8
> >      tmp1 = _mm512_castpd_ps(
> >                             ^
> >
> >
> /home/rlwoltz/protein_modeling/gromacs-2020/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h:424:28:
> > error: the last argument must be scale 1, 2, 4, 8
> >      tmp2 = _mm512_castpd_ps(
> >                             ^
> > src/gromacs/CMakeFiles/libgromacs.dir/build.make:13881: recipe for target
> >
> >
> 'src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/kernels_simd_2xmm/kernel_ElecEwTwinCut_VdwLJEwCombGeom_F.cpp.o'
> > failed
> > make[2]: ***
> >
> >
> [src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/kernels_simd_2xmm/kernel_ElecEwTwinCut_VdwLJEwCombGeom_F.cpp.o]
> > Error 1
> > CMakeFiles/Makefile2:2910: recipe for target
> > 'src/gromacs/CMakeFiles/libgromacs.dir/all' failed
> > make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
> > Makefile:162: recipe for target 'all' failed
> > make: *** [all] Error 2
> >
> > after doing a 1 hour google I found discussions saying that the error
> > (Makefile:162: recipe for target 'all' failed) is too vague with no
> general
> > solution. I found fixes for headers and other files for other programs
> but
> > not fixes for this file. The fix linked below is for gromacs-2018 and a
> > different file but the general problem seems to suggest it still is a
> > gcc/g++ version compatibility error correct? Any suggestions for this
> > error?
> >
> > https://redmine.gromacs.org/issues/2312
> >
> >
> > Thank you so much,
> >
> > Ryan
> >
> >  PS Just to document for anyone else going through what I did for
> > Gromacs-2020 these were my steps.
> >
> > sudo apt-get install gcc g++
> > cmake ../ -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
> -DGMX_GPU=ON
> >
> >  I then received multiple errors complaining about nvcc/C++
> > incompatibility. After researching found errors for previous gromacs
> > versions suggesting to use gcc-5 (but as you suggested this error has
> been
> > patched).
> >
> > sudo apt-get install gcc-5 g++-5
> > CMAKE_PREFIX_PATH=/usr/:/usr/local/cuda/ cmake ../
> > -DGMX_GPLUSPLUS_PATH=/usr/bin/g++-5 -DCUDA_HOST_COMPILER=gcc-5
> > -DCMAKE_CXX_COMPILER=g++-5 -DCMAKE_C_COMPILER=/usr/bin/gcc-5
> > -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=ON
> > -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -DCMAKE_BUILD_TYPE=Debug
> > -D_FORCE_INLINES=OFF
> >
> > Received different error described in previous email and solved with your
> > suggested solution. The key might be to specifically install latest
> version
> > number i.e.
> >
> > sudo apt-get install gcc-X g++-X (with X being the largest number
> > available).
> >
> >
> >
> >
> > On Wed, Jan 29, 2020 at 2:05 AM Szilárd Páll <pall.szilard at gmail.com>
> > wrote:
> >
> > > Hi Ryan,
> > >
> > > The issue you linked has been worked around in the build system, so my
> > > guess is that the issue you are seeing is not related.
> > >
> > > I would recommend that you update your software stack to the latest
> > version
> > > (both CUDA 9.1 and gcc 5 are a few years old). On Ubuntu 18.04 you
> should
> > > be able to get gcc 8 through the package manager. Together with
> > > upgrading to the latest CUDA might well solve your issues.
> > >
> > > Let us know if that worked!
> > >
> > > Cheers,
> > > --
> > > Szilárd
> > >
> > >
> > > On Wed, Jan 29, 2020 at 12:14 AM Ryan Woltz <rlwoltz at ucdavis.edu>
> wrote:
> > >
> > > > Hello Gromacs experts,
> > > >
> > > >           First things first, I apologize for any double post but I
> > just
> > > > joined the community so I'm very new and only found 1-2 posts related
> > to
> > > my
> > > > problem but the solutions did not work. I have been doing MD for
> about
> > > > 6-months using NAMD but want to also try out Gromacs. That being
> said I
> > > am
> > > > slightly familiar with CPU modeling programs like Rosetta, but I am
> > > totally
> > > > lost when it comes to fixing errors using GPU accelerated code for
> > CUDA.
> > > I
> > > > did find that at one point my error was fixed for an earlier version
> of
> > > > Gromacs but Gromacs-2020 may have resurfaced the same error again,
> here
> > > is
> > > > what I think my error is:
> > > >
> > > > https://redmine.gromacs.org/issues/1982
> > > >
> > > >     I am running Ubuntu 18.04.03 LTS, and gromacs-2020 I did
> initially
> > > have
> > > > the gcc/nvcc incompatible but I think installing and using
> gcc-5/g++-5
> > > > version command in cmake has fixed that issue. I have a NVIDIA card
> > with
> > > > CUDA-9.1 driver when I type nvcc --version.
> > > >
> > > > my cmake command is as follows:
> > > >
> > > > CMAKE_PREFIX_PATH=/usr/:/usr/local/cuda/ cmake ../
> > > > -DGMX_GPLUSPLUS_PATH=/usr/bin/g++-5 -DCUDA_HOST_COMPILER=gcc-5
> > > > -DCMAKE_CXX_COMPILER=g++-5 -DCMAKE_C_COMPILER=/usr/bin/gcc-5
> > > > -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_GPU=ON
> > > > -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -DCMAKE_BUILD_TYPE=Debug (I
> > did
> > > > try adding -D_FORCE_INLINES= based on the link above in my running
> > > command
> > > > but it did not work). I did look at the error log but it is way over
> my
> > > > head. I have in addition deleted the CMakeCache.txt file or the
> > unpacked
> > > > Gromacs and re-unzipped it to restart the cmake process to make sure
> it
> > > was
> > > > starting "clean". Is there any additional information I could
> provide?
> > > Does
> > > > anyone have a suggestion? Again I'm sorry if this is a duplicate,
> > > > everything I found on other sites was way over my head and I
> generally
> > > > understand what is going on but the forums I read on possible
> solutions
> > > > seem way over my head and I'm afraid I will break the driver if I
> > attempt
> > > > them (which has happened to me already and the computer required a
> full
> > > > reinstall).
> > > >
> > > > here is last lines from the build:
> > > >
> > > > -- Found HWLOC: /usr/lib/x86_64-linux-gnu/libhwloc.so (found suitable
> > > > version "1.11.6", minimum required is "1.5")
> > > > -- Looking for C++ include pthread.h
> > > > -- Looking for C++ include pthread.h - found
> > > > -- Atomic operations found
> > > > -- Performing Test PTHREAD_SETAFFINITY
> > > > -- Performing Test PTHREAD_SETAFFINITY - Success
> > > > -- Adding work-around for issue compiling CUDA code with glibc 2.23
> > > > string.h
> > > > -- Check for working NVCC/C++ compiler combination with nvcc
> > > > '/usr/local/cuda/bin/nvcc'
> > > > -- Check for working NVCC/C compiler combination - broken
> > > > -- /usr/local/cuda/bin/nvcc standard output: ''
> > > > -- /usr/local/cuda/bin/nvcc standard error:
> > > >  '/home/rlwoltz/protein_modeling/gromacs-2020/build/gcc-5: No such
> file
> > > or
> > > > directory
> > > > '
> > > > CMake Error at cmake/gmxManageNvccConfig.cmake:189 (message):
> > > >   CUDA compiler does not seem to be functional.
> > > > Call Stack (most recent call first):
> > > >   cmake/gmxManageGPU.cmake:207 (include)
> > > >   CMakeLists.txt:577 (gmx_gpu_setup)
> > > >
> > > >
> > > > -- Configuring incomplete, errors occurred!
> > > > See also
> > > >
> > > >
> > >
> >
> "/home/rlwoltz/protein_modeling/gromacs-2020/build/CMakeFiles/CMakeOutput.log".
> > > > See also
> > > >
> > > >
> > >
> >
> "/home/rlwoltz/protein_modeling/gromacs-2020/build/CMakeFiles/CMakeError.log".
> > > > --
> > > > Gromacs Users mailing list
> > > >
> > > > * Please search the archive at
> > > > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > > > posting!
> > > >
> > > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> > > >
> > > > * For (un)subscribe requests visit
> > > > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users
> or
> > > > send a mail to gmx-users-request at gromacs.org.
> > > >
> > > --
> > > Gromacs Users mailing list
> > >
> > > * Please search the archive at
> > > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > > posting!
> > >
> > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> > >
> > > * For (un)subscribe requests visit
> > > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> > > send a mail to gmx-users-request at gromacs.org.
> > --
> > Gromacs Users mailing list
> >
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > posting!
> >
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >
> > * For (un)subscribe requests visit
> > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> > send a mail to gmx-users-request at gromacs.org.
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.


More information about the gromacs.org_gmx-users mailing list