|
@@ -694,29 +694,6 @@ static int __gpu_fanpercent(struct gpu_adl *ga)
|
|
|
return ga->lpFanSpeedValue.iFanSpeed;
|
|
return ga->lpFanSpeedValue.iFanSpeed;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* Failure log messages are handled by another (new) thread, since
|
|
|
|
|
- * gpu_fanpercent is called inside a curses UI update (which holds
|
|
|
|
|
- * the console lock, and would deadlock if we tried to log from
|
|
|
|
|
- * within) */
|
|
|
|
|
-static void *gpu_fanpercent_failure(void *userdata)
|
|
|
|
|
-{
|
|
|
|
|
- int *data = userdata;
|
|
|
|
|
- bool had_twin = data[0];
|
|
|
|
|
- int gpu = data[1];
|
|
|
|
|
-
|
|
|
|
|
- applog(LOG_WARNING, "GPU %d stopped reporting fanspeed due to driver corruption", gpu);
|
|
|
|
|
- if (opt_restart) {
|
|
|
|
|
- applog(LOG_WARNING, "Restart enabled, will attempt to restart BFGMiner");
|
|
|
|
|
- applog(LOG_WARNING, "You can disable this with the --no-restart option");
|
|
|
|
|
- app_restart();
|
|
|
|
|
- }
|
|
|
|
|
- applog(LOG_WARNING, "Disabling fanspeed monitoring on this device");
|
|
|
|
|
- if (had_twin) {
|
|
|
|
|
- applog(LOG_WARNING, "Disabling fanspeed linking on GPU twins");
|
|
|
|
|
- }
|
|
|
|
|
- return NULL;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
int gpu_fanpercent(int gpu)
|
|
int gpu_fanpercent(int gpu)
|
|
|
{
|
|
{
|
|
|
struct gpu_adl *ga;
|
|
struct gpu_adl *ga;
|
|
@@ -729,18 +706,6 @@ int gpu_fanpercent(int gpu)
|
|
|
lock_adl();
|
|
lock_adl();
|
|
|
ret = __gpu_fanpercent(ga);
|
|
ret = __gpu_fanpercent(ga);
|
|
|
unlock_adl();
|
|
unlock_adl();
|
|
|
- if (unlikely(ga->has_fanspeed && ret == -1)) {
|
|
|
|
|
- pthread_t thr;
|
|
|
|
|
- int *data = malloc(sizeof(int) * 2);
|
|
|
|
|
- data[0] = ga->twin ? 1 : 0;
|
|
|
|
|
- data[1] = gpu;
|
|
|
|
|
- ga->has_fanspeed = false;
|
|
|
|
|
- if (ga->twin) {
|
|
|
|
|
- ga->twin->twin = NULL;;
|
|
|
|
|
- ga->twin = NULL;
|
|
|
|
|
- }
|
|
|
|
|
- pthread_create(&thr, NULL, gpu_fanpercent_failure, data);
|
|
|
|
|
- }
|
|
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
|
|
|