diff --git a/checkin_notes b/checkin_notes
index c076af1026..93079a7f2a 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -9157,3 +9157,16 @@ David 12 Nov 2009
sched_array.cpp
sched_score.cpp
sched_send.cpp
+
+David 12 Nov 2009
+ - client: add new config options:
+ n
+ n
+ to ignore (not use) specific NVIDIA or ATI GPUs.
+ You can ignore more than one.
+
+ client/
+ client_state.cpp
+ log_flags.cpp,h
+ lib/
+ coproc.cpp,h
diff --git a/client/client_state.cpp b/client/client_state.cpp
index 52a70e10af..58a780bc11 100644
--- a/client/client_state.cpp
+++ b/client/client_state.cpp
@@ -261,7 +261,10 @@ int CLIENT_STATE::init() {
if (!config.no_gpus) {
vector descs;
vector warnings;
- coprocs.get(config.use_all_gpus, descs, warnings);
+ coprocs.get(
+ config.use_all_gpus, descs, warnings,
+ config.ignore_cuda_dev, config.ignore_ati_dev
+ );
for (i=0; i& devs, const char* name) {
+ for (unsigned int i=0; i exclusive_apps;
std::string force_auth;
bool http_1_0;
+ std::vector ignore_cuda_dev;
+ std::vector ignore_ati_dev;
int max_file_xfers;
int max_file_xfers_per_project;
int max_stderr_file_size;
diff --git a/lib/coproc.cpp b/lib/coproc.cpp
index 3c0e455268..25a596b184 100644
--- a/lib/coproc.cpp
+++ b/lib/coproc.cpp
@@ -137,40 +137,48 @@ void COPROCS::summary_string(char* buf, int len) {
strcpy(buf, bigbuf);
}
-
-#ifdef _WIN32
-
-void COPROCS::get(bool use_all, vector&descs, vector&warnings) {
- COPROC_CUDA::get(*this, use_all, descs, warnings);
- COPROC_ATI::get(*this, descs, warnings);
+static bool in_vector(int n, vector& v) {
+ for (unsigned int i=0; i&descs, vector&warnings) {
+void COPROCS::get(
+ bool use_all, vector&descs, vector&warnings,
+ vector& ignore_cuda_dev,
+ vector& ignore_ati_dev
+) {
+
+#ifdef _WIN32
+ COPROC_CUDA::get(*this, use_all, descs, warnings, ignore_cuda_dev);
+ COPROC_ATI::get(*this, descs, warnings, ignore_ati_dev);
+#else
void (*old_sig)(int) = signal(SIGSEGV, segv_handler);
if (setjmp(resume)) {
warnings.push_back("Caught SIGSEGV in NVIDIA GPU detection");
} else {
- COPROC_CUDA::get(*this, use_all, descs, warnings);
+ COPROC_CUDA::get(*this, use_all, descs, warnings, ignore_cuda_dev);
}
#ifndef __APPLE__ // ATI does not yet support CAL on Macs
if (setjmp(resume)) {
warnings.push_back("Caught SIGSEGV in ATI GPU detection");
} else {
- COPROC_ATI::get(*this, descs, warnings);
+ COPROC_ATI::get(*this, descs, warnings, ignore_ati_dev);
}
#endif
signal(SIGSEGV, old_sig);
+#endif
}
-#endif
// used only to parse scheduler request messages
//
@@ -285,7 +293,8 @@ void COPROC_CUDA::get(
COPROCS& coprocs,
bool use_all, // if false, use only those equivalent to most capable
vector& descs,
- vector& warnings
+ vector& warnings,
+ vector& ignore_devs
) {
int count, retval;
char buf[256];
@@ -474,12 +483,15 @@ void COPROC_CUDA::get(
return;
}
- // identify the most capable instance
+ // identify the most capable non-ignored instance
//
COPROC_CUDA best;
+ bool first = true;
for (i=0; i 0) {
best = gpus[i];
}
@@ -492,7 +504,9 @@ void COPROC_CUDA::get(
for (i=0; i& descs, vector& warnings
+ vector& descs, vector& warnings, vector& ignore_devs
) {
CALuint numDevices, cal_major, cal_minor, cal_imp;
CALdevice device;
@@ -947,25 +963,33 @@ void COPROC_ATI::get(COPROCS& coprocs,
// same as for NVIDIA
COPROC_ATI best;
+ bool first = true;
for (unsigned int i=0; i best.peak_flops()) {
- best = gpus[i];
- }
gpus[i].description(buf);
- sprintf(buf2, "ATI GPU %d: %s", gpus[i].device_num, buf);
+ if (in_vector(gpus[i].device_num, ignore_devs)) {
+ sprintf(buf2, "ATI GPU %d (ignored by config): %s", gpus[i].device_num, buf);
+ } else {
+ if (first) {
+ best = gpus[i];
+ first = false;
+ } else if (gpus[i].peak_flops() > best.peak_flops()) {
+ best = gpus[i];
+ }
+ sprintf(buf2, "ATI GPU %d: %s", gpus[i].device_num, buf);
+ }
descs.push_back(buf2);
}
+ best.count = 0;
for (unsigned int i=0; itype, "ATI");
- ccp->count = numDevices;
coprocs.coprocs.push_back(ccp);
}
diff --git a/lib/coproc.h b/lib/coproc.h
index fadceb938c..8133480111 100644
--- a/lib/coproc.h
+++ b/lib/coproc.h
@@ -176,7 +176,9 @@ struct COPROCS {
#endif
void get(
bool use_all, std::vector &descs,
- std::vector &warnings
+ std::vector &warnings,
+ std::vector& ignore_cuda_dev,
+ std::vector& ignore_ati_dev
);
int parse(FILE*);
void summary_string(char*, int);
@@ -249,7 +251,8 @@ struct COPROC_CUDA : public COPROC {
virtual ~COPROC_CUDA(){}
static void get(
COPROCS&, bool use_all,
- std::vector&, std::vector&
+ std::vector&, std::vector&,
+ std::vector& ignore_devs
);
void description(char*);
void clear();
@@ -311,7 +314,8 @@ struct COPROC_ATI : public COPROC {
COPROC_ATI(): COPROC("ATI"){}
virtual ~COPROC_ATI(){}
static void get(COPROCS&,
- std::vector&, std::vector&
+ std::vector&, std::vector&,
+ std::vector& ignore_devs
);
void description(char*);
void clear();