diff --git a/doc/configuration.md b/doc/configuration.md index c02cb2ed..39a14c8a 100644 --- a/doc/configuration.md +++ b/doc/configuration.md @@ -56,6 +56,7 @@ global settings: * pool-gpu-memclock * pool-gpu-threads * pool-thread-concurrency +* pool-gpu-fan ## CLI-only options diff --git a/miner.h b/miner.h index e7300918..ca50cdcb 100644 --- a/miner.h +++ b/miner.h @@ -1225,6 +1225,7 @@ struct pool { const char *gpu_engine; const char *gpu_memclock; const char *gpu_threads; + const char *gpu_fan; pthread_mutex_t pool_lock; cglock_t data_lock; diff --git a/sgminer.c b/sgminer.c index f63cbd6f..a5e68bbb 100644 --- a/sgminer.c +++ b/sgminer.c @@ -836,6 +836,13 @@ static char *set_pool_gpu_threads(const char *arg) return NULL; } +static char *set_pool_gpu_fan(const char *arg) +{ + struct pool *pool = get_current_pool(); + pool->gpu_fan = arg; + return NULL; +} + static char *set_pool_nfactor(const char *arg) { struct pool *pool = get_current_pool(); @@ -1328,7 +1335,9 @@ static struct opt_table opt_config_table[] = { OPT_WITH_ARG("--pool-gpu-threads", set_pool_gpu_threads, NULL, NULL, "Number of threads per GPU for pool"), - + OPT_WITH_ARG("--pool-gpu-fan", + set_pool_gpu_fan, NULL, NULL, + "GPU fan for pool"), #endif OPT_WITH_ARG("--lookup-gap", set_lookup_gap, NULL, NULL, @@ -6201,6 +6210,12 @@ static void get_work_prepare_thread(struct thr_info *mythr, struct work *work) for (i = 0; i < nDevs; i++) set_memoryclock(i, gpus[i].gpu_memclock); } + if (work->pool->gpu_fan) { + set_gpu_fan(work->pool->gpu_fan); + for (i = 0; i < nDevs; i++) + if (gpus[i].min_fan == gpus[i].gpu_fan) + set_fanspeed(i, gpus[i].gpu_fan); + } // Change algorithm for each thread (thread_prepare calls initCl) for (i = 0; i < mining_threads; i++) { struct thr_info *thr = mining_thr[i];