/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
bool gpusCanBeDetected = false;
if (isMasterRankOfNode || isOpenclPpRank)
{
- gpusCanBeDetected = canDetectGpus();
- // No need to tell the user anything at this point, they get a
- // hardware report later.
- }
-
- if (gpusCanBeDetected)
- {
- char detection_error[STRLEN] = "", sbuf[STRLEN];
-
- if (detect_gpus(&hwinfo_g->gpu_info, detection_error) != 0)
+ std::string errorMessage;
+ gpusCanBeDetected = canDetectGpus(&errorMessage);
+ if (!gpusCanBeDetected)
{
- if (detection_error[0] != '\0')
- {
- sprintf(sbuf, ":\n %s\n", detection_error);
- }
- else
- {
- sprintf(sbuf, ".");
- }
GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
- "NOTE: Error occurred during GPU detection%s"
+ "NOTE: GPUs cannot be detected:\n"
+ " %s\n"
" Can not use GPU acceleration, will fall back to CPU kernels.",
- sbuf);
+ errorMessage.c_str());
}
}
+ if (gpusCanBeDetected)
+ {
+ findGpus(&hwinfo_g->gpu_info);
+ // No need to tell the user anything at this point, they get a
+ // hardware report later.
+ }
+
#if GMX_LIB_MPI
if (!isOpenclPpRank)
{