From 9aae2256d33b1d70b519d5f5077e7f935ee3ef44 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 24 Apr 2013 23:53:44 +1000 Subject: [PATCH] Bypass attempting to read and save binary files on OSX to avoid crashes on >1 GPU. --- ocl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ocl.c b/ocl.c index 3867440a..cc9b356f 100644 --- a/ocl.c +++ b/ocl.c @@ -514,6 +514,11 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) if (!source) return NULL; + /* OSX OpenCL breaks reading off binaries with >1 GPU so always build + * from source. */ +#ifdef __APPLE__ + goto build; +#endif binary_sizes = calloc(sizeof(size_t) * MAX_GPUDEVICES * 4, 1); if (unlikely(!binary_sizes)) { applog(LOG_ERR, "Unable to calloc binary_sizes"); @@ -662,6 +667,9 @@ build: } prog_built = true; +#ifdef __APPLE__ + goto built; +#endif status = clGetProgramInfo(clState->program, CL_PROGRAM_NUM_DEVICES, sizeof(cl_uint), &cpnd, NULL); if (unlikely(status != CL_SUCCESS)) {