Browse Source

Merge branch 'bfgminer-2.8.x' into bfgminer-2.9.x

Luke Dashjr 13 years ago
parent
commit
cf93d3087d
9 changed files with 26 additions and 20 deletions
  1. 4 4
      README
  2. 3 3
      adl.c
  3. 1 1
      driver-cairnsmore.c
  4. 2 2
      driver-modminer.c
  5. 1 1
      driver-opencl.c
  6. 4 1
      driver-ztex.c
  7. 1 1
      dynclock.c
  8. 5 4
      libztex.c
  9. 5 3
      miner.c

+ 4 - 4
README

@@ -187,10 +187,10 @@ GPU only options:
 --disable-gpu|-G    Disable GPU mining even if suitable devices exist
 --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-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-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-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-fan <arg>     GPU fan percentage range - one value, range and/or comma separated list (e.g. 25-85,85,65)
 --gpu-map <arg>     Map OpenCL to ADL device order manually, paired CSV (e.g. 1:0,2:1 maps OpenCL 1 to ADL 0, 2 to 1)
 --gpu-map <arg>     Map OpenCL to ADL device order manually, paired CSV (e.g. 1:0,2:1 maps OpenCL 1 to ADL 0, 2 to 1)
---gpu-memclock <arg> Set the GPU memory (over)clock in Mhz - one value for all or separate by commas for per card.
+--gpu-memclock <arg> Set the GPU memory (over)clock in MHz - one value for all or separate by commas for per card.
 --gpu-memdiff <arg> Set a fixed difference in clock speed between the GPU and memory in auto-gpu mode
 --gpu-memdiff <arg> Set a fixed difference in clock speed between the GPU and memory in auto-gpu mode
 --gpu-platform <arg> Select OpenCL platform ID to use for GPU mining
 --gpu-platform <arg> Select OpenCL platform ID to use for GPU mining
 --gpu-powertune <arg> Set the GPU powertune percentage - one value for all or separate by commas for per card.
 --gpu-powertune <arg> Set the GPU powertune percentage - one value for all or separate by commas for per card.
@@ -376,7 +376,7 @@ GPU 0: [124.2 / 191.3 Mh/s] [Q:212  A:77  R:33  HW:0  E:36%  U:1.73/m]
 Temp: 67.0 C
 Temp: 67.0 C
 Fan Speed: 35% (2500 RPM)
 Fan Speed: 35% (2500 RPM)
 Engine Clock: 960 MHz
 Engine Clock: 960 MHz
-Memory Clock: 480 Mhz
+Memory Clock: 480 MHz
 Vddc: 1.200 V
 Vddc: 1.200 V
 Activity: 93%
 Activity: 93%
 Powertune: 0%
 Powertune: 0%
@@ -671,7 +671,7 @@ Sets card 0 cutoff temperature to 95 and card 1 to 105.
 --gpu-memdiff -125
 --gpu-memdiff -125
 This setting will modify the memory speed whenever the GPU clock speed is
 This setting will modify the memory speed whenever the GPU clock speed is
 modified by --auto-gpu. In this example, it will set the memory speed to
 modified by --auto-gpu. In this example, it will set the memory speed to
-be 125 Mhz lower than the GPU speed. This is useful for some cards like the
+be 125 MHz lower than the GPU speed. This is useful for some cards like the
 6970 which normally don't allow a bigger clock speed difference.
 6970 which normally don't allow a bigger clock speed difference.
 
 
 
 

+ 3 - 3
adl.c

@@ -1293,7 +1293,7 @@ updated:
 			wlogprint("(%d RPM)", fanspeed);
 			wlogprint("(%d RPM)", fanspeed);
 		wlogprint("\n");
 		wlogprint("\n");
 	}
 	}
