From a02ceae225d707beec9df35b62abbdf5566ffb40 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Sat, 8 Sep 2012 13:04:37 +0000 Subject: [PATCH] client: work around a nasty bug which crashes OSX (!) on some dual-gpu MacBooks with CUDA svn path=/trunk/boinc/; revision=26082 --- checkin_notes | 8 ++++++++ client/gpu_opencl.cpp | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index ab698e0d9b..302c19f26b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5903,3 +5903,11 @@ David 7 Sept 2012 sched/ sched_array.cpp + +Charlie 8 Sep 2012 + - client: work around a nasty bug which crashes OSX (!) on some + dual-gpu MacBooks with CUDA installed if we call cuInit() + unless we force use of the discrete (NVIDIA) GPU. + + client/ + gpu_opencl.cpp diff --git a/client/gpu_opencl.cpp b/client/gpu_opencl.cpp index 96db8092c4..dd5d10f930 100644 --- a/client/gpu_opencl.cpp +++ b/client/gpu_opencl.cpp @@ -233,7 +233,7 @@ void COPROCS::get_opencl( device_index ); } - continue; // Should never happen + return; // Should never happen } if (!strcmp(prop.name, nvidia_gpus[current_CUDA_index].prop.name)) { break; // We have a match @@ -323,7 +323,10 @@ void COPROCS::get_opencl( // This has already been fixed on latest Catalyst // drivers, but Mac does not use Catalyst drivers. - if (ati_opencls.size() > 0) { + // We also must call this if we have CUDA installed because + // a bug causes the OS to crash on some dual-GPU MacBooks + // unless we force use of the discrete (NVIDIA) GPU. + if ((ati_opencls.size() > 0) || nvidia.have_cuda) { opencl_get_ati_mem_size_from_opengl(); }