Avoid mdrun terminate due to GPU sanity check errors
authorSzilárd Páll <pall.szilard@gmail.com>
Fri, 25 Oct 2019 23:24:23 +0000 (01:24 +0200)
committerSzilárd Páll <pall.szilard@gmail.com>
Wed, 26 Feb 2020 15:18:29 +0000 (16:18 +0100)
commit0a9b0ba74db6c70afc066eba21c767225b5feab3
treefd65e59a332a81345a2b7b519c0dd6ec8125d5b4
parentcc055a76cac976ba56ed9fb8607aeb885a533d28
Avoid mdrun terminate due to GPU sanity check errors

When a GPU is a exclusive or prohibited mode, early detection calls can
fail and as a result an mdrun run abort with an error, even if all GPU
offload is explicitly disabled by the user.
This change adds a status code to handle the case of devices being
unavailable.

Additionally, other errors may be encountered during the dummy kernel
sanity check (e.g. out of memory), but since the change that switches
to using launchGpuKernel() wrapper did not handle the exception in the
sanity checking, this can also abort a run even if the GPU in question
is not selected to be used.
This change adds code to catch the exception this and report the error
and avoid abort the run.

Fixes #3178 #3399

Change-Id: I0cdedbc02769084c172e4a42fe5c1af192007cec
docs/release-notes/2019/2019.6.rst
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/hardware/gpu_hw_info.cpp
src/gromacs/hardware/gpu_hw_info.h