|
|
@ -131,6 +131,7 @@ uint32_t device_plimit[MAX_GPUS] = { 0 }; |
|
|
|
uint8_t device_tlimit[MAX_GPUS] = { 0 }; |
|
|
|
uint8_t device_tlimit[MAX_GPUS] = { 0 }; |
|
|
|
int8_t device_pstate[MAX_GPUS] = { -1, -1 }; |
|
|
|
int8_t device_pstate[MAX_GPUS] = { -1, -1 }; |
|
|
|
int32_t device_led[MAX_GPUS] = { -1, -1 }; |
|
|
|
int32_t device_led[MAX_GPUS] = { -1, -1 }; |
|
|
|
|
|
|
|
int opt_led_mode = 0; |
|
|
|
int opt_cudaschedule = -1; |
|
|
|
int opt_cudaschedule = -1; |
|
|
|
static bool opt_keep_clocks = false; |
|
|
|
static bool opt_keep_clocks = false; |
|
|
|
|
|
|
|
|
|
|
@ -1255,8 +1256,10 @@ static void *workio_thread(void *userdata) |
|
|
|
ok = workio_get_work(wc, curl); |
|
|
|
ok = workio_get_work(wc, curl); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case WC_SUBMIT_WORK: |
|
|
|
case WC_SUBMIT_WORK: |
|
|
|
|
|
|
|
if (opt_led_mode == LED_MODE_SHARES) |
|
|
|
gpu_led_on(device_map[wc->thr->id]); |
|
|
|
gpu_led_on(device_map[wc->thr->id]); |
|
|
|
ok = workio_submit_work(wc, curl); |
|
|
|
ok = workio_submit_work(wc, curl); |
|
|
|
|
|
|
|
if (opt_led_mode == LED_MODE_SHARES) |
|
|
|
gpu_led_off(device_map[wc->thr->id]); |
|
|
|
gpu_led_off(device_map[wc->thr->id]); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case WC_ABORT: |
|
|
|
case WC_ABORT: |
|
|
@ -1968,6 +1971,9 @@ static void *miner_thread(void *userdata) |
|
|
|
gpulog(LOG_DEBUG, thr_id, "start=%08x end=%08x range=%08x", |
|
|
|
gpulog(LOG_DEBUG, thr_id, "start=%08x end=%08x range=%08x", |
|
|
|
start_nonce, max_nonce, (max_nonce-start_nonce)); |
|
|
|
start_nonce, max_nonce, (max_nonce-start_nonce)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (opt_led_mode == LED_MODE_MINING) |
|
|
|
|
|
|
|
gpu_led_on(dev_id); |
|
|
|
|
|
|
|
|
|
|
|
hashes_done = 0; |
|
|
|
hashes_done = 0; |
|
|
|
gettimeofday(&tv_start, NULL); |
|
|
|
gettimeofday(&tv_start, NULL); |
|
|
|
|
|
|
|
|
|
|
@ -2110,6 +2116,9 @@ static void *miner_thread(void *userdata) |
|
|
|
goto out; |
|
|
|
goto out; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (opt_led_mode == LED_MODE_MINING) |
|
|
|
|
|
|
|
gpu_led_off(dev_id); |
|
|
|
|
|
|
|
|
|
|
|
if (abort_flag) |
|
|
|
if (abort_flag) |
|
|
|
break; // time to leave the mining loop...
|
|
|
|
break; // time to leave the mining loop...
|
|
|
|
|
|
|
|
|
|
|
@ -2204,6 +2213,7 @@ static void *miner_thread(void *userdata) |
|
|
|
|
|
|
|
|
|
|
|
/* if nonce found, submit work */ |
|
|
|
/* if nonce found, submit work */ |
|
|
|
if (rc > 0 && !opt_benchmark) { |
|
|
|
if (rc > 0 && !opt_benchmark) { |
|
|
|
|
|
|
|
if (opt_led_mode == LED_MODE_SHARES) |
|
|
|
gpu_led_percent(dev_id, 50); |
|
|
|
gpu_led_percent(dev_id, 50); |
|
|
|
if (!submit_work(mythr, &work)) |
|
|
|
if (!submit_work(mythr, &work)) |
|
|
|
break; |
|
|
|
break; |
|
|
@ -2233,6 +2243,8 @@ static void *miner_thread(void *userdata) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
out: |
|
|
|
out: |
|
|
|
|
|
|
|
if (opt_led_mode) |
|
|
|
|
|
|
|
gpu_led_off(dev_id); |
|
|
|
if (opt_debug_threads) |
|
|
|
if (opt_debug_threads) |
|
|
|
applog(LOG_DEBUG, "%s() died", __func__); |
|
|
|
applog(LOG_DEBUG, "%s() died", __func__); |
|
|
|
tq_freeze(mythr->q); |
|
|
|
tq_freeze(mythr->q); |
|
|
@ -2959,12 +2971,18 @@ void parse_arg(int key, char *arg) |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 1080: /* --led */ |
|
|
|
case 1080: /* --led */ |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!opt_led_mode) |
|
|
|
|
|
|
|
opt_led_mode = LED_MODE_SHARES; |
|
|
|
char *pch = strtok(arg,","); |
|
|
|
char *pch = strtok(arg,","); |
|
|
|
int n = 0, val; |
|
|
|
int n = 0, val; |
|
|
|
while (pch != NULL && n < MAX_GPUS) { |
|
|
|
while (pch != NULL && n < MAX_GPUS) { |
|
|
|
int dev_id = device_map[n++]; |
|
|
|
int dev_id = device_map[n++]; |
|
|
|
char * p = strstr(pch, "0x"); |
|
|
|
char * p = strstr(pch, "0x"); |
|
|
|
val = p ? (int32_t) strtoul(p, NULL, 16) : atoi(pch); |
|
|
|
val = p ? (int32_t) strtoul(p, NULL, 16) : atoi(pch); |
|
|
|
|
|
|
|
if (!val && !strcmp(pch, "mining")) |
|
|
|
|
|
|
|
opt_led_mode = LED_MODE_MINING; |
|
|
|
|
|
|
|
if (!val && !strcmp(pch, "shares")) |
|
|
|
|
|
|
|
opt_led_mode = LED_MODE_SHARES; |
|
|
|
device_led[dev_id] = val; |
|
|
|
device_led[dev_id] = val; |
|
|
|
pch = strtok(NULL, ","); |
|
|
|
pch = strtok(NULL, ","); |
|
|
|
} |
|
|
|
} |
|
|
|