Browse Source

As we average gpu time over 5 work intervals for dynamic GPU intensity, there is no need to maintain a rolling average and it avoids the potential long term corruption of a single overflow value.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
618999026f
  1. 5
      driver-opencl.c
  2. 1
      miner.h

5
driver-opencl.c

@ -1585,15 +1585,14 @@ 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;
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->gpu_us_average > dynamic_us) { if (gpu_us > dynamic_us) {
if (gpu->intensity > MIN_INTENSITY) if (gpu->intensity > MIN_INTENSITY)
--gpu->intensity; --gpu->intensity;
} else if (gpu->gpu_us_average < dynamic_us / 2) { } else if (gpu_us < dynamic_us / 2) {
if (gpu->intensity < MAX_INTENSITY) if (gpu->intensity < MAX_INTENSITY)
++gpu->intensity; ++gpu->intensity;
} }

1
miner.h

@ -374,7 +374,6 @@ struct cgpu_info {
#endif #endif
struct timeval tv_gpustart; struct timeval tv_gpustart;
struct timeval tv_gpumid; struct timeval tv_gpumid;
double gpu_us_average;
int intervals, hit; int intervals, hit;
#endif #endif

Loading…
Cancel
Save