35 | | for (unsigned int i=0; i<sreq.coprocs.coprocs.size(); i++) { |
36 | | COPROC* cp = sreq.coprocs.coprocs[i]; |
37 | | if (!strcmp(cp->type, "CUDA")) { |
38 | | COPROC* cu = new COPROC (cp->type); |
39 | | cu->count = 1; |
40 | | hu.coprocs.coprocs.push_back(cu); |
41 | | double x = 1e9/sreq.host.p_fpops; |
42 | | if (x > 1) x = 1; |
43 | | hu.avg_ncpus = x; |
44 | | hu.max_ncpus = x; |
45 | | hu.flops = 5e11; |
46 | | return true; |
| 34 | COPROC_CUDA* cp = (COPROC_CUDA*)sreq.coprocs.lookup("CUDA"); |
| 35 | if (!cp) { |
| 36 | if (config.debug_version_select) { |
| 37 | log_messages.printf(MSG_NORMAL, |
| 38 | "[version] Host lacks CUDA coprocessor for plan class cuda\n" |
| 39 | ); |
| 43 | int v = (cp->prop.major)*100 + cp->prop.minor; |
| 44 | if (v < 100) { |
| 45 | if (config.debug_version_select) { |
| 46 | log_messages.printf(MSG_NORMAL, |
| 47 | "[version] CUDA version %d < 1.0\n", v |
| 48 | ); |
| 49 | } |
| 50 | return PLAN_REJECT_CUDA_VERSION; |
| 51 | } |
| 52 | |
| 53 | if (cp->drvVersion && cp->drvVersion < PLAN_CUDA_MIN_DRIVER_VERSION) { |
| 54 | if (config.debug_version_select) { |
| 55 | log_messages.printf(MSG_NORMAL, |
| 56 | "[version] NVIDIA driver version %d < PLAN_CUDA_MIN_DRIVER_VERSION\n", |
| 57 | cp->drvVersion |
| 58 | ); |
| 59 | } |
| 60 | return PLAN_REJECT_NVIDIA_DRIVER_VERSION; |
| 61 | } |
| 62 | |
| 63 | if (cp->prop.dtotalGlobalMem < PLAN_CUDA_MIN_RAM) { |
| 64 | if (config.debug_version_select) { |
| 65 | log_messages.printf(MSG_NORMAL, |
| 66 | "[version] CUDA mem %d < %d\n", |
| 67 | cp->prop.dtotalGlobalMem, PLAN_CUDA_MIN_RAM |
| 68 | ); |
| 69 | } |
| 70 | return PLAN_REJECT_CUDA_MEM; |
| 71 | } |
| 72 | hu.flops = cp->flops_estimate(); |
| 73 | |
| 74 | // assume we'll need 0.5% as many CPU FLOPS as GPU FLOPS |
| 75 | // to keep the GPU fed. |
| 76 | // |
| 77 | double x = (hu.flops*0.005)/sreq.host.p_fpops; |
| 78 | hu.avg_ncpus = x; |
| 79 | hu.max_ncpus = x; |
| 80 | |
| 81 | hu.ncudas = 1; |
| 82 | |
50 | | log_messages.printf(MSG_DEBUG, |
51 | | "Host lacks CUDA coprocessor for plan class %s\n", plan_class |
| 84 | log_messages.printf(MSG_NORMAL, |
| 85 | "[version] CUDA app estimated %.2f GFLOPS (clock %d count %d)\n", |
| 86 | hu.flops/1e9, cp->prop.clockRate, |
| 87 | cp->prop.multiProcessorCount |