mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Reinstate the history on dynamic intensity mode to damp fluctuations in intensity but use an upper limit on how much the value can increase at any time to cope with rare overflows.
This commit is contained in:
parent
d211f8e0b0
commit
4fbc570fa4
@ -1585,14 +1585,19 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
gpu_us = us_tdiff(&tv_gpuend, &gpu->tv_gpumid);
|
gpu_us = us_tdiff(&tv_gpuend, &gpu->tv_gpumid);
|
||||||
if (gpu_us > 0 && ++gpu->hit > 4) {
|
if (gpu_us > 0 && ++gpu->hit > 4) {
|
||||||
gpu_us = us_tdiff(&tv_gpuend, &gpu->tv_gpustart) / gpu->intervals;
|
gpu_us = us_tdiff(&tv_gpuend, &gpu->tv_gpustart) / gpu->intervals;
|
||||||
|
/* Very rarely we may get an overflow so put an upper
|
||||||
|
* limit on the detected time */
|
||||||
|
if (gpu_us > gpu->gpu_us_average * 4)
|
||||||
|
gpu_us = gpu->gpu_us_average * 4;
|
||||||
|
gpu->gpu_us_average = (gpu->gpu_us_average + gpu_us * 0.63) / 1.63;
|
||||||
|
|
||||||
/* Try to not let the GPU be out for longer than
|
/* Try to not let the GPU be out for longer than
|
||||||
* opt_dynamic_interval in ms, but increase
|
* opt_dynamic_interval in ms, but increase
|
||||||
* intensity when the system is idle in dynamic mode */
|
* intensity when the system is idle in dynamic mode */
|
||||||
if (gpu_us > dynamic_us) {
|
if (gpu->gpu_us_average > dynamic_us) {
|
||||||
if (gpu->intensity > MIN_INTENSITY)
|
if (gpu->intensity > MIN_INTENSITY)
|
||||||
--gpu->intensity;
|
--gpu->intensity;
|
||||||
} else if (gpu_us < dynamic_us / 2) {
|
} else if (gpu->gpu_us_average < dynamic_us / 2) {
|
||||||
if (gpu->intensity < MAX_INTENSITY)
|
if (gpu->intensity < MAX_INTENSITY)
|
||||||
++gpu->intensity;
|
++gpu->intensity;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user