mirror of https://github.com/BOINC/boinc.git
parent
252b24bf8b
commit
02717af2f3
|
@ -395,7 +395,7 @@ void COPROC_CUDA::get(
|
|||
|
||||
// fake a NVIDIA GPU (for debugging)
|
||||
//
|
||||
void fake_cuda(COPROCS& coprocs, int count) {
|
||||
void fake_cuda(COPROCS& coprocs, double ram, int count) {
|
||||
COPROC_CUDA* cc = new COPROC_CUDA;
|
||||
strcpy(cc->type, "CUDA");
|
||||
cc->count = count;
|
||||
|
@ -405,7 +405,7 @@ void fake_cuda(COPROCS& coprocs, int count) {
|
|||
cc->display_driver_version = 18000;
|
||||
cc->cuda_version = 2020;
|
||||
strcpy(cc->prop.name, "Fake NVIDIA GPU");
|
||||
cc->prop.totalGlobalMem = 256*1024*1024;
|
||||
cc->prop.totalGlobalMem = ram;
|
||||
cc->prop.sharedMemPerBlock = 100;
|
||||
cc->prop.regsPerBlock = 8;
|
||||
cc->prop.warpSize = 10;
|
||||
|
@ -431,7 +431,12 @@ int COPROC_CUDA::available_ram(int devnum, double& ar) {
|
|||
unsigned int memfree, memtotal;
|
||||
unsigned int ctx;
|
||||
|
||||
if (!__cuDeviceGet) return 0; // avoid crash if faked GPU
|
||||
// avoid crash if faked GPU
|
||||
//
|
||||
if (!__cuDeviceGet) {
|
||||
ar = prop.totalGlobalMem;
|
||||
return 0;
|
||||
}
|
||||
int retval = (*__cuDeviceGet)(&device, devnum);
|
||||
if (retval) return retval;
|
||||
retval = (*__cuCtxCreate)(&ctx, 0, device);
|
||||
|
@ -750,7 +755,7 @@ void COPROC_ATI::get(COPROCS& coprocs,
|
|||
retval = (*__calShutdown)();
|
||||
}
|
||||
|
||||
void fake_ati(COPROCS& coprocs, int count) {
|
||||
void fake_ati(COPROCS& coprocs, double ram, int count) {
|
||||
COPROC_ATI* cc = new COPROC_ATI;
|
||||
strcpy(cc->type, "ATI");
|
||||
strcpy(cc->version, "1.4.3");
|
||||
|
@ -758,7 +763,7 @@ void fake_ati(COPROCS& coprocs, int count) {
|
|||
cc->count = count;
|
||||
memset(&cc->attribs, 0, sizeof(cc->attribs));
|
||||
memset(&cc->info, 0, sizeof(cc->info));
|
||||
cc->attribs.localRAM = 1024;
|
||||
cc->attribs.localRAM = (int)(ram/MEGA);
|
||||
cc->attribs.numberOfSIMD = 32;
|
||||
cc->attribs.wavefrontSize = 32;
|
||||
cc->attribs.engineClock = 50;
|
||||
|
@ -775,7 +780,11 @@ int COPROC_ATI::available_ram(int devnum, double& ar) {
|
|||
|
||||
st.struct_size = sizeof(CALdevicestatus);
|
||||
|
||||
if (!__calInit) return 0; // avoid crash if faked GPU
|
||||
// avoid crash if faked GPU
|
||||
if (!__calInit) {
|
||||
r = attribs.localRAM;
|
||||
return 0;
|
||||
}
|
||||
retval = (*__calInit)();
|
||||
if (retval) return retval;
|
||||
retval = (*__calDeviceOpen)(&dev, devnum);
|
||||
|
|
|
@ -1132,6 +1132,7 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) {
|
|||
"turnaround_avg=%.15e, "
|
||||
"turnaround_q=%.15e, "
|
||||
"turnaround_var=%.15e, "
|
||||
"error_rate=%.15e, "
|
||||
"host_scale_time=%.15e, "
|
||||
"scale_probation=%d",
|
||||
pfc.n,
|
||||
|
@ -1144,6 +1145,7 @@ int DB_HOST_APP_VERSION::update_validator(DB_HOST_APP_VERSION& orig) {
|
|||
turnaround.avg,
|
||||
turnaround.q,
|
||||
turnaround.var,
|
||||
error_rate,
|
||||
host_scale_time,
|
||||
scale_probation
|
||||
);
|
||||
|
|
|
@ -260,8 +260,8 @@ struct COPROC_CUDA : public COPROC {
|
|||
bool check_running_graphics_app();
|
||||
};
|
||||
|
||||
void fake_cuda(COPROCS&, int);
|
||||
void fake_ati(COPROCS&, int);
|
||||
void fake_cuda(COPROCS&, double, int);
|
||||
void fake_ati(COPROCS&, double, int);
|
||||
|
||||
enum CUdevice_attribute_enum {
|
||||
CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1,
|
||||
|
|
|
@ -545,6 +545,7 @@ int hav_lookup(DB_HOST_APP_VERSION& hav, int hostid, int avid) {
|
|||
hav.clear();
|
||||
hav.host_id = hostid;
|
||||
hav.app_version_id = avid;
|
||||
hav.error_rate = ERROR_RATE_INIT;
|
||||
retval = hav.insert();
|
||||
if (retval) return retval;
|
||||
}
|
||||
|
@ -967,7 +968,7 @@ int write_modified_app_versions(vector<DB_APP_VERSION>& app_versions) {
|
|||
unsigned int i, j;
|
||||
int retval = 0;
|
||||
|
||||
if (config.debug_credit) {
|
||||
if (config.debug_credit && app_versions.size()) {
|
||||
log_messages.printf(MSG_NORMAL,
|
||||
"[credit] start write_modified_app_versions()\n"
|
||||
);
|
||||
|
|
|
@ -1585,6 +1585,7 @@ int update_host_app_versions(vector<RESULT>& results, int hostid) {
|
|||
}
|
||||
if (!found) {
|
||||
DB_HOST_APP_VERSION hav;
|
||||
hav.clear();
|
||||
hav.host_id = hostid;
|
||||
hav.app_version_id = gavid;
|
||||
hav.host_scale_time = r.report_deadline;
|
||||
|
@ -1601,6 +1602,7 @@ int update_host_app_versions(vector<RESULT>& results, int hostid) {
|
|||
DB_HOST_APP_VERSION& hav = new_havs[i];
|
||||
|
||||
hav.scale_probation = true;
|
||||
hav.error_rate = ERROR_RATE_INIT;
|
||||
retval = hav.insert();
|
||||
if (retval) {
|
||||
log_messages.printf(MSG_CRITICAL,
|
||||
|
|
Loading…
Reference in New Issue