- client: if the host has two CUDA GPUs,

they were being recorded as two COPROC structures of type CUDA.
    Unfortunately, the logic doesn't handle this correctly;
    it expects there to be a single structure with count==2.
    Change things to do this.

    Unfortunately this means that if the two GPUs are different,
    that difference will get lost.
    This is a design flaw, and would take some work to fix.

svn path=/trunk/boinc/; revision=15915
This commit is contained in:
David Anderson 2008-08-21 03:30:01 +00:00
parent 5b12a763f7
commit 604e3eb4a3
2 changed files with 33 additions and 9 deletions

View File

@ -6941,3 +6941,17 @@ Charlie 20 Aug 2008
lib/
filesys.C
David 20 Aug 2008
- client: if the host has two CUDA GPUs,
they were being recorded as two COPROC structures of type CUDA.
Unfortunately, the logic doesn't handle this correctly;
it expects there to be a single structure with count==2.
Change things to do this.
Unfortunately this means that if the two GPUs are different,
that difference will get lost.
This is a design flaw, and would take some work to fix.
lib/
coproc.C

View File

@ -150,19 +150,29 @@ const char* COPROC_CUDA::get(COPROCS& coprocs) {
return "Library doesn't have cudaGetDeviceProperties()";
}
#endif
bool found = false;
// NOTE: our design is flawed:
// there's no provision for having two coprocs of type CUDA.
// So on systems with two GPUs (possibly of different hardware type)
// we have to count them as two of the same
//
(*__cudaGetDeviceCount)(&count);
int real_count = 0;
COPROC_CUDA cc, cc2;
for (int i=0; i<count; i++) {
COPROC_CUDA* cc = new COPROC_CUDA;
(*__cudaGetDeviceProperties)(&cc->prop, i);
if (cc->prop.major >= 1) {
found = true;
cc->count = 1;
strcpy(cc->type, "CUDA");
coprocs.coprocs.push_back(cc);
(*__cudaGetDeviceProperties)(&cc.prop, i);
if (cc.prop.major >= 1) { // major == 0 means emulation
cc2 = cc;
real_count++;
}
}
if (!found) {
if (real_count) {
COPROC_CUDA* ccp = new COPROC_CUDA;
*ccp = cc2;
ccp->count = real_count;
strcpy(ccp->type, "CUDA");
coprocs.coprocs.push_back(ccp);
} else {
return "No CUDA devices found";
}
return "CUDA devices found";