Browse Source

Bugfix: Do not try to call get_stats or get_statline* if device is still initializing

Luke Dashjr 12 years ago
parent
commit
12921ff064
1 changed files with 7 additions and 1 deletions
  1. 7 1
      miner.c

+ 7 - 1
miner.c

@@ -2408,6 +2408,12 @@ static void get_statline2(char *buf, struct cgpu_info *cgpu, bool for_curses)
 #endif
 		sprintf(buf, "%s ", opt_show_procs ? cgpu->proc_repr_ns : cgpu->dev_repr_ns);
 	
+	if (unlikely(cgpu->status == LIFE_INIT))
+	{
+		tailsprintf(buf, "Initializing...");
+		return;
+	}
+	
 	if (drv->get_dev_statline_before || drv->get_statline_before)
 	{
 		if (drv->get_dev_statline_before && drv->get_statline_before)
@@ -7897,7 +7903,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
 			char *dev_str = cgpu->proc_repr;
 			int gpu;
 
-			if (cgpu->drv->get_stats)
+			if (cgpu->drv->get_stats && likely(cgpu->status != LIFE_INIT))
 			  cgpu->drv->get_stats(cgpu);
 
 			gpu = cgpu->device_id;