* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team.
- * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020,2021, 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.
*
* In reality it is 16 with CUDA <=v5.0, but let's stay on the safe side.
*/
-static int c_cudaMaxDeviceCount = 32;
+static const int c_cudaMaxDeviceCount = 32;
/** Dummy kernel used for sanity checking. */
-static __global__ void dummy_kernel(void) {}
+static __global__ void dummy_kernel() {}
static cudaError_t checkCompiledTargetCompatibility(int deviceId, const cudaDeviceProp& deviceProp)
{
"\nWARNING: The %s binary does not include support for the CUDA architecture of "
"the GPU ID #%d (compute capability %d.%d) detected during detection. "
"By default, GROMACS supports all architectures of compute "
- "capability >= 3.0, so your GPU "
+ "capability >= 3.5, so your GPU "
"might be rare, or some architectures were disabled in the build. \n"
"Consult the install guide for how to use the GMX_CUDA_TARGET_SM and "
"GMX_CUDA_TARGET_COMPUTE CMake variables to add this architecture. \n",
- gmx::getProgramContext().displayName(), deviceId, deviceProp.major, deviceProp.minor);
+ gmx::getProgramContext().displayName(),
+ deviceId,
+ deviceProp.major,
+ deviceProp.minor);
}
return stat;
cu_err = cudaSetDevice(deviceInfo.id);
if (cu_err != cudaSuccess)
{
- fprintf(stderr, "Error while switching to device #%d. %s\n", deviceInfo.id,
+ fprintf(stderr,
+ "Error while switching to device #%d. %s\n",
+ deviceInfo.id,
gmx::getDeviceErrorString(cu_err).c_str());
return DeviceStatus::NonFunctional;
}
// launchGpuKernel error is not fatal and should continue with marking the device bad
fprintf(stderr,
"Error occurred while running dummy kernel sanity check on device #%d:\n %s\n",
- deviceInfo.id, formatExceptionMessageToString(ex).c_str());
+ deviceInfo.id,
+ formatExceptionMessageToString(ex).c_str());
return DeviceStatus::NonFunctional;
}
if (stat != cudaSuccess)
{
auto message = gmx::formatString("Failed to initialize GPU #%d", deviceId);
- CU_RET_ERR(stat, message.c_str());
+ CU_RET_ERR(stat, message);
}
if (debug)
if (!gpuExists)
{
- return gmx::formatString("#%d: %s, stat: %s", deviceInfo.id, "N/A",
- c_deviceStateString[deviceInfo.status]);
+ return gmx::formatString(
+ "#%d: %s, stat: %s", deviceInfo.id, "N/A", c_deviceStateString[deviceInfo.status]);
}
else
{
return gmx::formatString("#%d: NVIDIA %s, compute cap.: %d.%d, ECC: %3s, stat: %s",
- deviceInfo.id, deviceInfo.prop.name, deviceInfo.prop.major,
- deviceInfo.prop.minor, deviceInfo.prop.ECCEnabled ? "yes" : " no",
+ deviceInfo.id,
+ deviceInfo.prop.name,
+ deviceInfo.prop.major,
+ deviceInfo.prop.minor,
+ deviceInfo.prop.ECCEnabled ? "yes" : " no",
c_deviceStateString[deviceInfo.status]);
}
}