Browse Source

modminer: Implement --temp-hysteresis logic

Luke Dashjr 13 years ago
parent
commit
8ee38e9e20
6 changed files with 14 additions and 6 deletions
  1. 1 1
      README
  2. 0 1
      adl.c
  3. 0 1
      adl.h
  4. 8 2
      driver-modminer.c
  5. 4 1
      miner.c
  6. 1 0
      miner.h

+ 1 - 1
README

@@ -168,6 +168,7 @@ Options for both config file and command line:
 --submit-threads    Maximum number of share submission threads (default: 64)
 --syslog            Use system log for output messages (default: standard error)
 --temp-cutoff <arg> Temperature where a device will be automatically disabled, one value or comma separated list (default: 95)
+--temp-hysteresis <arg> Set how much the temperature can fluctuate outside limits when automanaging speeds (default: 3)
 --text-only|-T      Disable ncurses formatted screen output
 --url|-o <arg>      URL for bitcoin JSON-RPC server
 --user|-u <arg>     Username for bitcoin JSON-RPC server
@@ -202,7 +203,6 @@ GPU only options:
 --ndevs|-n          Enumerate number of detected GPUs and exit
 --no-adl            Disable the ATI display library used for monitoring and setting GPU parameters
 --no-restart        Do not attempt to restart GPUs that hang
---temp-hysteresis <arg> Set how much the temperature can fluctuate outside limits when automanaging speeds (default: 3)
 --temp-overheat <arg> Overheat temperature when automatically managing fan and GPU speeds (default: 85)
 --temp-target <arg> Target temperature when automatically managing fan and GPU speeds (default: 75)
 --vectors|-v <arg>  Override detected optimal vector (1, 2 or 4) - one value or comma separated list

+ 0 - 1
adl.c

@@ -44,7 +44,6 @@
 bool adl_active;
 bool opt_reorder = false;
 
-int opt_hysteresis = 3;
 const int opt_targettemp = 75;
 const int opt_overheattemp = 85;
 static pthread_mutex_t adl_lock;

+ 0 - 1
adl.h

@@ -3,7 +3,6 @@
 #ifdef HAVE_ADL
 bool adl_active;
 bool opt_reorder;
-int opt_hysteresis;
 const int opt_targettemp;
 const int opt_overheattemp;
 void init_adl(int nDevs);

+ 8 - 2
driver-modminer.c

@@ -510,7 +510,7 @@ static void modminer_get_temperature(struct cgpu_info *modminer, struct thr_info
 	if (2 == write(fd, cmd, 2) && read(fd, &temperature, 1) == 1)
 	{
 		state->temp = temperature;
-		if (temperature > modminer->cutofftemp - 2) {
+		if (temperature > modminer->targettemp + opt_hysteresis) {
 			{
 				time_t now = time(NULL);
 				if (state->last_cutoff_reduced != now) {
@@ -528,7 +528,13 @@ static void modminer_get_temperature(struct cgpu_info *modminer, struct thr_info
 			}
 		}
 		else
-			state->dclk.freqMaxM = state->freqMaxMaxM;
+		if (state->dclk.freqMaxM < state->freqMaxMaxM && temperature < modminer->targettemp) {
+			if (temperature < modminer->targettemp - opt_hysteresis) {
+				state->dclk.freqMaxM = state->freqMaxMaxM;
+			} else {
+				++state->dclk.freqMaxM;
+			}
+		}
 	}
 }
 

+ 4 - 1
miner.c

@@ -111,6 +111,7 @@ bool opt_quiet;
 bool opt_realquiet;
 bool opt_loginput;
 const int opt_cutofftemp = 95;
+int opt_hysteresis = 3;
 static int opt_retries = -1;
 int opt_fail_pause = 5;
 int opt_log_interval = 5;
@@ -1178,10 +1179,12 @@ static struct opt_table opt_config_table[] = {
 		     set_temp_cutoff, opt_show_intval, &opt_cutofftemp,
 		     "Temperature where a device will be automatically disabled, one value or comma separated list"),
 #endif
-#ifdef HAVE_ADL
+#if defined(HAVE_ADL) || defined(USE_MODMINER)
 	OPT_WITH_ARG("--temp-hysteresis",
 		     set_int_1_to_10, opt_show_intval, &opt_hysteresis,
 		     "Set how much the temperature can fluctuate outside limits when automanaging speeds"),
+#endif
+#ifdef HAVE_ADL
 	OPT_WITH_ARG("--temp-overheat",
 		     set_temp_overheat, opt_show_intval, &opt_overheattemp,
 		     "Overheat temperature when automatically managing fan and GPU speeds, one value or comma separated list"),

+ 1 - 0
miner.h

@@ -758,6 +758,7 @@ extern double total_diff_accepted, total_diff_rejected, total_diff_stale;
 extern unsigned int local_work;
 extern unsigned int total_go, total_ro;
 extern const int opt_cutofftemp;
+extern int opt_hysteresis;
 extern int opt_fail_pause;
 extern int opt_log_interval;
 extern unsigned long long global_hashrate;