mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Only use one thread to determine if a GPU is sick or well, and make sure to reset the sick restart attempt time.
This commit is contained in:
parent
02e126f42d
commit
088ee2fa29
11
main.c
11
main.c
@ -4128,8 +4128,14 @@ static void *watchdog_thread(void *userdata)
|
||||
|
||||
//for (i = 0; i < mining_threads; i++) {
|
||||
for (i = 0; i < gpu_threads; i++) {
|
||||
struct thr_info *thr = &thr_info[i];
|
||||
int gpu = thr->cgpu->cpu_gpu;
|
||||
struct thr_info *thr;
|
||||
int gpu;
|
||||
|
||||
/* Use only one thread per device to determine if the GPU is healthy */
|
||||
if (i >= nDevs)
|
||||
break;
|
||||
thr = &thr_info[i];
|
||||
gpu = thr->cgpu->cpu_gpu;
|
||||
|
||||
/* Thread is waiting on getwork or disabled */
|
||||
if (thr->getwork || !gpu_devices[gpu])
|
||||
@ -4150,6 +4156,7 @@ static void *watchdog_thread(void *userdata)
|
||||
applog(LOG_ERR, "Thread %d not responding for more than 10 minutes, GPU %d declared DEAD!", i, gpu);
|
||||
} else if (now.tv_sec - thr->sick.tv_sec > 60 && gpus[i].status == LIFE_SICK) {
|
||||
/* Attempt to restart a GPU once every minute */
|
||||
gettimeofday(&thr->sick, NULL);
|
||||
reinit_device(thr->cgpu);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user