}
}
- /* For now this is just to double-check if OpenMM selected the GPU we wanted,
- but when we'll let OpenMM select the GPU automatically it will query the devideId.
- */
- int tmp;
- if (!from_string<int>(tmp, platform.getPropertyValue(*context, "CudaDevice"), std::dec))
+ /* only for CUDA */
+ if (isStringEqNCase(opt->getOptionValue("platform"), "CUDA"))
{
- gmx_fatal(FARGS, "Internal error: couldn't determine the device selected by OpenMM");
- if (tmp != devId)
+ /* For now this is just to double-check if OpenMM selected the GPU we wanted,
+ but when we'll let OpenMM select the GPU automatically, it will query the devideId.
+ */
+ int tmp;
+ if (!from_string<int>(tmp, platform.getPropertyValue(*context, "CudaDevice"), std::dec))
{
- gmx_fatal(FARGS, "Internal error: OpenMM is using device #%d while initialized for device #%d",
- tmp, devId);
+ gmx_fatal(FARGS, "Internal error: couldn't determine the device selected by OpenMM");
+ if (tmp != devId)
+ {
+ gmx_fatal(FARGS, "Internal error: OpenMM is using device #%d"
+ "while initialized for device #%d", tmp, devId);
+ }
}
- }
-
- /* check GPU compatibility */
- char gpuname[STRLEN];
- devId = atoi(opt->getOptionValue("deviceid").c_str());
- if (!is_supported_cuda_gpu(-1, gpuname))
- {
- if (!gmx_strcasecmp(opt->getOptionValue("force-device").c_str(), "yes"))
+
+ /* check GPU compatibility */
+ char gpuname[STRLEN];
+ devId = atoi(opt->getOptionValue("deviceid").c_str());
+ if (!is_supported_cuda_gpu(-1, gpuname))
{
- sprintf(warn_buf, "Non-supported GPU selected (#%d, %s), forced continuing.\n"
- "Note, that the simulation can be slow or it migth even crash.",
- devId, gpuname);
- fprintf(fplog, "%s", warn_buf);
- gmx_warning(warn_buf);
+ if (!gmx_strcasecmp(opt->getOptionValue("force-device").c_str(), "yes"))
+ {
+ sprintf(warn_buf, "Non-supported GPU selected (#%d, %s), forced continuing."
+ "Note, that the simulation can be slow or it migth even crash.",
+ devId, gpuname);
+ fprintf(fplog, "%s\n", warn_buf);
+ gmx_warning(warn_buf);
+ }
+ else
+ {
+ gmx_fatal(FARGS, "The selected GPU (#%d, %s) is not supported by Gromacs! "
+ "Most probably you have a low-end GPU which would not perform well, "
+ "or new hardware that has not been tested yet with Gromacs-OpenMM. "
- "If you still want to try using the device, use the force=on option.",
++ "If you still want to try using the device, use the force-device=yes option.",
+ devId, gpuname);
+ }
}
else
{