1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-10 14:58:01 +00:00
Commit Graph

1314 Commits

Author SHA1 Message Date
Con Kolivas
d437de8428 Avoid calling get_statline on exit. 2013-10-11 15:58:29 +11:00
Con Kolivas
b5dfacef24 We are always dependent on libusb handling events so use the blocking libusb_handle_events in the polling thread and use a bool to know if we should continue polling. 2013-10-11 10:15:06 +11:00
Con Kolivas
853aa28ffc Merge branch 'master' into async
Conflicts:
	usbutils.c
2013-10-11 08:49:59 +11:00
Con Kolivas
2834eb8d6d Kill off threads that have failed using hash_sole_work instead of just disabling them. 2013-10-08 23:35:22 +11:00
Con Kolivas
f80c900336 Merge branch 'master' into async
Conflicts:
	api.c
	cgminer.c
	miner.h
	usbutils.c
	util.c
2013-10-08 20:46:36 +11:00
Con Kolivas
f8e28f251d Try switching pools if for some reason we end up with only idle pools and have ended up current_pool set to an idle one. 2013-10-08 20:42:36 +11:00
Con Kolivas
3b527f14d0 Check a pool is stable for >5 mins before switching back to it. 2013-10-08 20:41:13 +11:00
Con Kolivas
7318eceef9 Make the devlock a cglock in usbutils and only grab the write lock for fundamental changes allowing us to send and receive transfers concurrently without lock contention. 2013-10-07 23:34:01 +11:00
Con Kolivas
8c0ea19e13 Submitting an ntime offset nonce needs to be done on a copy of the work instead of the original so abstract out shared components as much as possible, minimising strdups in copy_work and make submit_work_async work take copied work, cleaning up code in the process. 2013-10-07 23:33:13 +11:00
Con Kolivas
b6a97de687 Provide a way for drivers to submit work that it has internally rolled the ntime value by returning the amount it has ntime rolled to be added. 2013-10-07 23:33:13 +11:00
ckolivas
6cd7f0f1be Remove unmaintained broken ztex driver. 2013-10-07 23:33:13 +11:00
Kano
51418f79e5 Klondike update code to current git 2013-10-07 23:33:11 +11:00
Con Kolivas
a6a9407067 Use asynchronous transfers for all bulk transfers, allowing us to use our own timers and cancelling transfers that take too long. 2013-10-07 23:31:20 +11:00
Con Kolivas
dbef95f77d Submitting an ntime offset nonce needs to be done on a copy of the work instead of the original so abstract out shared components as much as possible, minimising strdups in copy_work and make submit_work_async work take copied work, cleaning up code in the process. 2013-10-05 09:31:36 +10:00
Con Kolivas
4c79252dc8 Provide a way for drivers to submit work that it has internally rolled the ntime value by returning the amount it has ntime rolled to be added. 2013-10-04 21:39:42 +10:00
ckolivas
052e434846 Remove unmaintained broken ztex driver. 2013-10-04 12:00:41 +10:00
Kano
dc85abd9cd Klondike update code to current git 2013-10-03 23:19:18 +10:00
Con Kolivas
f49a3c7657 Merge branch 'master' into hashfast
Conflicts:
	Makefile.am
	api.c
	cgminer.c
	configure.ac
	miner.h
	usbutils.c
	usbutils.h
