From 8b14e14f4a18193eacc86a2da9a4d812df0e03eb Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 12 Jan 2016 15:47:37 +0100 Subject: [PATCH] Allowed NVML support to be toggled A new CMake advanced option GMX_USE_NVML takes its default value from the result of the NVML detection, thus by default NVML support is on only if the detection succeeds. It can be turned off or on at will, but when set on, it will give a fatal error if the detection did not succeed. Split the NVML section of the install guide into its own paragraph. Fixes #1835 Change-Id: Ic1bf025fcd807eb701d0b52afe35b11b2d75f402 --- cmake/gmxManageGPU.cmake | 18 ++++++++++++------ docs/install-guide/index.rst | 6 +++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/cmake/gmxManageGPU.cmake b/cmake/gmxManageGPU.cmake index 9669db26bd..e2a7efc1e1 100644 --- a/cmake/gmxManageGPU.cmake +++ b/cmake/gmxManageGPU.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by +# Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -166,11 +166,17 @@ if (GMX_GPU) set(NVML_FIND_QUIETLY TRUE) endif() find_package(NVML) - if(NVML_FOUND) - include_directories(SYSTEM ${NVML_INCLUDE_DIR}) - set(HAVE_NVML 1) - list(APPEND GMX_EXTRA_LIBRARIES ${NVML_LIBRARY}) - endif(NVML_FOUND) + option(GMX_USE_NVML "Use NVML support for better CUDA performance" ${HAVE_NVML}) + mark_as_advanced(GMX_USE_NVML) + if(GMX_USE_NVML) + if(NVML_FOUND) + include_directories(SYSTEM ${NVML_INCLUDE_DIR}) + set(HAVE_NVML 1) + list(APPEND GMX_EXTRA_LIBRARIES ${NVML_LIBRARY}) + else() + message(FATAL_ERROR "NVML support was required, but was not detected. Please consult the install guide.") + endif() + endif() endif() # Annoyingly enough, FindCUDA leaves a few variables behind as non-advanced. diff --git a/docs/install-guide/index.rst b/docs/install-guide/index.rst index 9a4cf3f985..7b8849628a 100644 --- a/docs/install-guide/index.rst +++ b/docs/install-guide/index.rst @@ -566,7 +566,9 @@ If you have the CUDA_ Toolkit installed, you can use ``cmake`` with: (or whichever path has your installation). In some cases, you might need to specify manually which of your C++ compilers should be used, -e.g. with the advanced option ``CUDA_HOST_COMPILER``. To make it +e.g. with the advanced option ``CUDA_HOST_COMPILER``. + +To make it possible to get best performance from NVIDIA Tesla and Quadro GPUs, you should install the `GPU Deployment Kit `_ and configure @@ -582,6 +584,8 @@ permissions, clocks cannot be changed, and in that case informative log file messages will be produced. Background details can be found at this `NVIDIA blog post `_. +NVML support is only available if detected, and may be disabled by +turning off the ``GMX_USE_NVML`` CMake advanced option. By default, optimized code will be generated for CUDA architectures supported by the nvcc compiler (and the |Gromacs| build system). -- 2.11.4.GIT