|
|
@ -100,7 +100,7 @@ static const bool opt_time = true; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENCL |
|
|
|
#ifdef HAVE_OPENCL |
|
|
|
int opt_dynamic_interval = 7; |
|
|
|
int opt_dynamic_interval = 7; |
|
|
|
static bool opt_restart = true; |
|
|
|
bool opt_restart = true; |
|
|
|
static bool opt_nogpu; |
|
|
|
static bool opt_nogpu; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -1223,10 +1223,12 @@ static void curses_print_devstatus(int thr_id) |
|
|
|
wprintw(statuswin, "DEAD "); |
|
|
|
wprintw(statuswin, "DEAD "); |
|
|
|
else if (cgpu->status == LIFE_SICK) |
|
|
|
else if (cgpu->status == LIFE_SICK) |
|
|
|
wprintw(statuswin, "SICK "); |
|
|
|
wprintw(statuswin, "SICK "); |
|
|
|
else if (!cgpu->enabled) |
|
|
|
else if (cgpu->deven == DEV_DISABLED) |
|
|
|
wprintw(statuswin, "OFF "); |
|
|
|
wprintw(statuswin, "OFF "); |
|
|
|
else |
|
|
|
else if (cgpu->deven == DEV_RECOVER) |
|
|
|
wprintw(statuswin, "%5.1f", cgpu->rolling); |
|
|
|
wprintw(statuswin, "REST "); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
wprintw(statuswin, "%5.1f", cgpu->rolling); |
|
|
|
adj_width(cgpu->accepted, &awidth); |
|
|
|
adj_width(cgpu->accepted, &awidth); |
|
|
|
adj_width(cgpu->rejected, &rwidth); |
|
|
|
adj_width(cgpu->rejected, &rwidth); |
|
|
|
adj_width(cgpu->hw_errors, &hwwidth); |
|
|
|
adj_width(cgpu->hw_errors, &hwwidth); |
|
|
@ -2380,11 +2382,11 @@ void write_config(FILE *fcfg) |
|
|
|
if (opt_socks_proxy && *opt_socks_proxy) |
|
|
|
if (opt_socks_proxy && *opt_socks_proxy) |
|
|
|
fprintf(fcfg, ",\n\"socks-proxy\" : \"%s\"", opt_socks_proxy); |
|
|
|
fprintf(fcfg, ",\n\"socks-proxy\" : \"%s\"", opt_socks_proxy); |
|
|
|
for(i = 0; i < nDevs; i++) |
|
|
|
for(i = 0; i < nDevs; i++) |
|
|
|
if (!gpus[i].enabled) |
|
|
|
if (gpus[i].deven == DEV_DISABLED) |
|
|
|
break; |
|
|
|
break; |
|
|
|
if (i < nDevs) |
|
|
|
if (i < nDevs) |
|
|
|
for (i = 0; i < nDevs; i++) |
|
|
|
for (i = 0; i < nDevs; i++) |
|
|
|
if (gpus[i].enabled) |
|
|
|
if (gpus[i].deven != DEV_DISABLED) |
|
|
|
fprintf(fcfg, ",\n\"device\" : \"%d\"", i); |
|
|
|
fprintf(fcfg, ",\n\"device\" : \"%d\"", i); |
|
|
|
if (opt_api_allow != NULL) |
|
|
|
if (opt_api_allow != NULL) |
|
|
|
fprintf(fcfg, ",\n\"api-allow\" : \"%s\"", opt_api_allow); |
|
|
|
fprintf(fcfg, ",\n\"api-allow\" : \"%s\"", opt_api_allow); |
|
|
@ -3401,7 +3403,7 @@ void *miner_thread(void *userdata) |
|
|
|
tv_lastupdate = tv_end; |
|
|
|
tv_lastupdate = tv_end; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (unlikely(mythr->pause || !cgpu->enabled)) { |
|
|
|
if (unlikely(mythr->pause || cgpu->deven == DEV_DISABLED)) { |
|
|
|
applog(LOG_WARNING, "Thread %d being disabled", thr_id); |
|
|
|
applog(LOG_WARNING, "Thread %d being disabled", thr_id); |
|
|
|
mythr->rolling = mythr->cgpu->rolling = 0; |
|
|
|
mythr->rolling = mythr->cgpu->rolling = 0; |
|
|
|
applog(LOG_DEBUG, "Popping wakeup ping in miner thread"); |
|
|
|
applog(LOG_DEBUG, "Popping wakeup ping in miner thread"); |
|
|
@ -3728,7 +3730,7 @@ static void *watchdog_thread(void __maybe_unused *userdata) |
|
|
|
thr = &thr_info[i]; |
|
|
|
thr = &thr_info[i]; |
|
|
|
|
|
|
|
|
|
|
|
/* Don't touch disabled devices */ |
|
|
|
/* Don't touch disabled devices */ |
|
|
|
if (!thr->cgpu->enabled) |
|
|
|
if (thr->cgpu->deven == DEV_DISABLED) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
thr->pause = false; |
|
|
|
thr->pause = false; |
|
|
|
tq_push(thr->q, &ping); |
|
|
|
tq_push(thr->q, &ping); |
|
|
@ -3739,7 +3741,7 @@ static void *watchdog_thread(void __maybe_unused *userdata) |
|
|
|
for (i = 0; i < total_devices; ++i) { |
|
|
|
for (i = 0; i < total_devices; ++i) { |
|
|
|
struct cgpu_info *cgpu = devices[i]; |
|
|
|
struct cgpu_info *cgpu = devices[i]; |
|
|
|
struct thr_info *thr = cgpu->thread; |
|
|
|
struct thr_info *thr = cgpu->thread; |
|
|
|
bool *enable; |
|
|
|
enum dev_enable *denable; |
|
|
|
int gpu; |
|
|
|
int gpu; |
|
|
|
|
|
|
|
|
|
|
|
if (cgpu->api != &opencl_api) |
|
|
|
if (cgpu->api != &opencl_api) |
|
|
@ -3748,10 +3750,10 @@ static void *watchdog_thread(void __maybe_unused *userdata) |
|
|
|
if (i >= nDevs) |
|
|
|
if (i >= nDevs) |
|
|
|
break; |
|
|
|
break; |
|
|
|
gpu = thr->cgpu->device_id; |
|
|
|
gpu = thr->cgpu->device_id; |
|
|
|
enable = &cgpu->enabled; |
|
|
|
denable = &cgpu->deven; |
|
|
|
#ifdef HAVE_ADL |
|
|
|
#ifdef HAVE_ADL |
|
|
|
if (adl_active && gpus[gpu].has_adl) |
|
|
|
if (adl_active && gpus[gpu].has_adl) |
|
|
|
gpu_autotune(gpu, enable); |
|
|
|
gpu_autotune(gpu, denable); |
|
|
|
if (opt_debug && gpus[gpu].has_adl) { |
|
|
|
if (opt_debug && gpus[gpu].has_adl) { |
|
|
|
int engineclock = 0, memclock = 0, activity = 0, fanspeed = 0, fanpercent = 0, powertune = 0; |
|
|
|
int engineclock = 0, memclock = 0, activity = 0, fanspeed = 0, fanpercent = 0, powertune = 0; |
|
|
|
float temp = 0, vddc = 0; |
|
|
|
float temp = 0, vddc = 0; |
|
|
@ -3762,7 +3764,7 @@ static void *watchdog_thread(void __maybe_unused *userdata) |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
/* Thread is waiting on getwork or disabled */ |
|
|
|
/* Thread is waiting on getwork or disabled */ |
|
|
|
if (thr->getwork || !*enable) |
|
|
|
if (thr->getwork || *denable == DEV_DISABLED) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
if (gpus[gpu].status != LIFE_WELL && now.tv_sec - thr->last.tv_sec < 60) { |
|
|
|
if (gpus[gpu].status != LIFE_WELL && now.tv_sec - thr->last.tv_sec < 60) { |
|
|
@ -3880,7 +3882,7 @@ static void print_summary(void) |
|
|
|
|
|
|
|
|
|
|
|
applog(LOG_WARNING, "Summary of per device statistics:\n"); |
|
|
|
applog(LOG_WARNING, "Summary of per device statistics:\n"); |
|
|
|
for (i = 0; i < total_devices; ++i) { |
|
|
|
for (i = 0; i < total_devices; ++i) { |
|
|
|
if (devices[i]->enabled) |
|
|
|
if (devices[i]->deven == DEV_ENABLED) |
|
|
|
log_print_status(devices[i]); |
|
|
|
log_print_status(devices[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -4130,7 +4132,7 @@ static int cgminer_id_count = 0; |
|
|
|
|
|
|
|
|
|
|
|
void enable_device(struct cgpu_info *cgpu) |
|
|
|
void enable_device(struct cgpu_info *cgpu) |
|
|
|
{ |
|
|
|
{ |
|
|
|
cgpu->enabled = true; |
|
|
|
cgpu->deven = DEV_ENABLED; |
|
|
|
devices[cgpu->cgminer_id = cgminer_id_count++] = cgpu; |
|
|
|
devices[cgpu->cgminer_id = cgminer_id_count++] = cgpu; |
|
|
|
mining_threads += cgpu->threads; |
|
|
|
mining_threads += cgpu->threads; |
|
|
|
#ifdef HAVE_OPENCL |
|
|
|
#ifdef HAVE_OPENCL |
|
|
@ -4306,7 +4308,7 @@ int main (int argc, char *argv[]) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
enable_device(devices[i]); |
|
|
|
enable_device(devices[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
devices[i]->enabled = false; |
|
|
|
devices[i]->deven = DEV_DISABLED; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
total_devices = cgminer_id_count; |
|
|
|
total_devices = cgminer_id_count; |
|
|
@ -4488,7 +4490,7 @@ int main (int argc, char *argv[]) |
|
|
|
|
|
|
|
|
|
|
|
/* Enable threads for devices set not to mine but disable
|
|
|
|
/* Enable threads for devices set not to mine but disable
|
|
|
|
* their queue in case we wish to enable them later */ |
|
|
|
* their queue in case we wish to enable them later */ |
|
|
|
if (cgpu->enabled) { |
|
|
|
if (cgpu->deven != DEV_DISABLED) { |
|
|
|
applog(LOG_DEBUG, "Pushing ping to thread %d", thr->id); |
|
|
|
applog(LOG_DEBUG, "Pushing ping to thread %d", thr->id); |
|
|
|
|
|
|
|
|
|
|
|
tq_push(thr->q, &ping); |
|
|
|
tq_push(thr->q, &ping); |
|
|
|