From fae0903c0ffdb40ea9797a24d421e5e3a2f35929 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 22 Dec 2008 22:12:57 +0000 Subject: [PATCH] - scheduler: store CUDA total memory as a double, since it can be 4GB or larger svn path=/trunk/boinc/; revision=16737 --- checkin_notes | 13 ++++++++++++- client/time_stats.cpp | 4 ++-- lib/coproc.cpp | 6 ++++-- lib/coproc.h | 3 +++ sched/sched_plan.cpp | 4 ++-- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/checkin_notes b/checkin_notes index 3160f5790e..32fdf0b085 100644 --- a/checkin_notes +++ b/checkin_notes @@ -10321,9 +10321,20 @@ David 21 Dec 2008 sched_send.cpp handle_request.cpp -David 21 Dec 2008 +David 22 Dec 2008 - scheduler: change default CUDA RAM requirement from 256MB to 254MB; apparently some NVIDIA cards report 255MB sched/ sched_plan.cpp + +David 22 Dec 2008 + - scheduler: store CUDA total memory as a double, + since it can be 4GB or larger + + client/ + time_stats.cpp + lib/ + coproc.cpp,h + sched/ + sched_plan.cpp diff --git a/client/time_stats.cpp b/client/time_stats.cpp index 4a523273fb..23a9a1722d 100644 --- a/client/time_stats.cpp +++ b/client/time_stats.cpp @@ -274,7 +274,7 @@ int TIME_STATS::parse(MIOFILE& in) { last_update = x; } continue; - } else if (parse_double(buf, "", on_frac)) { + } else if (parse_double(buf, "", x)) { if (x < 0 || x > 1) { msg_printf(0, MSG_INTERNAL_ERROR, "bad value %f of time stats on_frac; ignoring", x @@ -292,7 +292,7 @@ int TIME_STATS::parse(MIOFILE& in) { connected_frac = x; } continue; - } else if (parse_double(buf, "", active_frac)) { + } else if (parse_double(buf, "", x)) { if (x < 0 || x > 1) { msg_printf(0, MSG_INTERNAL_ERROR, "bad value %f of time stats active_frac; ignoring", x diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 847453afef..05acda2172 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -313,10 +313,12 @@ int COPROC_CUDA::parse(FILE* fin) { clear(); while (fgets(buf, sizeof(buf), fin)) { - if (strstr(buf, "")) return 0; + if (strstr(buf, "")) { + return 0; + } if (parse_int(buf, "", count)) continue; if (parse_str(buf, "", prop.name, sizeof(prop.name))) continue; - if (parse_int(buf, "", (int&)prop.totalGlobalMem)) continue; + if (parse_double(buf, "", prop.dtotalGlobalMem)) continue; if (parse_int(buf, "", (int&)prop.sharedMemPerBlock)) continue; if (parse_int(buf, "", prop.regsPerBlock)) continue; if (parse_int(buf, "", prop.warpSize)) continue; diff --git a/lib/coproc.h b/lib/coproc.h index 35566ccffe..f6ce88cdbb 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -103,6 +103,8 @@ struct COPROCS { struct cudaDeviceProp { char name[256]; size_t totalGlobalMem; + // not used on the server; dtotalGlobalMem is used instead + // (since some boards have >= 4GB) size_t sharedMemPerBlock; int regsPerBlock; int warpSize; @@ -118,6 +120,7 @@ struct cudaDeviceProp { int deviceOverlap; int multiProcessorCount; int __cudaReserved[40]; + double dtotalGlobalMem; }; struct COPROC_CUDA : public COPROC { diff --git a/sched/sched_plan.cpp b/sched/sched_plan.cpp index 0bdc82af66..2a50c02297 100644 --- a/sched/sched_plan.cpp +++ b/sched/sched_plan.cpp @@ -85,9 +85,9 @@ bool app_plan(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu) { return false; } - if (cp2->prop.totalGlobalMem < 254*1024*1024) { + if (cp2->prop.dtotalGlobalMem < 254*1024*1024) { log_messages.printf(MSG_DEBUG, - "CUDA mem %d < 254MB\n", cp2->prop.totalGlobalMem + "CUDA mem %d < 254MB\n", cp2->prop.dtotalGlobalMem ); return false; }