diff --git a/main.c b/main.c index 4eb0eea8..a783eaca 100644 --- a/main.c +++ b/main.c @@ -1458,6 +1458,9 @@ int main (int argc, char *argv[]) #ifdef HAVE_OPENCL nDevs = clDevicesNum(); + if (nDevs < 0) + return 1; + #endif if (nDevs) opt_n_threads = 0; diff --git a/ocl.c b/ocl.c index 7e5294c8..71f57214 100644 --- a/ocl.c +++ b/ocl.c @@ -58,10 +58,11 @@ int clDevicesNum() { cl_uint numPlatforms; cl_platform_id platform = NULL; status = clGetPlatformIDs(0, NULL, &numPlatforms); + /* If this fails, assume no GPUs. */ if (status != CL_SUCCESS) { - applog(LOG_ERR, "Error: Getting Platforms. (clGetPlatformsIDs)"); - return -1; + applog(LOG_INFO, "clGetPlatformsIDs failed (no GPU?)"); + return 0; } if (numPlatforms > 0)