mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Merge branch 'master' into kncminer
This commit is contained in:
commit
b431ea4e1f
@ -105,7 +105,7 @@ ASIC SPECIFIC COMMANDS
|
|||||||
--bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
|
--bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
|
||||||
--bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
|
--bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
|
||||||
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
|
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
|
||||||
--klondike-options <arg> Set klondike options clock:temp1:temp2:fan
|
--klondike-options <arg> Set klondike options clock:temptarget
|
||||||
|
|
||||||
|
|
||||||
AVALON AND BITBURNER DEVICES
|
AVALON AND BITBURNER DEVICES
|
||||||
|
1
README
1
README
@ -227,6 +227,7 @@ ASIC only options:
|
|||||||
--bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
|
--bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
|
||||||
--bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
|
--bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
|
||||||
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
|
--bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
|
||||||
|
--klondike-options <arg> Set klondike options clock:temptarget
|
||||||
|
|
||||||
See ASIC-README for more information regarding these.
|
See ASIC-README for more information regarding these.
|
||||||
|
|
||||||
|
@ -1270,7 +1270,7 @@ static struct opt_table opt_config_table[] = {
|
|||||||
#ifdef USE_KLONDIKE
|
#ifdef USE_KLONDIKE
|
||||||
OPT_WITH_ARG("--klondike-options",
|
OPT_WITH_ARG("--klondike-options",
|
||||||
set_klondike_options, NULL, NULL,
|
set_klondike_options, NULL, NULL,
|
||||||
"Set klondike options clock:temp1:temp2:fan"),
|
"Set klondike options clock:temptarget"),
|
||||||
#endif
|
#endif
|
||||||
OPT_WITHOUT_ARG("--load-balance",
|
OPT_WITHOUT_ARG("--load-balance",
|
||||||
set_loadbalance, &pool_strategy,
|
set_loadbalance, &pool_strategy,
|
||||||
|
@ -208,6 +208,7 @@ typedef struct jobque {
|
|||||||
int workqc;
|
int workqc;
|
||||||
struct timeval last_update;
|
struct timeval last_update;
|
||||||
bool overheat;
|
bool overheat;
|
||||||
|
bool flushed;
|
||||||
int late_update_count;
|
int late_update_count;
|
||||||
int late_update_sequential;
|
int late_update_sequential;
|
||||||
} JOBQUE;
|
} JOBQUE;
|
||||||
@ -315,7 +316,7 @@ static KLIST *allocate_kitem(struct cgpu_info *klncgpu)
|
|||||||
cg_wunlock(&klninfo->klist_lock);
|
cg_wunlock(&klninfo->klist_lock);
|
||||||
|
|
||||||
if (ran_out > 0)
|
if (ran_out > 0)
|
||||||
applog(LOG_ERR, "%s", errbuf);
|
applog(LOG_WARNING, "%s", errbuf);
|
||||||
|
|
||||||
return kitem;
|
return kitem;
|
||||||
}
|
}
|
||||||
@ -709,32 +710,14 @@ static bool klondike_init(struct cgpu_info *klncgpu)
|
|||||||
|
|
||||||
// boundaries are checked by device, with valid values returned
|
// boundaries are checked by device, with valid values returned
|
||||||
if (opt_klondike_options != NULL) {
|
if (opt_klondike_options != NULL) {
|
||||||
int hashclock, fantarget;
|
int hashclock;
|
||||||
double temp1, temp2;
|
double temptarget;
|
||||||
|
|
||||||
sscanf(opt_klondike_options, "%d:%lf:%lf:%d",
|
sscanf(opt_klondike_options, "%d:%lf", &hashclock, &temptarget);
|
||||||
&hashclock,
|
|
||||||
&temp1, &temp2,
|
|
||||||
&fantarget);
|
|
||||||
SET_HASHCLOCK(kline.cfg.hashclock, hashclock);
|
SET_HASHCLOCK(kline.cfg.hashclock, hashclock);
|
||||||
kline.cfg.temptarget = cvtCToKln(temp1);
|
kline.cfg.temptarget = cvtCToKln(temptarget);
|
||||||
kline.cfg.tempcritical = cvtCToKln(temp2);
|
kline.cfg.tempcritical = 0; // hard code for old firmware
|
||||||
if (fantarget < 0) {
|
kline.cfg.fantarget = 0xff; // hard code for old firmware
|
||||||
applog(LOG_WARNING,
|
|
||||||
"%s%i: %s options invalid fantarget < 0 using 0",
|
|
||||||
klncgpu->drv->name,
|
|
||||||
klncgpu->device_id,
|
|
||||||
klncgpu->drv->dname);
|
|
||||||
fantarget = 0;
|
|
||||||
} else if (fantarget > 100) {
|
|
||||||
applog(LOG_WARNING,
|
|
||||||
"%s%i: %s options invalid fantarget > 100 using 100",
|
|
||||||
klncgpu->drv->name,
|
|
||||||
klncgpu->device_id,
|
|
||||||
klncgpu->drv->dname);
|
|
||||||
fantarget = 100;
|
|
||||||
}
|
|
||||||
kline.cfg.fantarget = (int)(255 * fantarget / 100);
|
|
||||||
size = sizeof(kline.cfg) - 2;
|
size = sizeof(kline.cfg) - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -838,6 +821,7 @@ static bool klondike_detect_one(struct libusb_device *dev, struct usb_find_devic
|
|||||||
break;
|
break;
|
||||||
update_usb_stats(klncgpu);
|
update_usb_stats(klncgpu);
|
||||||
applog(LOG_DEBUG, "Klondike cgpu added");
|
applog(LOG_DEBUG, "Klondike cgpu added");
|
||||||
|
rwlock_init(&klninfo->stat_lock);
|
||||||
cglock_init(&klninfo->klist_lock);
|
cglock_init(&klninfo->klist_lock);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -985,7 +969,9 @@ static void *klondike_get_replies(void *userdata)
|
|||||||
}
|
}
|
||||||
if (!err && recd == REPLY_SIZE) {
|
if (!err && recd == REPLY_SIZE) {
|
||||||
cgtime(&(kitem->tv_when));
|
cgtime(&(kitem->tv_when));
|
||||||
|
rd_lock(&(klninfo->stat_lock));
|
||||||
kitem->block_seq = klninfo->block_seq;
|
kitem->block_seq = klninfo->block_seq;
|
||||||
|
rd_unlock(&(klninfo->stat_lock));
|
||||||
if (opt_log_level <= READ_DEBUG) {
|
if (opt_log_level <= READ_DEBUG) {
|
||||||
hexdata = bin2hex((unsigned char *)&(kitem->kline.hd.dev), recd-1);
|
hexdata = bin2hex((unsigned char *)&(kitem->kline.hd.dev), recd-1);
|
||||||
applog(READ_DEBUG, "%s%i:%d reply [%c:%s]",
|
applog(READ_DEBUG, "%s%i:%d reply [%c:%s]",
|
||||||
@ -1022,11 +1008,32 @@ static void *klondike_get_replies(void *userdata)
|
|||||||
klondike_check_nonce(klncgpu, kitem);
|
klondike_check_nonce(klncgpu, kitem);
|
||||||
display_kline(klncgpu, &kitem->kline, msg_reply);
|
display_kline(klncgpu, &kitem->kline, msg_reply);
|
||||||
break;
|
break;
|
||||||
case KLN_CMD_STATUS:
|
|
||||||
case KLN_CMD_WORK:
|
case KLN_CMD_WORK:
|
||||||
|
// We can't do/check this until it's initialised
|
||||||
|
if (klninfo->initialised) {
|
||||||
|
dev = kitem->kline.ws.dev;
|
||||||
|
if (kitem->kline.ws.workqc == 0) {
|
||||||
|
bool idle = false;
|
||||||
|
rd_lock(&(klninfo->stat_lock));
|
||||||
|
if (klninfo->jobque[dev].flushed == false)
|
||||||
|
idle = true;
|
||||||
|
slaves = klninfo->status[0].kline.ws.slavecount;
|
||||||
|
rd_unlock(&(klninfo->stat_lock));
|
||||||
|
if (idle)
|
||||||
|
applog(LOG_WARNING, "%s%i:%d went idle before work was sent",
|
||||||
|
klncgpu->drv->name,
|
||||||
|
klncgpu->device_id,
|
||||||
|
dev);
|
||||||
|
}
|
||||||
|
wr_lock(&(klninfo->stat_lock));
|
||||||
|
klninfo->jobque[dev].flushed = false;
|
||||||
|
wr_unlock(&(klninfo->stat_lock));
|
||||||
|
}
|
||||||
|
case KLN_CMD_STATUS:
|
||||||
case KLN_CMD_ABORT:
|
case KLN_CMD_ABORT:
|
||||||
// We can't do/check this until it's initialised
|
// We can't do/check this until it's initialised
|
||||||
if (klninfo->initialised) {
|
if (klninfo->initialised) {
|
||||||
|
isc = 0;
|
||||||
dev = kitem->kline.ws.dev;
|
dev = kitem->kline.ws.dev;
|
||||||
wr_lock(&(klninfo->stat_lock));
|
wr_lock(&(klninfo->stat_lock));
|
||||||
klninfo->jobque[dev].workqc = (int)(kitem->kline.ws.workqc);
|
klninfo->jobque[dev].workqc = (int)(kitem->kline.ws.workqc);
|
||||||
@ -1066,8 +1073,9 @@ static void *klondike_get_replies(void *userdata)
|
|||||||
klninfo->jobque[dev].overheat = true;
|
klninfo->jobque[dev].overheat = true;
|
||||||
wr_unlock(&(klninfo->stat_lock));
|
wr_unlock(&(klninfo->stat_lock));
|
||||||
|
|
||||||
applog(LOG_ERR, "%s%i:%d Critical overheat (%.0fC)",
|
applog(LOG_WARNING, "%s%i:%d Critical overheat (%.0fC)",
|
||||||
klncgpu->drv->name, klncgpu->device_id,
|
klncgpu->drv->name,
|
||||||
|
klncgpu->device_id,
|
||||||
dev, temp);
|
dev, temp);
|
||||||
|
|
||||||
zero_kline(&kline);
|
zero_kline(&kline);
|
||||||
@ -1121,13 +1129,13 @@ static void klondike_flush_work(struct cgpu_info *klncgpu)
|
|||||||
KLINE kline;
|
KLINE kline;
|
||||||
int slaves, dev;
|
int slaves, dev;
|
||||||
|
|
||||||
|
wr_lock(&(klninfo->stat_lock));
|
||||||
klninfo->block_seq++;
|
klninfo->block_seq++;
|
||||||
|
slaves = klninfo->status[0].kline.ws.slavecount;
|
||||||
|
wr_unlock(&(klninfo->stat_lock));
|
||||||
|
|
||||||
applog(LOG_DEBUG, "%s%i: flushing work",
|
applog(LOG_DEBUG, "%s%i: flushing work",
|
||||||
klncgpu->drv->name, klncgpu->device_id);
|
klncgpu->drv->name, klncgpu->device_id);
|
||||||
rd_lock(&(klninfo->stat_lock));
|
|
||||||
slaves = klninfo->status[0].kline.ws.slavecount;
|
|
||||||
rd_unlock(&(klninfo->stat_lock));
|
|
||||||
zero_kline(&kline);
|
zero_kline(&kline);
|
||||||
kline.hd.cmd = KLN_CMD_ABORT;
|
kline.hd.cmd = KLN_CMD_ABORT;
|
||||||
for (dev = 0; dev <= slaves; dev++) {
|
for (dev = 0; dev <= slaves; dev++) {
|
||||||
@ -1138,6 +1146,7 @@ static void klondike_flush_work(struct cgpu_info *klncgpu)
|
|||||||
memcpy((void *)&(klninfo->status[dev]),
|
memcpy((void *)&(klninfo->status[dev]),
|
||||||
kitem,
|
kitem,
|
||||||
sizeof(klninfo->status[dev]));
|
sizeof(klninfo->status[dev]));
|
||||||
|
klninfo->jobque[dev].flushed = true;
|
||||||
wr_unlock(&(klninfo->stat_lock));
|
wr_unlock(&(klninfo->stat_lock));
|
||||||
kitem = release_kitem(klncgpu, kitem);
|
kitem = release_kitem(klncgpu, kitem);
|
||||||
}
|
}
|
||||||
@ -1285,12 +1294,12 @@ static bool klondike_queue_full(struct cgpu_info *klncgpu)
|
|||||||
seq = ++klninfo->jobque[dev].late_update_sequential;
|
seq = ++klninfo->jobque[dev].late_update_sequential;
|
||||||
rd_unlock(&(klninfo->stat_lock));
|
rd_unlock(&(klninfo->stat_lock));
|
||||||
if (seq < LATE_UPDATE_LIMIT) {
|
if (seq < LATE_UPDATE_LIMIT) {
|
||||||
applog(LOG_ERR, "%s%i:%d late update",
|
applog(LOG_DEBUG, "%s%i:%d late update",
|
||||||
klncgpu->drv->name, klncgpu->device_id, dev);
|
klncgpu->drv->name, klncgpu->device_id, dev);
|
||||||
klondike_get_stats(klncgpu);
|
klondike_get_stats(klncgpu);
|
||||||
goto que;
|
goto que;
|
||||||
} else {
|
} else {
|
||||||
applog(LOG_ERR, "%s%i:%d late update (%d) reached - attempting reset",
|
applog(LOG_WARNING, "%s%i:%d late update (%d) reached - attempting reset",
|
||||||
klncgpu->drv->name, klncgpu->device_id,
|
klncgpu->drv->name, klncgpu->device_id,
|
||||||
dev, LATE_UPDATE_LIMIT);
|
dev, LATE_UPDATE_LIMIT);
|
||||||
control_init(klncgpu);
|
control_init(klncgpu);
|
||||||
@ -1332,7 +1341,7 @@ tryagain:
|
|||||||
if (temp <= KLN_COOLED_DOWN) {
|
if (temp <= KLN_COOLED_DOWN) {
|
||||||
klninfo->jobque[dev].overheat = false;
|
klninfo->jobque[dev].overheat = false;
|
||||||
rd_unlock(&(klninfo->stat_lock));
|
rd_unlock(&(klninfo->stat_lock));
|
||||||
applog(LOG_ERR, "%s%i:%d Overheat recovered (%.0fC)",
|
applog(LOG_WARNING, "%s%i:%d Overheat recovered (%.0fC)",
|
||||||
klncgpu->drv->name, klncgpu->device_id,
|
klncgpu->drv->name, klncgpu->device_id,
|
||||||
dev, temp);
|
dev, temp);
|
||||||
kln_enable(klncgpu);
|
kln_enable(klncgpu);
|
||||||
|
Loading…
Reference in New Issue
Block a user