mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-13 06:01:03 +00:00
Keep track of intended engine clock speed and only adjust up if it's higher than the last intended speed. This avoids setting the clock speed to one
relative to a lower profile one by mistake.
This commit is contained in:
parent
d1cf80a546
commit
fa4ce8daf2
11
adl.c
11
adl.c
@ -743,6 +743,10 @@ int set_engineclock(int gpu, int iEngineClock)
|
||||
iEngineClock *= 100;
|
||||
ga = &gpus[gpu].adl;
|
||||
|
||||
/* Keep track of intended engine clock in case the device changes
|
||||
* profile and drops while idle, not taking the new engine clock */
|
||||
ga->lastengine = iEngineClock;
|
||||
|
||||
lev = ga->lpOdParameters.iNumberOfPerformanceLevels - 1;
|
||||
lpOdPerformanceLevels = alloca(sizeof(ADLODPerformanceLevels) + (lev * sizeof(ADLODPerformanceLevel)));
|
||||
lpOdPerformanceLevels->iSize = sizeof(ADLODPerformanceLevels) + sizeof(ADLODPerformanceLevel) * lev;
|
||||
@ -1073,7 +1077,12 @@ void gpu_autotune(int gpu, bool *enable)
|
||||
newengine = ga->maxspeed;
|
||||
else if (newengine < ga->minspeed)
|
||||
newengine = ga->minspeed;
|
||||
if (newengine != engine) {
|
||||
|
||||
/* Adjust engine clock speed if it's lower, or if it's higher
|
||||
* but higher than the last intended value as well as the
|
||||
* current speed, to avoid setting the engine clock speed to
|
||||
* a speed relateive to a lower profile during idle periods. */
|
||||
if (newengine < engine || (newengine > engine && newengine > ga->lastengine)) {
|
||||
newengine /= 100;
|
||||
applog(LOG_INFO, "Setting GPU %d engine clock to %d", gpu, newengine);
|
||||
set_engineclock(gpu, newengine);
|
||||
|
Loading…
x
Reference in New Issue
Block a user