Display last initialised time in gpu management info.
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
diff --git a/main.c b/main.c
index ce62b28..5d081aa 100644
--- a/main.c
+++ b/main.c
@@ -1965,6 +1965,7 @@ retry:
gpu, cgpu->rolling, cgpu->total_mhashes / total_secs,
cgpu->getworks, cgpu->accepted, cgpu->rejected, cgpu->hw_errors,
cgpu->efficiency, cgpu->utility);
+ wlog("Last initialised: %s\n", cgpu->init);
for (i = 0; i < mining_threads; i++) {
thr = &thr_info[i];
if (thr->cgpu != cgpu)
@@ -3361,8 +3362,9 @@ static void *reinit_gpu(void *userdata)
struct cgpu_info *cgpu = (struct cgpu_info *)userdata;
int gpu = cgpu->cpu_gpu;
struct thr_info *thr;
- int thr_id;
+ struct timeval now;
_clState *clState;
+ int thr_id;
/* Send threads message to stop */
gpu_devices[gpu] = false;
@@ -3400,6 +3402,9 @@ static void *reinit_gpu(void *userdata)
applog(LOG_WARNING, "Thread %d restarted", thr_id);
}
+ gettimeofday(&now, NULL);
+ get_datestamp(cgpu->init, &now);
+
/* Try to re-enable it */
gpu_devices[gpu] = true;
for (thr_id = 0; thr_id < gpu_threads; thr_id ++) {
@@ -4031,6 +4036,7 @@ int main (int argc, char *argv[])
for (j = 0; j < nDevs * opt_g_threads; j++) {
int gpu = j % nDevs;
struct cgpu_info *cgpu;
+ struct timeval now;
gpus[gpu].is_gpu = 1;
gpus[gpu].cpu_gpu = gpu;
@@ -4058,9 +4064,12 @@ int main (int argc, char *argv[])
if (!clStates[i]) {
applog(LOG_ERR, "Failed to init GPU thread %d", i);
gpu_devices[i] = false;
+ strcat(cgpu->init, "Never");
continue;
}
applog(LOG_INFO, "initCl() finished. Found %s", name);
+ gettimeofday(&now, NULL);
+ get_datestamp(cgpu->init, &now);
if (unlikely(thr_info_create(thr, NULL, gpuminer_thread, thr)))
quit(1, "thread %d create failed", i);
diff --git a/miner.h b/miner.h
index 1bf1434..e319ec1 100644
--- a/miner.h
+++ b/miner.h
@@ -157,6 +157,8 @@ struct cgpu_info {
unsigned int vwidth;
size_t max_work_size;
size_t work_size;
+
+ char init[40];
};
struct thr_info {