// This file is part of BOINC. // http://boinc.berkeley.edu // Copyright (C) 2009 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation, // either version 3 of the License, or (at your option) any later version. // // BOINC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // See the GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . // client-specific GPU code. Mostly GPU detection #include "cpp.h" #ifdef _WIN32 #include "boinc_win.h" #ifndef SIM #include #endif #else #ifdef __APPLE__ // Suppress obsolete warning when building for OS 10.3.9 #define DLOPEN_NO_WARN #include #endif #include "config.h" #include #include #include #endif #include "coproc.h" #include "str_util.h" #include "util.h" #include "client_state.h" #include "client_msgs.h" using std::string; using std::vector; bool in_vector(int n, vector& v) { for (unsigned int i=0; i ati_gpus; vector nvidia_gpus; vector nvidia_opencls; vector ati_opencls; void COPROCS::get( bool use_all, vector&descs, vector&warnings, vector& ignore_nvidia_dev, vector& ignore_ati_dev ) { unsigned int i; char buf[256], buf2[256]; #ifdef _WIN32 try { nvidia.get(use_all, warnings, ignore_nvidia_dev); } catch (...) { warnings.push_back("Caught SIGSEGV in NVIDIA GPU detection"); } try { ati.get(use_all, warnings, ignore_ati_dev); } catch (...) { warnings.push_back("Caught SIGSEGV in ATI GPU detection"); } try { get_opencl(use_all, warnings, ignore_ati_dev, ignore_nvidia_dev); } catch (...) { warnings.push_back("Caught SIGSEGV in OpenCL detection"); } #else void (*old_sig)(int) = signal(SIGSEGV, segv_handler); if (setjmp(resume)) { warnings.push_back("Caught SIGSEGV in NVIDIA GPU detection"); } else { nvidia.get(use_all, warnings, ignore_nvidia_dev); } #ifndef __APPLE__ // ATI does not yet support CAL on Macs if (setjmp(resume)) { warnings.push_back("Caught SIGSEGV in ATI GPU detection"); } else { ati.get(use_all, warnings, ignore_ati_dev); } #endif if (setjmp(resume)) { warnings.push_back("Caught SIGSEGV in OpenCL detection"); } else { get_opencl(use_all, warnings, ignore_ati_dev, ignore_nvidia_dev); } signal(SIGSEGV, old_sig); #endif for (i=0; i