mirror of https://github.com/BOINC/boinc.git
client: don't pass --device to GPU apps w/ API version >= 7.5
This addresses a problem w/ Bitcoin Utopia, whose coprocessor app (run via the wrapper) doesn't expect a --device arg, and fails if it gets one. The --device mechanism has been superceded by APP_INIT_DATA.gpu_device_num. GPU apps built with the current API and later should not expect a --device arg.
This commit is contained in:
parent
6ba233e230
commit
befb90f0d4
|
@ -229,7 +229,7 @@ void ACTIVE_TASK::cleanup_task() {
|
||||||
|
|
||||||
if (app_client_shm.shm) {
|
if (app_client_shm.shm) {
|
||||||
#ifndef __EMX__
|
#ifndef __EMX__
|
||||||
if (app_version->api_major_version() >= 6) {
|
if (app_version->api_version_at_least(6, 0)) {
|
||||||
retval = detach_shmem_mmap(app_client_shm.shm, sizeof(SHARED_MEM));
|
retval = detach_shmem_mmap(app_client_shm.shm, sizeof(SHARED_MEM));
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -163,7 +163,7 @@ int ACTIVE_TASK::get_shmem_seg_name() {
|
||||||
char init_data_path[MAXPATHLEN];
|
char init_data_path[MAXPATHLEN];
|
||||||
#ifndef __EMX__
|
#ifndef __EMX__
|
||||||
// shmem_seg_name is not used with mmap() shared memory
|
// shmem_seg_name is not used with mmap() shared memory
|
||||||
if (app_version->api_major_version() >= 6) {
|
if (app_version->api_version_at_least(6, 0)) {
|
||||||
shmem_seg_name = -1;
|
shmem_seg_name = -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -512,7 +512,7 @@ int ACTIVE_TASK::start(bool test) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
FILE_REF fref;
|
FILE_REF fref;
|
||||||
FILE_INFO* fip;
|
FILE_INFO* fip;
|
||||||
int retval, rt;
|
int retval;
|
||||||
APP_INIT_DATA aid;
|
APP_INIT_DATA aid;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
@ -693,9 +693,11 @@ int ACTIVE_TASK::start(bool test) {
|
||||||
sprintf(cmdline, "%s %s %s",
|
sprintf(cmdline, "%s %s %s",
|
||||||
exec_path, wup->command_line.c_str(), app_version->cmdline
|
exec_path, wup->command_line.c_str(), app_version->cmdline
|
||||||
);
|
);
|
||||||
rt = app_version->gpu_usage.rsc_type;
|
if (!app_version->api_version_at_least(7, 5)) {
|
||||||
if (rt) {
|
rt = app_version->gpu_usage.rsc_type;
|
||||||
coproc_cmdline(rt, result, app_version->gpu_usage.usage, cmdline);
|
if (rt) {
|
||||||
|
coproc_cmdline(rt, result, app_version->gpu_usage.usage, cmdline);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
relative_to_absolute(slot_dir, slotdirpath);
|
relative_to_absolute(slot_dir, slotdirpath);
|
||||||
|
@ -884,9 +886,11 @@ int ACTIVE_TASK::start(bool test) {
|
||||||
wup->command_line.c_str(), app_version->cmdline
|
wup->command_line.c_str(), app_version->cmdline
|
||||||
);
|
);
|
||||||
|
|
||||||
rt = app_version->gpu_usage.rsc_type;
|
if (!app_version->api_version_at_least(7, 5)) {
|
||||||
if (rt) {
|
int rt = app_version->gpu_usage.rsc_type;
|
||||||
coproc_cmdline(rt, result, app_version->gpu_usage.usage, cmdline);
|
if (rt) {
|
||||||
|
coproc_cmdline(rt, result, app_version->gpu_usage.usage, cmdline);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up client/app shared memory seg if needed
|
// Set up client/app shared memory seg if needed
|
||||||
|
@ -895,7 +899,7 @@ int ACTIVE_TASK::start(bool test) {
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
if (true) {
|
if (true) {
|
||||||
#else
|
#else
|
||||||
if (app_version->api_major_version() >= 6) {
|
if (app_version->api_version_at_least(6, 0)) {
|
||||||
#endif
|
#endif
|
||||||
// Use mmap() shared memory
|
// Use mmap() shared memory
|
||||||
sprintf(buf, "%s/%s", slot_dir, MMAPPED_FILE_NAME);
|
sprintf(buf, "%s/%s", slot_dir, MMAPPED_FILE_NAME);
|
||||||
|
|
|
@ -983,11 +983,13 @@ void APP_VERSION::clear_errors() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int APP_VERSION::api_major_version() {
|
bool APP_VERSION::api_version_at_least(int major, int minor) {
|
||||||
int v, n;
|
int maj, min, n;
|
||||||
n = sscanf(api_version, "%d", &v);
|
n = sscanf(api_version, "%d.%d", &maj, &min);
|
||||||
if (n != 1) return 0;
|
if (n != 2) return false;
|
||||||
return v;
|
if (maj < major) return false;
|
||||||
|
if (maj > major) return true;
|
||||||
|
return min >= minor;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FILE_REF::parse(XML_PARSER& xp) {
|
int FILE_REF::parse(XML_PARSER& xp) {
|
||||||
|
|
|
@ -282,7 +282,7 @@ struct APP_VERSION {
|
||||||
char api_version[16];
|
char api_version[16];
|
||||||
double avg_ncpus;
|
double avg_ncpus;
|
||||||
double max_ncpus;
|
double max_ncpus;
|
||||||
GPU_USAGE gpu_usage; // can only use 1 GPUtype
|
GPU_USAGE gpu_usage; // can only use 1 GPU type
|
||||||
double gpu_ram;
|
double gpu_ram;
|
||||||
double flops;
|
double flops;
|
||||||
char cmdline[256];
|
char cmdline[256];
|
||||||
|
@ -326,7 +326,7 @@ struct APP_VERSION {
|
||||||
bool had_download_failure(int& failnum);
|
bool had_download_failure(int& failnum);
|
||||||
void get_file_errors(std::string&);
|
void get_file_errors(std::string&);
|
||||||
void clear_errors();
|
void clear_errors();
|
||||||
int api_major_version();
|
bool api_version_at_least(int major, int minor);
|
||||||
inline bool uses_coproc(int rt) {
|
inline bool uses_coproc(int rt) {
|
||||||
return (gpu_usage.rsc_type == rt);
|
return (gpu_usage.rsc_type == rt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue