client: Fix OpenCL NVIDIA GPU detection when CUDA is not present

svn path=/trunk/boinc/; revision=25289
This commit is contained in:
Charlie Fenton 2012-02-18 11:41:08 +00:00
parent db928a240b
commit 71e75ee57e
2 changed files with 28 additions and 18 deletions

View File

@ -1859,3 +1859,9 @@ Charlie 17 Feb 2012
lib/
mac/
mac_backtrace.cpp
Charlie 18 Feb 2012
- client: Fix OpenCL NVIDIA GPU detection when CUDA is not present.
client/
coproc_detect.cpp

View File

@ -368,6 +368,7 @@ strcpy(prop.opencl_driver_version, "CLH 1.0");
prop.get_device_version_int();
if (strstr(prop.vendor, GPU_TYPE_NVIDIA)) {
if (nvidia.have_cuda) {
// Mac OpenCL does not recognize all NVIDIA GPUs returned by
// CUDA but we assume that OpenCL and CUDA return devices in
// the same order and with identical model name strings
@ -388,6 +389,9 @@ strcpy(prop.opencl_driver_version, "CLH 1.0");
++current_CUDA_index;
}
prop.device_num = current_CUDA_index;
} else {
prop.device_num = device_index;
}
prop.opencl_device_index = device_index;
if (!nvidia.have_cuda) {
@ -401,9 +405,9 @@ strcpy(prop.opencl_driver_version, "CLH 1.0");
prop.opencl_available_ram = nvidia_gpus[prop.device_num].available_ram;
} else {
prop.opencl_available_ram = prop.global_mem_size;
++current_CUDA_index;
}
nvidia_opencls.push_back(prop);
++current_CUDA_index;
}
if ((strstr(prop.vendor, GPU_TYPE_ATI)) ||
(strstr(prop.vendor, "AMD")) ||