automation for setting GMX_GPU & cmake GPU detection
authorSzilard Pall <pszilard@cbr.su.se>
Mon, 12 Nov 2012 02:55:17 +0000 (03:55 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 29 Nov 2012 01:34:59 +0000 (02:34 +0100)
commitef1127f10a50244ad47abd1269861fb045ff9ac8
treecaa927b520fe1f34cf6dbc1c79e57a6e82208956
parent2dac36369772ae0b399053a2cc4e1f02d998698e
automation for setting GMX_GPU & cmake GPU detection

Implemented detection of NVIDIA GPUs in CMake using:
 - output of nvidia-smi (if available Linux/Mac/Win);
 - presence and content of of /proc/driver/nvidia/gpus/*/information
   (Linux)
 - output of lspci (Linux)
Although the current implementation is not able to decide whether a GPU
is compatible with GROMACS, the build system is now able to hint the
user that there are potentially useful GPU compute resources.

Additionally, if GMX_GPU is not set explicitly by the user, its value
is considered to be and implicit "auto" with OFF as default. In this
case CUDA detection will be attempted and if successful, GMX_GPU is
set to "ON", otherwise kept "OFF".
If CUDA is not found and the user requested GPU acceleration, an
immediate fatal error is issued. If the user did not set GMX_GPU, a
non-fatal warning is issued at the end of the configuration with
additional information if GPUs were detected.

Fixes #1018

Change-Id: Iffa9ed343bed4278cffba5e2eb9f8b81f590b31d
CMakeLists.txt
cmake/gmxDetectGpu.cmake [new file with mode: 0644]
cmake/gmxManageGPU.cmake [new file with mode: 0644]