2013-09-30 08:43:29 +10:00
Con Kolivas
5e1ebd5070 Deuglify use of _PARSE_COMMANDS macro expansions. 2013-09-29 13:54:16 +10:00
ckolivas
2ec601e123 There is no need to get the external prototypes for drivers in cgminer.c any more. 2013-09-28 16:00:55 +10:00
ckolivas
f3294f7424 Remove unnecessary gpu_threads initialisation. 2013-09-28 15:18:08 +10:00
ckolivas
6d7471237d Use macro expansion to iterate over all device drivers without needing to explicitly code in support in all places. Pass a hotplug bool to the detect() function to prevent opencl trying to hogplug GPUs. 2013-09-28 15:11:06 +10:00
ckolivas
df54b76855 Add a noop function for driver detect when it's missing. 2013-09-28 13:52:13 +10:00
ckolivas
8875197466 Create a macro list of drivers to enable easier addition of further drivers. 2013-09-28 10:25:48 +10:00
Con Kolivas
7696f26a93 Abstract out work submission once it's been tested, to be used by drivers that do their own internal validity testing. 2013-09-26 21:18:33 +10:00
Con Kolivas
76e688aee1 Store the hash2 array in struct work for further reuse. 2013-09-26 21:14:14 +10:00
Con Kolivas
39c52b1fb4 Use the test_nonce function within submit_nonce and store the uint32 corresponding to hash2 37 for further use. 2013-09-26 20:58:47 +10:00
Con Kolivas
c1aba05506 Only set share diff if we've confirmed it's a share first. 2013-09-26 20:51:47 +10:00
Con Kolivas
9040cac924 restart_wait should return 0 if thr_restart is true. 2013-09-25 22:47:19 +10:00
Con Kolivas
759e82bb98 Add in first draft for a serialised work model sending/receiving data for BF1 devices. 2013-09-25 15:30:54 +10:00
Con Kolivas
2ab023f300 Add BF1 detection code to bitfury driver. 2013-09-24 21:55:47 +10:00
Kano
b1a3b012dd pool_active uninitialised_var rolltime 2013-09-22 23:16:21 +10:00
Con Kolivas
118f9038a0 Merge branch 'master' into hashfast 2013-09-22 20:18:18 +10:00
Con Kolivas
466d3beca0 Provide a --disable-libcurl config option to build support for stratum mining only. 2013-09-21 22:49:28 +10:00
Con Kolivas
45c8d60790 Add crc initialisation tables and helper functions for hashfast driver. 2013-09-19 17:34:26 +10:00
Con Kolivas
b224ad37eb Provide initial set up code and structure initialisation for hashfast device detection. 2013-09-19 12:34:00 +10:00
Con Kolivas
3777ed288d Add hashfast detection driver calls to cgminer startup. 2013-09-19 10:46:23 +10:00
Con Kolivas
48681dd4bb Reset quotas on load balance for all pools at the same time to avoid running out during selection and unintentionally dropping to fallback. 2013-09-16 12:40:11 +10:00
Con Kolivas
972d04d2a8 Break out of select pool from a common point for appropriate debug messages and to avoid further tests. 2013-09-16 12:26:01 +10:00
Con Kolivas
a76b09e4fc Find the greatest common denominator in quotas and use the smallest number of consecutive work items per pool in quota load balance mode to smooth hashrate across pools with large quotas. Give excess quota to priority pool 0 instead of pool 0. 2013-09-13 13:51:15 +10:00
Con Kolivas
8ac4fa202d Merge branch 'master' into quota 2013-09-13 13:05:47 +10:00
Con Kolivas
d4ac1915fa Avoid dynamically adding stack memory for nonce2 in the stratum send thread and check the pool's nonce2_len will not cause an overflow. 2013-09-13 09:34:45 +10:00
Con Kolivas
9cde575969 Merge branch 'master' into quota 2013-09-08 19:54:35 +10:00
Con Kolivas
89c07fa5c7 Add support for socks4/4a proxies with stratum, and drop back to socks4 support via the global --socks-proxy command to not break previous configurations. 2013-09-08 16:32:44 +10:00
Con Kolivas
a41660f2f0 Only show long-poll message in pool summary if it's not using stratum. 2013-09-08 10:30:18 +10:00
Con Kolivas
5b378f443a Increase the time for the waiting for work message to be given to be greater than that required for a pool swap in the scheduler which is set to 5s. 2013-09-08 10:30:08 +10:00
Con Kolivas
812f7541fd Change message in status when using a balanced pool strategy to notify if there's a stratum pool as well. 2013-09-08 10:29:58 +10:00
Con Kolivas
26a8a8e2c6 Use the --failover-only flag to have special meaning in combination with load-balance mode to distribute any unused quota back to pool 0 to maintain ratios amongst other pools. 2013-09-08 10:09:26 +10:00
Con Kolivas
c325e7ae45 Only show long-poll message in pool summary if it's not using stratum. 2013-09-07 19:02:38 +10:00
Con Kolivas
7d2c31e28a Display quota and allow it to be modified via the pool menu. 2013-09-07 19:01:13 +10:00
Con Kolivas
e8a1c9ebd1 Increase the time for the waiting for work message to be given to be greater than that required for a pool swap in the scheduler which is set to 5s. 2013-09-07 15:41:07 +10:00
Con Kolivas
ea4a1ff98f Change message in status when using a balanced pool strategy to notify if there's a stratum pool as well. 2013-09-07 15:36:48 +10:00
Con Kolivas
77b3b185b2 Add quota support to configuration files. 2013-09-07 15:29:18 +10:00
Con Kolivas
ea7b2a7da3 Rotate pools on all failures to set a pool in select_pool. 2013-09-07 12:14:16 +10:00
Con Kolivas
7c19984fd6 Use quotas for load-balance pool strategy. 2013-09-07 12:12:24 +10:00
Con Kolivas
0121b75a4e Provide a mechanism for setting a pool quota to be used by load-balance. 2013-09-07 11:33:07 +10:00
Con Kolivas
770556cdec Use the --socks-proxy option with stratum, changing it to defaulting to socks5 and give appropriate message should it fail to connect. 2013-09-07 09:39:03 +10:00
Con Kolivas
8ede407df7 Make extract_sockaddr set variables passed to it rather than pool struct members. 2013-09-05 23:10:19 +10:00
Con Kolivas
5bf9856a4a take_queued_work_bymidstate should use a write lock. 2013-09-03 11:38:58 +10:00
Kano
76185ede38 API mcast add a description option with miner.php 2013-09-01 00:23:26 +10:00
Con Kolivas
1d5d28d7fb Skip dissecting opt->names in parse_config if it doesn't exist. 2013-08-31 21:36:15 +10:00
ckolivas
0f42fd3f46 Remove unused HAVE_LISBUSB macro and use USE_USBUTILS everywhere. 2013-08-30 15:38:35 +10:00
Con Kolivas
572df10207 Provide a funcion that looks up queued work by midstate and then removes it from the device hash database. 2013-08-27 20:29:47 +10:00
Con Kolivas
ab917082fc Only count submitted nonces as diff1shares if they're valid. 2013-08-25 10:53:06 +10:00
Kano
febcc53d99 Update the API Multicast documentation 2013-08-23 16:34:42 +10:00
Kano
14ac6fa5ab Initial API Multicast response v0.1 to find cgminer APIs 2013-08-22 21:31:32 +10:00
Con Kolivas
b9aa5b6528 Check for cnx_needed on each loop through wait_lp_current. 2013-08-21 20:31:10 +10:00
Con Kolivas
919a836f14 Return positive for cnx_needed when no_work is true. 2013-08-21 20:29:46 +10:00
Con Kolivas
7dbe4bbeb3 Stratum is used more often so test for it first. 2013-08-21 20:12:00 +10:00
Con Kolivas
a52ec336bf Reorder support names alphabetically. 2013-08-21 20:09:17 +10:00
ckolivas
77f9400ca2 Only display the no pool work message once if there are multiple waiters in hash_pop 2013-08-21 12:15:40 +10:00
ckolivas
20de9226fd Provide a message and set a bool when no work is available from any pools and when it resumes again. 2013-08-21 11:21:13 +10:00
ckolivas
0e43084c09 We don't want to continue into the hash_pop function if the getq is frozen. 2013-08-21 11:05:21 +10:00
ckolivas
cbea0a5306 Only report threads in and out in queued work devices across a get work since the rest happens asynchronously and the get work is what the device might be waiting on. 2013-08-21 10:56:31 +10:00
ckolivas
b12badc9f2 Thread reportin and out can be static non inline. 2013-08-21 10:47:32 +10:00
Con Kolivas
ee2a5ae8f4 TimeBeginPeriod and TimeEndPeriod do not add significant overhead when run the entire time for cgminer so avoid trying to maintain balanced numbers of them for specific time calls to simplify code. 2013-08-20 20:46:09 +10:00
Con Kolivas
eeac9d81fc Replace all references to the old n*sleep functions with the equivalent cgsleep_*s replacements. 2013-08-20 19:23:49 +10:00
Con Kolivas
78d78b1063 Import Aaron D. Gifford's fast sha256 implementation. 2013-08-19 19:10:41 +10:00
Con Kolivas
a61e41a070 Check for thr->work_restart in restart_wait. 2013-08-19 15:58:22 +10:00
Con Kolivas
98e338cc52 Provide a variant of find_work_bymidstate that returns a clone of the found work. 2013-08-14 23:05:13 +10:00
Con Kolivas
e95ad0479f Nonce2 stratum submission is not working with nonce2 lengths >4, revert the buggy __bin2hex function and use bin2hex. 2013-08-13 22:44:22 +10:00
Con Kolivas
1d614599a7 Add room for the null byte at the end of the nonce2 string on stratum share submission and zero the allocated ram. 2013-08-13 14:35:35 +10:00
Con Kolivas
c8aac74114 Only perform the bin2hex on nonce2 data if it's required for stratum submission, thereby removing the last conversion of that type from stratum work generation. 2013-08-13 06:09:42 +10:00
Con Kolivas
87ae66c7e6 Create a work data template when receiving stratum notification, allowing a simple memcpy of the merkle root avoiding more hex2bin conversions on each work generation. 2013-08-13 05:49:32 +10:00
Con Kolivas
34bc106d82 Export the workpadding char in miner.h 2013-08-13 04:57:04 +10:00
Con Kolivas
46b6b07afa Avoid a potential overflow should a pool specify a large nonce2 length with stratum. 2013-08-12 16:02:20 +10:00
Con Kolivas
0379123bc1 Avoid one more hex2bin in gen stratum work. 2013-08-12 15:32:45 +10:00
Con Kolivas
11bcf2b3fb Rename work gbt_coinbase to coinbase to be in line with pool variable name. 2013-08-12 11:40:17 +10:00
Con Kolivas
5237bf350d Perform merkle bin hex2bin on stratum notify to avoid doing it on each work generation. 2013-08-12 11:36:28 +10:00
Con Kolivas
8bc469e916 Reuse just the one pool coinbase variable in stratum, avoiding more string functions and storage in gen_stratum_work on each work generation. 2013-08-12 11:16:46 +10:00
Con Kolivas
8c8ef6ff9b Rename pool gbt_coinbase variable to coinbase to combine it with the stratum coinbase data. 2013-08-12 10:58:43 +10:00
Con Kolivas
c542e47aa3 Use a nonce2 offset variable for both gbt and stratum to consolidate requirements on work generation. 2013-08-12 10:49:38 +10:00
Con Kolivas
fb94dfa098 Cache as much of the gbt coinbase as possible to avoid doing unnecessary hex2bin conversion on every work generation with gbt. 2013-08-12 01:15:22 +10:00
Con Kolivas
a1052188fd We should be using a cg_wlock initially in generating stratum and gbt work before downgrading the lock. 2013-08-12 00:27:22 +10:00
Con Kolivas
b423fe9de8 Cache the hex2bin of pool nonce1 in stratum, avoiding hex2bin on each work generation. 2013-08-11 14:06:17 +10:00
Con Kolivas
fef649dfef Cache the binary generation of coinbase1 and 2 on stratum, avoiding a hex2bin of coinbase1 and 2 on each work generation. 2013-08-11 13:47:46 +10:00
Con Kolivas
580b77b757 Fix warning. 2013-08-09 21:52:54 +10:00
Con Kolivas
106e461f21 Recreate curses windows on windows when a device is hotplugged to allow window resizing without crashing. 2013-08-09 16:57:16 +10:00
Con Kolivas
2b171f7fae Limit intensity range according to whether scrypt is in use or not. 2013-08-09 15:12:57 +10:00
Con Kolivas
cb6d62de08 Do not allow benchmark mode to be used with scrypt. 2013-08-09 06:48:59 +10:00
Con Kolivas
d71e9f91f4 Add a --bflsc-overheat command which allows you to set the throttling temperature for BFLSC devices or disable it. 2013-08-09 06:43:25 +10:00
Con Kolivas
812852cc36 Move bflsc defines to a header file. 2013-08-09 06:31:57 +10:00
kanoi
8dc0935639 Merge pull request #467 from someone42/master
Support for BitBurner boards
2013-08-05 01:18:51 -07:00
Olivier Langlois
c31ff57277 remove unnecessary memcpy
The next operation is flipping the merkleroot on the same
destination.

