- client: fix bug in mechanism that inhibits work fetch

for a GPU if it lacks available memory

svn path=/trunk/boinc/; revision=21197
This commit is contained in:
David Anderson 2010-04-16 21:56:58 +00:00
parent b71d3e6cf4
commit be0d0c7d71
4 changed files with 27 additions and 10 deletions

View File

@ -2874,3 +2874,12 @@ David 16 Apr 2010
credit.cpp
html/inc/
db_ops.inc
David 16 Apr 2010
- client: fix bug in mechanism that inhibits work fetch
for a GPU if it lacks available memory
client/
client_state.cpp
coproc_detect.cpp
cpu_sched.cpp

View File

@ -266,11 +266,11 @@ int CLIENT_STATE::init() {
msg_printf(NULL, MSG_INFO, "No usable GPUs found");
}
#if 0
fake_cuda(host_info.coprocs, 2);
fake_cuda(host_info.coprocs, 256*MEGA, 1);
msg_printf(NULL, MSG_INFO, "Faking an NVIDIA GPU");
#endif
#if 0
fake_ati(host_info.coprocs, 2);
fake_ati(host_info.coprocs, 512*MEGA, 2);
msg_printf(NULL, MSG_INFO, "Faking an ATI GPU");
#endif
coproc_cuda = (COPROC_CUDA*)host_info.coprocs.lookup("CUDA");

View File

@ -434,7 +434,7 @@ int COPROC_CUDA::available_ram(int devnum, double& ar) {
// avoid crash if faked GPU
//
if (!__cuDeviceGet) {
ar = prop.totalGlobalMem;
ar = prop.totalGlobalMem*.75; // 75% of fake RAM is free
return 0;
}
int retval = (*__cuDeviceGet)(&device, devnum);
@ -782,7 +782,7 @@ int COPROC_ATI::available_ram(int devnum, double& ar) {
// avoid crash if faked GPU
if (!__calInit) {
ar = attribs.localRAM;
ar = attribs.localRAM*.75; // 75% of fake RAM is free
return 0;
}
retval = (*__calInit)();

View File

@ -1316,7 +1316,13 @@ bool CLIENT_STATE::enforce_schedule() {
);
}
// schedule all non CPU intensive tasks
for (i=0; i<projects.size(); i++) {
projects[i]->cuda_low_mem = false;
projects[i]->ati_low_mem = false;
}
// schedule non CPU intensive tasks,
// and look for backed-off GPU jobs
//
for (i=0; i<results.size(); i++) {
RESULT* rp = results[i];
@ -1326,6 +1332,13 @@ bool CLIENT_STATE::enforce_schedule() {
ram_left -= atp->procinfo.working_set_size_smoothed;
swap_left -= atp->procinfo.swap_size;
}
if (rp->schedule_backoff > gstate.now) {
if (rp->uses_cuda()) {
rp->project->cuda_low_mem = true;
} else if (rp->uses_ati()) {
rp->project->ati_low_mem = true;
}
}
}
// assign coprocessors to coproc jobs,
@ -1333,11 +1346,6 @@ bool CLIENT_STATE::enforce_schedule() {
//
assign_coprocs(runnable_jobs);
for (i=0; i<projects.size(); i++) {
projects[i]->cuda_low_mem = false;
projects[i]->ati_low_mem = false;
}
// prune jobs that don't fit in RAM or that exceed CPU usage limits.
// Mark the rest as SCHEDULED
//