espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
230 stars 187 forks source link

CUDA does not compile #1455

Closed sgekle closed 7 years ago

sgekle commented 7 years ago

When trying to compile with CUDA, I consistently get errors like

[ 1%] Building NVCC (Device) object src/core/CMakeFiles/EspressoCuda.dir/EspressoCuda_generated_p3m_gpu_error_cuda.cu.o nvcc fatal : Unsupported gpu architecture 'compute_52' CMake Error at EspressoCuda_generated_p3m_gpu_error_cuda.cu.o.cmake:203 (message): Error generating /home/btpj/bt301429/progs/espressoPy/buildCUDA/src/core/CMakeFiles/EspressoCuda.dir//./EspressoCuda_generated_p3m_gpu_error_cuda.cu.o

The file where the error is reported changes (depending on the order in which they are compiled by make -j), it seems to happen with all .cu files. I tried CUDA 6.5 and 8.0, same result. On the very same system, ESPResSo 3.3.1 runs perfectly with CUDA.

Any suggestions are welcome! Thanks

fweik commented 7 years ago

Hm, we did recently update the nvcc compile flags (c.f. #1412) so that the code runs on the newest nvidia architecture. Compilation works here with

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17

(that's the one that ships with ubuntu 16.04).

mkuron commented 7 years ago

CUDA 6.5 is too old to support compute_52. CUDA 7.5 and 8.0 do support it though. We run 7.5 on Travis and Gitlab-CI and I tested 8.0 a few days ago.

mkuron commented 7 years ago

Also, we don't support anything below 7.0 because we require C++11 support.

sgekle commented 7 years ago

Thanks, I think I have found the solution. For some reason the ccmake entry CUDA_TOOLKIT_ROOT_DIR continues to point to the 6.5 version, although the environment variables all have been set to point 7.5 and I have reconfigured/generated a number of times. Forcing it by hand to use 7.5 in CUDA_TOOLKIT_ROOT_DIR makes the system compile.

How does ccmake determine which cuda version to use if there are different versions installed? Maybe one can teach ccmake to always look for a compatible version and not to use an old version even if it is installed on the system?

Another thing I discovered on the way: I compiled with LB_GPU but not with LB. Then a script with the python commands lb.LBFluid, lbf[].velocity etc. can be executed, but the LB fluid is not there, i.e., all the LB velocities are zero. Should it not rather throw an error if one tries to use lb.LBFluid without having the CPU-Version of LB compiled in?

Best,

  Stephan

Am 29.09.17 um 12:40 schrieb Michael Kuron:

CUDA 6.5 is too old to support |compute_52|. CUDA 7.5 and 8.0 do support it though. We run 7.5 on Travis and Gitlab-CI and I tested 8.0 a few days ago. Maybe we should check the CUDA version in CMake and only append the supported architectures to the list.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/espressomd/espresso/issues/1455#issuecomment-333093638, or mute the thread https://github.com/notifications/unsubscribe-auth/AFU6qEwezH1tnD0fbFUpTi91oeOQ9Nklks5snMkKgaJpZM4PodVc.

fweik commented 7 years ago

This is found by the FindCUDA module which is part of cmake. I don't think we should replace that with a custom solution.

mkuron commented 7 years ago

CMake documentation says:

To use a different installed version of the toolkit set the environment variable CUDA_BIN_PATH before running cmake

We could require a minimum CUDA version with find_package(CUDA 7.5) instead of find_package(CUDA).