Check for GPU detection support before detecting
authorMark Abraham <mark.j.abraham@gmail.com>
Sun, 10 Dec 2017 07:35:52 +0000 (18:35 +1100)
committerErik Lindahl <erik.lindahl@gmail.com>
Mon, 11 Dec 2017 10:08:32 +0000 (11:08 +0100)
commit9ee128dc84f7e2c1e9af52f897718b39788fe9cf
treea9347fc450db050ff4ad3ccb0c4abf086884418f
parent29c059adf3362dbcb7071a4c531770fa9c21e519
Check for GPU detection support before detecting

When a CUDA-enabled binary was run on a node with no CUDA driver
available, a note was issued that the version of the CUDA driver is
insufficient, which was wrong.

Fixed this by separating detection of a valid CUDA driver (or OpenCL
platform) from enumerating the compatible devices. This permits a
GPU-enabled build configuration to gracefully degrade to the same
behaviour as a CPU-only build configuration.

Also suppressed more warnings about use of OpenCL API elements that
have been deprecated but which we intend to contiune to use
regardless.

Also fixed confusing name of rank_local, and replaced it with a
boolean that cleanly describes the required functionality.

Also fixed and simplified logic of printing the GPU report. The
implementation only prints details about the node of the master rank,
so there is no value in checking a variable that reflects the number
of GPUs detected across all nodes.

Fixes #2322

Change-Id: I831d3c0017dafc00f7bb82e3f71be5b122657d1e
src/gromacs/gpu_utils/gmxopencl.h
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/gpu_utils/gpu_utils.h
src/gromacs/gpu_utils/gpu_utils_ocl.cpp
src/gromacs/hardware/detecthardware.cpp
src/gromacs/hardware/printhardware.cpp