-	wlogprint("Engine Clock: %d MHz\nMemory Clock: %d Mhz\nVddc: %.3f V\nActivity: %d%%\nPowertune: %d%%\n",
+	wlogprint("Engine Clock: %d MHz\nMemory Clock: %d MHz\nVddc: %.3f V\nActivity: %d%%\nPowertune: %d%%\n",
 		engineclock, memclock, vddc, activity, powertune);
 		engineclock, memclock, vddc, activity, powertune);
 	wlogprint("Fan autotune is %s (%d-%d)\n", ga->autofan ? "enabled" : "disabled",
 	wlogprint("Fan autotune is %s (%d-%d)\n", ga->autofan ? "enabled" : "disabled",
 		  gpus[gpu].min_fan, gpus[gpu].gpu_fan);
 		  gpus[gpu].min_fan, gpus[gpu].gpu_fan);
@@ -1307,7 +1307,7 @@ updated:
 		change_autosettings(gpu);
 		change_autosettings(gpu);
 	} else if (!strncasecmp(&input, "e", 1)) {
 	} else if (!strncasecmp(&input, "e", 1)) {
 		get_enginerange(gpu, &imin, &imax);
 		get_enginerange(gpu, &imin, &imax);
-		wlogprint("Enter GPU engine clock speed (%d - %d Mhz)", imin, imax);
+		wlogprint("Enter GPU engine clock speed (%d - %d MHz)", imin, imax);
 		val = curses_int("");
 		val = curses_int("");
 		if (val < imin || val > imax) {
 		if (val < imin || val > imax) {
 			wlogprint("Value is outside safe range, are you sure?\n");
 			wlogprint("Value is outside safe range, are you sure?\n");
@@ -1335,7 +1335,7 @@ updated:
 			wlogprint("Failed to modify fan speed\n");
 			wlogprint("Failed to modify fan speed\n");
 	} else if (!strncasecmp(&input, "m", 1)) {
 	} else if (!strncasecmp(&input, "m", 1)) {
 		get_memoryrange(gpu, &imin, &imax);
 		get_memoryrange(gpu, &imin, &imax);
-		wlogprint("Enter GPU memory clock speed (%d - %d Mhz)", imin, imax);
+		wlogprint("Enter GPU memory clock speed (%d - %d MHz)", imin, imax);
 		val = curses_int("");
 		val = curses_int("");
 		if (val < imin || val > imax) {
 		if (val < imin || val > imax) {
 			wlogprint("Value is outside safe range, are you sure?\n");
 			wlogprint("Value is outside safe range, are you sure?\n");

+ 1 - 1
driver-cairnsmore.c

@@ -146,7 +146,7 @@ static bool cairnsmore_init(struct thr_info *thr)
 		info->dclk.freqM =
 		info->dclk.freqM =
 		info->dclk.freqMDefault = CAIRNSMORE1_DEFAULT_CLOCK / 2.5;
 		info->dclk.freqMDefault = CAIRNSMORE1_DEFAULT_CLOCK / 2.5;
 		cairnsmore_send_cmd(cm1->device_fd, 0, info->dclk.freqM);
 		cairnsmore_send_cmd(cm1->device_fd, 0, info->dclk.freqM);
-		applog(LOG_WARNING, "%s %u: Frequency set to %u Mhz (range: %u-%u)",
+		applog(LOG_WARNING, "%s %u: Frequency set to %u MHz (range: %u-%u)",
 		       cm1->api->name, cm1->device_id,
 		       cm1->api->name, cm1->device_id,
 		       CAIRNSMORE1_DEFAULT_CLOCK, CAIRNSMORE1_MINIMUM_CLOCK, CAIRNSMORE1_MAXIMUM_CLOCK
 		       CAIRNSMORE1_DEFAULT_CLOCK, CAIRNSMORE1_MINIMUM_CLOCK, CAIRNSMORE1_MAXIMUM_CLOCK
 		);
 		);

+ 2 - 2
driver-modminer.c

@@ -411,7 +411,7 @@ modminer_fpga_init(struct thr_info *thr)
 			applog(LOG_WARNING, "%s %u.%u: Failed to set desired initial frequency of %u", modminer->api->name, modminer->device_id, fpgaid, MODMINER_DEFAULT_CLOCK);
 			applog(LOG_WARNING, "%s %u.%u: Failed to set desired initial frequency of %u", modminer->api->name, modminer->device_id, fpgaid, MODMINER_DEFAULT_CLOCK);
 	}
 	}
 	state->dclk.freqMDefault = state->dclk.freqM;
 	state->dclk.freqMDefault = state->dclk.freqM;
-	applog(LOG_WARNING, "%s %u.%u: Frequency set to %u Mhz (range: %u-%u)", modminer->api->name, modminer->device_id, fpgaid, state->dclk.freqM * 2, MODMINER_MINIMUM_CLOCK, state->dclk.freqMaxM * 2);
+	applog(LOG_WARNING, "%s %u.%u: Frequency set to %u MHz (range: %u-%u)", modminer->api->name, modminer->device_id, fpgaid, state->dclk.freqM * 2, MODMINER_MINIMUM_CLOCK, state->dclk.freqMaxM * 2);
 
 
 	mutex_unlock(&modminer->device_mutex);
 	mutex_unlock(&modminer->device_mutex);
 
 
@@ -486,7 +486,7 @@ static void modminer_get_temperature(struct cgpu_info *modminer, struct thr_info
 					state->last_cutoff_reduced = now;
 					state->last_cutoff_reduced = now;
 					int oldFreq = state->dclk.freqM;
 					int oldFreq = state->dclk.freqM;
 					if (modminer_reduce_clock(thr, false))
 					if (modminer_reduce_clock(thr, false))
-						applog(LOG_NOTICE, "%s %u.%u: Frequency %s from %u to %u Mhz (temp: %d)",
+						applog(LOG_NOTICE, "%s %u.%u: Frequency %s from %u to %u MHz (temp: %d)",
 						       modminer->api->name, modminer->device_id, fpgaid,
 						       modminer->api->name, modminer->device_id, fpgaid,
 						       (oldFreq > state->dclk.freqM ? "dropped" : "raised "),
 						       (oldFreq > state->dclk.freqM ? "dropped" : "raised "),
 						       oldFreq * 2, state->dclk.freqM * 2,
 						       oldFreq * 2, state->dclk.freqM * 2,

+ 1 - 1
driver-opencl.c

@@ -882,7 +882,7 @@ retry:
 				if (engineclock != -1)
 				if (engineclock != -1)
 					tailsprintf(logline, "E: %d MHz  ", engineclock);
 					tailsprintf(logline, "E: %d MHz  ", engineclock);
 				if (memclock != -1)
 				if (memclock != -1)
-					tailsprintf(logline, "M: %d Mhz  ", memclock);
+					tailsprintf(logline, "M: %d MHz  ", memclock);
 				if (vddc != -1)
 				if (vddc != -1)
 					tailsprintf(logline, "V: %.3fV  ", vddc);
 					tailsprintf(logline, "V: %.3fV  ", vddc);
 				if (activity != -1)
 				if (activity != -1)

+ 4 - 1
driver-ztex.c

@@ -365,8 +365,11 @@ static bool ztex_prepare(struct thr_info *thr)
 	get_datestamp(cgpu->init, &now);
 	get_datestamp(cgpu->init, &now);
 	
 	
 	ztex_selectFpga(ztex);
 	ztex_selectFpga(ztex);
-	if (libztex_configureFpga(ztex) != 0)
+	if (libztex_configureFpga(ztex) != 0) {
+		libztex_resetFpga(ztex);
+		ztex_releaseFpga(ztex);
 		return false;
 		return false;
+	}
 	ztex_releaseFpga(ztex);
 	ztex_releaseFpga(ztex);
 	ztex->dclk.freqM = ztex->dclk.freqMaxM+1;;
 	ztex->dclk.freqM = ztex->dclk.freqMaxM+1;;
 	//ztex_updateFreq(thr);
 	//ztex_updateFreq(thr);

+ 1 - 1
dynclock.c

@@ -20,7 +20,7 @@ void dclk_prepare(struct dclk_data *data)
 
 
 void dclk_msg_freqchange(const char *repr, int oldFreq, int newFreq, const char *tail)
 void dclk_msg_freqchange(const char *repr, int oldFreq, int newFreq, const char *tail)
 {
 {
-	applog(LOG_NOTICE, "%s: Frequency %s from %u to %u Mhz%s",
+	applog(LOG_NOTICE, "%s: Frequency %s from %u to %u MHz%s",
 	       repr,
 	       repr,
 	       (oldFreq > newFreq ? "dropped" : "raised "),
 	       (oldFreq > newFreq ? "dropped" : "raised "),
 	       oldFreq, newFreq,
 	       oldFreq, newFreq,

+ 5 - 4
libztex.c

@@ -307,10 +307,11 @@ static int libztex_configureFpgaLS(struct libztex_device *ztex, const char* firm
 
 
 		fclose(fp);
 		fclose(fp);
 	}
 	}
+
 	libztex_getFpgaState(ztex, &state);
 	libztex_getFpgaState(ztex, &state);
 	if (!state.fpgaConfigured) {
 	if (!state.fpgaConfigured) {
-		applog(LOG_ERR, "%s: FPGA configuration failed: DONE pin does not go high", ztex->repr);
-		return 3;
+		applog(LOG_ERR, "%s: LS FPGA configuration failed: DONE pin does not go high", ztex->repr);
+		return -3;
 	}
 	}
 	usleep(200000);
 	usleep(200000);
 	applog(LOG_INFO, "%s: FPGA configuration done", ztex->repr);
 	applog(LOG_INFO, "%s: FPGA configuration done", ztex->repr);
@@ -384,7 +385,7 @@ int libztex_setFreq(struct libztex_device *ztex, uint16_t freq) {
 	}
 	}
 	ztex->dclk.freqM = freq;
 	ztex->dclk.freqM = freq;
 	if (oldfreq > ztex->dclk.freqMaxM)
 	if (oldfreq > ztex->dclk.freqMaxM)
-		applog(LOG_WARNING, "%s: Frequency set to %u Mhz (range: %u-%u)",
+		applog(LOG_WARNING, "%s: Frequency set to %u MHz (range: %u-%u)",
 		       ztex->repr,
 		       ztex->repr,
 		       (unsigned)(ztex->freqM1 * (ztex->dclk.freqM + 1)),
 		       (unsigned)(ztex->freqM1 * (ztex->dclk.freqM + 1)),
 		       (unsigned)ztex->freqM1,
 		       (unsigned)ztex->freqM1,
@@ -474,7 +475,7 @@ int libztex_prepare_device(struct libusb_device *dev, struct libztex_device** zt
 	}
 	}
 
 
 	/* num chars = (all bytes except bLength and bDescriptorType) / 2 */
 	/* num chars = (all bytes except bLength and bDescriptorType) / 2 */
-	for (i = 0; i <= (cnt - 2) / 2 && i < sizeof(newdev->snString)-1; i++)
+	for (i = 0; i <= (cnt - 2) / 2 && i < (int)sizeof(newdev->snString)-1; i++)
 		newdev->snString[i] = buf[2 + i*2];
 		newdev->snString[i] = buf[2 + i*2];
 
 
 	newdev->snString[i] = 0;
 	newdev->snString[i] = 0;

+ 5 - 3
miner.c

@@ -1146,7 +1146,7 @@ static struct opt_table opt_config_table[] = {
 #ifdef HAVE_ADL
 #ifdef HAVE_ADL
 	OPT_WITH_ARG("--gpu-engine",
 	OPT_WITH_ARG("--gpu-engine",
 		     set_gpu_engine, NULL, NULL,
 		     set_gpu_engine, NULL, NULL,
-		     "GPU engine (over)clock range in Mhz - one value, range and/or comma separated list (e.g. 850-900,900,750-850)"),
+		     "GPU engine (over)clock range in MHz - one value, range and/or comma separated list (e.g. 850-900,900,750-850)"),
 	OPT_WITH_ARG("--gpu-fan",
 	OPT_WITH_ARG("--gpu-fan",
 		     set_gpu_fan, NULL, NULL,
 		     set_gpu_fan, NULL, NULL,
 		     "GPU fan percentage range - one value, range and/or comma separated list (e.g. 0-85,85,65)"),
 		     "GPU fan percentage range - one value, range and/or comma separated list (e.g. 0-85,85,65)"),
@@ -1155,7 +1155,7 @@ static struct opt_table opt_config_table[] = {
 		     "Map OpenCL to ADL device order manually, paired CSV (e.g. 1:0,2:1 maps OpenCL 1 to ADL 0, 2 to 1)"),
 		     "Map OpenCL to ADL device order manually, paired CSV (e.g. 1:0,2:1 maps OpenCL 1 to ADL 0, 2 to 1)"),
 	OPT_WITH_ARG("--gpu-memclock",
 	OPT_WITH_ARG("--gpu-memclock",
 		     set_gpu_memclock, NULL, NULL,
 		     set_gpu_memclock, NULL, NULL,
-		     "Set the GPU memory (over)clock in Mhz - one value for all or separate by commas for per card"),
+		     "Set the GPU memory (over)clock in MHz - one value for all or separate by commas for per card"),
 	OPT_WITH_ARG("--gpu-memdiff",
 	OPT_WITH_ARG("--gpu-memdiff",
 		     set_gpu_memdiff, NULL, NULL,
 		     set_gpu_memdiff, NULL, NULL,
 		     "Set a fixed difference in clock speed between the GPU and memory in auto-gpu mode"),
 		     "Set a fixed difference in clock speed between the GPU and memory in auto-gpu mode"),
@@ -6472,6 +6472,8 @@ static void convert_to_work(json_t *val, int rolltime, struct pool *pool, struct
 		free_work(work);
 		free_work(work);
 		return;
 		return;
 	}
 	}
+	total_getworks++;
+	pool->getwork_requested++;
 	work->pool = pool;
 	work->pool = pool;
 	memcpy(&(work->tv_getwork), tv_lp, sizeof(struct timeval));
 	memcpy(&(work->tv_getwork), tv_lp, sizeof(struct timeval));
 	memcpy(&(work->tv_getwork_reply), tv_lp_reply, sizeof(struct timeval));
 	memcpy(&(work->tv_getwork_reply), tv_lp_reply, sizeof(struct timeval));
@@ -6897,7 +6899,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
 				float temp = 0, vddc = 0;
 				float temp = 0, vddc = 0;
 
 
 				if (gpu_stats(gpu, &temp, &engineclock, &memclock, &vddc, &activity, &fanspeed, &fanpercent, &powertune))
 				if (gpu_stats(gpu, &temp, &engineclock, &memclock, &vddc, &activity, &fanspeed, &fanpercent, &powertune))
-					applog(LOG_DEBUG, "%.1f C  F: %d%%(%dRPM)  E: %dMHz  M: %dMhz  V: %.3fV  A: %d%%  P: %d%%",
+					applog(LOG_DEBUG, "%.1f C  F: %d%%(%dRPM)  E: %dMHz  M: %dMHz  V: %.3fV  A: %d%%  P: %d%%",
 					temp, fanpercent, fanspeed, engineclock, memclock, vddc, activity, powertune);
 					temp, fanpercent, fanspeed, engineclock, memclock, vddc, activity, powertune);
 			}
 			}
 #endif
 #endif