Signed-off-by: Olivier Langlois <olivier@olivierlanglois.net>
2013-07-29 23:53:20 -04:00
Chris Chua
dc4ca0de97 using more concise description 2013-07-30 00:15:45 +10:00
Chris Chua
b0f4d55be7 changes to Avalon driver for BitBurner boards 2013-07-29 21:39:29 +10:00
Kano
a8c974f5f1 set device_drv function noops when first add_cgpu 2013-07-18 08:51:08 +10:00
Kano
a9e10988ed force type checking on curses 2013-07-06 22:08:17 +10:00
Kano
74d71cce2c cgminer - size check all sprintf 2013-07-06 20:47:49 +10:00
Kano
ad1572f77f size check get_datestamp/get_timestamp and remove unused cgpu->init 2013-07-06 20:17:17 +10:00
Kano
385a70bea7 make all statline overflow safe 2013-07-06 19:15:59 +10:00
Kano
df05174e1d WU only needs +2 width 2013-07-05 18:26:18 +10:00
Con Kolivas
42d96ee7fe Convert the decay_time function into one that truly creates an exponentially decaying average over opt_log_interval. 2013-07-02 20:41:44 +10:00
Con Kolivas
065b6a5e36 Provide an --avalon-freq command line to give a valid range of frequencies for avalon in auto mode. 2013-07-01 15:38:15 +10:00
Con Kolivas
f142a4de23 Allow the avalon fanspeed range to be passed as parameter on the command line, default to 20-100% 2013-07-01 10:41:22 +10:00
Con Kolivas
1b81ecf932 Just display A: and R: for difficulty accepted and rejected to preserve screen real estate and decrease decimal places for WU. 2013-06-30 15:51:46 +10:00
Kano
a94b7be3bc correct device DR: and remove global U: 2013-06-29 08:41:22 +10:00
Kano
800dc24916 Update all screen A/R to instead use DA/DR and device U to WU 2013-06-29 01:43:18 +10:00
Con Kolivas
e811c4dc77 Add an avalon-auto option which enables dynamic overclocking based on hardware error rate for maximum effective hashrate. 2013-06-26 00:15:04 +10:00
Con Kolivas
9b45daba6b Add an --avalon-cutoff feature which puts the avalon idle should it reach this temperature, defaulting to 60, re-enabling it when it gets to target temperature. 2013-06-25 19:39:42 +10:00
Con Kolivas
661a448ad8 Fix build warning. 2013-06-24 12:47:04 +10:00
Con Kolivas
1fca632f7c Add an --avalon-temp option to allow a user specified target temperature. 2013-06-24 11:04:02 +10:00
Con Kolivas
2ab7dac243 Demote the invalid nonce warning to log info. 2013-06-23 17:03:59 +10:00
Con Kolivas
94e636a906 Only update hashmeter if we have done hashes or haven't updated longer than the log interval, fixing a us/ms error. 2013-06-21 17:02:13 +10:00
Con Kolivas
ccfa893577 Increase watchdog sick time to longer than it takes for a pool to be detected dead. 2013-06-19 13:20:25 +10:00
Kano
e300e50281 disable curses device resize that crashes on windows 2013-06-19 11:59:28 +10:00
Con Kolivas
e0c4d35b28 Multiplier fail for microseconds vs milliseconds when updating hashmeter in hash_queued_work. 2013-06-18 20:59:45 +10:00
Con Kolivas
6eb7f6226a Only make threads report in/out across the actual driver code and update their status on reporting out as well as in. 2013-06-18 20:30:48 +10:00
Con Kolivas
7014bd6b8b Difficulty should be unconditionally byteswapped, not swapped to big endian. 2013-06-17 21:20:36 +10:00
Kano
7eba963477 remove varargs from logging/quit/in general as much as possible 2013-06-15 22:03:56 +10:00
Con Kolivas
6789c96fd4 Off by one error in device count for display. 2013-06-15 01:37:00 +10:00
Con Kolivas
994c0245c0 Don't display devices beyond the most_devices count in the curses status. 2013-06-15 01:31:37 +10:00
Con Kolivas
cd9ff7f6b8 Only display as many device rows as the maximum live existed at any time. 2013-06-15 01:28:00 +10:00
Kano
7ad9132bbe usb lock out use cg locks 2013-06-15 01:02:27 +10:00
Kano
ad30d41f79 usb lock out transfers during open/close 2013-06-14 23:48:03 +10:00
Con Kolivas
42891f07a7 Merge pull request #444 from zenwheel/master
Compile UNIX conditionals on Mac OS X
2013-06-13 16:59:06 -07:00
ckolivas
465ca14236 Only show efficiency in pool information for pools that don't support local work generation. 2013-06-14 09:57:05 +10:00
ckolivas
9aeed2f992 Create a pool_localgen bool function for testing when a pool can generate work locally. 2013-06-14 09:56:22 +10:00
Scott Jann
16587dd7c1 compile unix code on Mac OS X
fixes not finding the config file in $HOME
2013-06-13 18:50:50 -05:00
Kano
84ffcbc51b Use mining start time for device MH/U calculations 2013-06-14 01:09:50 +10:00
Con Kolivas
24398bde03 cgsem_post after creating the thread info 2013-06-09 16:38:57 +10:00
ckolivas
9b2e517f30 Use cgsem structures instead of the flaky pings in the work queue to start mining threads and remove the unused thr_info_freeze function. 2013-06-09 12:20:04 +10:00
ckolivas
b59c33800b Implement cgminer specific cgsem semaphores to imitate unnamed semaphore behaviour on osx which does not support them. 2013-06-06 13:08:00 +10:00
Con Kolivas
dd5788762f Fix build for !curses 2013-06-04 21:49:28 +10:00
Con Kolivas
03305afbae Remove start device limitation on log window size to allow it to get larger with hotplugged devices. 2013-06-03 16:49:15 +10:00
Con Kolivas
fc95c19165 Switch logsize after hotplugging a device. 2013-06-03 16:38:40 +10:00
Con Kolivas
cc9223f041 Change switch_compact function name to switch_logsize to be used for other changes. 2013-06-03 16:37:56 +10:00
Con Kolivas
514491bd0e Only adjust cursor positions with curses locked. 2013-06-03 16:01:20 +10:00
Kano
12045aae55 devs display - fix GPU duplicate bug 2013-06-03 12:26:50 +10:00
Con Kolivas
5f2c4f13f9 Do not hotplug enable a device if devices have been specified and the hotplug device falls outside this range. 2013-06-03 11:28:18 +10:00