Browse Source

Allow the refresh interval to be adjusted in dynamic intensity with a --gpu-dyninterval parameter.

nfactor-troky
ckolivas 12 years ago
parent
commit
c235c7e373
  1. 1
      README
  2. 4
      cgminer.c
  3. 6
      device-gpu.c

1
README

@ -173,6 +173,7 @@ GPU only options: @@ -173,6 +173,7 @@ GPU only options:
--device|-d <arg> Select device to use, (Use repeat -d for multiple devices, default: all)
--disable-gpu|-G Disable GPU mining even if suitable devices exist
--gpu-threads|-g <arg> Number of threads per GPU (1 - 10) (default: 2)
--gpu-dyninterval <arg> Set the refresh interval in ms for GPUs using dynamic intensity (default: 7)
--gpu-engine <arg> GPU engine (over)clock range in Mhz - one value, range and/or comma separated list (e.g. 850-900,900,750-850)
--gpu-fan <arg> GPU fan percentage range - one value, range and/or comma separated list (e.g. 25-85,85,65)
--gpu-memclock <arg> Set the GPU memory (over)clock in Mhz - one value for all or separate by commas for per card.

4
cgminer.c

@ -100,6 +100,7 @@ int opt_bench_algo = -1; @@ -100,6 +100,7 @@ int opt_bench_algo = -1;
static const bool opt_time = true;
#ifdef HAVE_OPENCL
int opt_dynamic_interval = 7;
static bool opt_restart = true;
static bool opt_nogpu;
#endif
@ -674,6 +675,9 @@ static struct opt_table opt_config_table[] = { @@ -674,6 +675,9 @@ static struct opt_table opt_config_table[] = {
opt_set_bool, &opt_fail_only,
"Don't leak work to backup pools when primary pool is lagging"),
#ifdef HAVE_OPENCL
OPT_WITH_ARG("--gpu-dyninterval",
set_int_1_to_65535, opt_show_intval, &opt_dynamic_interval,
"Set the refresh interval in ms for GPUs using dynamic intensity"),
OPT_WITH_ARG("--gpu-platform",
set_int_0_to_9999, opt_show_intval, &opt_platform_id,
"Select OpenCL platform ID to use for GPU mining"),

6
device-gpu.c

@ -1176,6 +1176,8 @@ static bool opencl_prepare_work(struct thr_info __maybe_unused *thr, struct work @@ -1176,6 +1176,8 @@ static bool opencl_prepare_work(struct thr_info __maybe_unused *thr, struct work
return true;
}
extern int opt_dynamic_interval;
static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
uint64_t __maybe_unused max_nonce)
{
@ -1209,10 +1211,10 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work, @@ -1209,10 +1211,10 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
/* Try to not let the GPU be out for longer than 6ms, but
* increase intensity when the system is idle, unless
* dynamic is disabled. */
if (gpu_ms_average > 7) {
if (gpu_ms_average > opt_dynamic_interval) {
if (gpu->intensity > MIN_INTENSITY)
--gpu->intensity;
} else if (gpu_ms_average < 3) {
} else if (gpu_ms_average < ((opt_dynamic_interval / 2) ? : 1)) {
if (gpu->intensity < MAX_INTENSITY)
++gpu->intensity;
}

Loading…
Cancel
Save