1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-09 06:18:06 +00:00

per-pool gpu-fan

This commit is contained in:
Jan Berdajs 2014-05-29 23:20:56 +02:00
parent 9ec87cfc1a
commit 2ec09155e6
3 changed files with 18 additions and 1 deletions

View File

@ -56,6 +56,7 @@ global settings:
* pool-gpu-memclock
* pool-gpu-threads
* pool-thread-concurrency
* pool-gpu-fan
## CLI-only options

View File

@ -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;

View File

@ -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];