client: On Macs, fix failure to recognize CUDA devices when BOINC is launched automatically at login before CUDA has initialized at system boot.

This commit is contained in:
Charlie Fenton 2015-08-14 04:03:38 -07:00
parent 944835bd21
commit 5c1fa20254
1 changed files with 12 additions and 1 deletions

View File

@ -337,7 +337,18 @@ void COPROC_NVIDIA::get(
return;
}
retval = (*__cuInit)(0);
#ifdef __APPLE__
// If system is just booting, CUDA driver may not be ready yet
for (int retryCount=0; retryCount<45; retryCount++) {
#endif
retval = (*__cuInit)(0);
#ifdef __APPLE__
if (!retval) break;
boinc_sleep(1.);
continue;
}
#endif
if (retval) {
sprintf(buf, "NVIDIA drivers present but no GPUs found");
warnings.push_back(buf);