Add an --auto-fan command line option to allow all GPUs to have autofan enabled from startup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
diff --git a/adl.c b/adl.c
index 614bfd1..3b3b55f 100644
--- a/adl.c
+++ b/adl.c
@@ -228,6 +228,8 @@ void init_adl(int nDevs)
/* Set some default temperatures for autotune when enabled */
ga->targettemp = 75;
ga->overtemp = 85;
+ if (opt_autofan)
+ ga->autofan = true;
gpus[devices - 1].has_adl = true;
}
diff --git a/main.c b/main.c
index f83fa8b..ebf5e44 100644
--- a/main.c
+++ b/main.c
@@ -221,6 +221,7 @@ static bool opt_nogpu;
static bool opt_usecpu;
static int opt_shares;
static bool opt_fail_only;
+bool opt_autofan;
char *opt_kernel_path;
@@ -1131,6 +1132,11 @@ static struct opt_table opt_config_table[] = {
"\n\tsse4_64\t\tSSE4.1 64 bit implementation for x86_64 machines"
#endif
),
+#ifdef HAVE_ADL
+ OPT_WITHOUT_ARG("--auto-fan",
+ opt_set_bool, &opt_autofan,
+ "Automatically adjust all GPU fan speeds to maintain a target temperature"),
+#endif
OPT_WITH_ARG("--bench-algo|-b",
set_int_0_to_9999, opt_show_intval, &opt_bench_algo,
opt_hidden),
diff --git a/miner.h b/miner.h
index ad9d2ae..9035a2b 100644
--- a/miner.h
+++ b/miner.h
@@ -295,6 +295,8 @@ extern bool opt_debug;
extern bool opt_protocol;
extern bool opt_log_output;
extern char *opt_kernel_path;
+extern bool opt_autofan;
+
extern const uint32_t sha256_init_state[];
extern json_t *json_rpc_call(CURL *curl, const char *url, const char *userpass,
const char *rpc_req, bool, bool, bool *,