|
|
@@ -490,8 +490,8 @@ void init_adl(int nDevs)
|
|
|
}
|
|
|
|
|
|
/* Set some default temperatures for autotune when enabled */
|
|
|
- if (!ga->targettemp)
|
|
|
- ga->targettemp = opt_targettemp;
|
|
|
+ if (!gpus[gpu].targettemp)
|
|
|
+ gpus[gpu].targettemp = opt_targettemp;
|
|
|
if (!ga->overtemp)
|
|
|
ga->overtemp = opt_overheattemp;
|
|
|
if (!gpus[gpu].cutofftemp)
|
|
|
@@ -1054,15 +1054,15 @@ static bool fan_autotune(int gpu, int temp, int fanpercent, int lasttemp, bool *
|
|
|
cgpu->device_last_not_well = time(NULL);
|
|
|
cgpu->device_not_well_reason = REASON_DEV_OVER_HEAT;
|
|
|
cgpu->dev_over_heat_count++;
|
|
|
- } else if (temp > ga->targettemp && fanpercent < top && tdiff >= 0) {
|
|
|
+ } else if (temp > gpus[gpu].targettemp && fanpercent < top && tdiff >= 0) {
|
|
|
applog(LOG_DEBUG, "Temperature over target, increasing fanspeed");
|
|
|
- if (temp > ga->targettemp + opt_hysteresis)
|
|
|
+ if (temp > gpus[gpu].targettemp + opt_hysteresis)
|
|
|
newpercent = ga->targetfan + 10;
|
|
|
else
|
|
|
newpercent = ga->targetfan + 5;
|
|
|
if (newpercent > top)
|
|
|
newpercent = top;
|
|
|
- } else if (fanpercent > bot && temp < ga->targettemp - opt_hysteresis) {
|
|
|
+ } else if (fanpercent > bot && temp < gpus[gpu].targettemp - opt_hysteresis) {
|
|
|
/* Detect large swings of 5 degrees or more and change fan by
|
|
|
* a proportion more */
|
|
|
if (tdiff <= 0) {
|
|
|
@@ -1076,10 +1076,10 @@ static bool fan_autotune(int gpu, int temp, int fanpercent, int lasttemp, bool *
|
|
|
|
|
|
/* We're in the optimal range, make minor adjustments if the
|
|
|
* temp is still drifting */
|
|
|
- if (fanpercent > bot && tdiff < 0 && lasttemp < ga->targettemp) {
|
|
|
+ if (fanpercent > bot && tdiff < 0 && lasttemp < gpus[gpu].targettemp) {
|
|
|
applog(LOG_DEBUG, "Temperature dropping while in target range, decreasing fanspeed");
|
|
|
newpercent = ga->targetfan + tdiff;
|
|
|
- } else if (fanpercent < top && tdiff > 0 && temp > ga->targettemp - opt_hysteresis) {
|
|
|
+ } else if (fanpercent < top && tdiff > 0 && temp > gpus[gpu].targettemp - opt_hysteresis) {
|
|
|
applog(LOG_DEBUG, "Temperature rising while in target range, increasing fanspeed");
|
|
|
newpercent = ga->targetfan + tdiff;
|
|
|
}
|
|
|
@@ -1168,17 +1168,17 @@ void gpu_autotune(int gpu, enum dev_enable *denable)
|
|
|
cgpu->device_last_not_well = time(NULL);
|
|
|
cgpu->device_not_well_reason = REASON_DEV_OVER_HEAT;
|
|
|
cgpu->dev_over_heat_count++;
|
|
|
- } else if (temp > ga->targettemp + opt_hysteresis && engine > ga->minspeed && fan_optimal) {
|
|
|
+ } else if (temp > gpus[gpu].targettemp + opt_hysteresis && engine > ga->minspeed && fan_optimal) {
|
|
|
applog(LOG_DEBUG, "Temperature %d degrees over target, decreasing clock speed", opt_hysteresis);
|
|
|
newengine = engine - ga->lpOdParameters.sEngineClock.iStep;
|
|
|
/* Only try to tune engine speed up if this GPU is not disabled */
|
|
|
- } else if (temp < ga->targettemp && engine < ga->maxspeed && fan_window && *denable == DEV_ENABLED) {
|
|
|
+ } else if (temp < gpus[gpu].targettemp && engine < ga->maxspeed && fan_window && *denable == DEV_ENABLED) {
|
|
|
applog(LOG_DEBUG, "Temperature below target, increasing clock speed");
|
|
|
- if (temp < ga->targettemp - opt_hysteresis)
|
|
|
+ if (temp < gpus[gpu].targettemp - opt_hysteresis)
|
|
|
newengine = ga->maxspeed;
|
|
|
else
|
|
|
newengine = engine + ga->lpOdParameters.sEngineClock.iStep;
|
|
|
- } else if (temp < ga->targettemp && *denable == DEV_RECOVER && opt_restart) {
|
|
|
+ } else if (temp < gpus[gpu].targettemp && *denable == DEV_RECOVER && opt_restart) {
|
|
|
applog(LOG_NOTICE, "Device recovered to temperature below target, re-enabling");
|
|
|
*denable = DEV_ENABLED;
|
|
|
}
|
|
|
@@ -1232,7 +1232,7 @@ void change_autosettings(int gpu)
|
|
|
char input;
|
|
|
int val;
|
|
|
|
|
|
- wlogprint("Target temperature: %d\n", ga->targettemp);
|
|
|
+ wlogprint("Target temperature: %d\n", gpus[gpu].targettemp);
|
|
|
wlogprint("Overheat temperature: %d\n", ga->overtemp);
|
|
|
wlogprint("Cutoff temperature: %d\n", gpus[gpu].cutofftemp);
|
|
|
wlogprint("Toggle [F]an auto [G]PU auto\nChange [T]arget [O]verheat [C]utoff\n");
|
|
|
@@ -1257,11 +1257,11 @@ void change_autosettings(int gpu)
|
|
|
if (val < 0 || val > 200)
|
|
|
wlogprint("Invalid temperature");
|
|
|
else
|
|
|
- ga->targettemp = val;
|
|
|
+ gpus[gpu].targettemp = val;
|
|
|
} else if (!strncasecmp(&input, "o", 1)) {
|
|
|
- wlogprint("Enter overheat temperature for this GPU in C (%d+)", ga->targettemp);
|
|
|
+ wlogprint("Enter overheat temperature for this GPU in C (%d+)", gpus[gpu].targettemp);
|
|
|
val = curses_int("");
|
|
|
- if (val <= ga->targettemp || val > 200)
|
|
|
+ if (val <= gpus[gpu].targettemp || val > 200)
|
|
|
wlogprint("Invalid temperature");
|
|
|
else
|
|
|
ga->overtemp = val;
|