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

539 Commits

Author SHA1 Message Date
Peter Stuge
318ef85a9f Require pkg-config to find libusb-1.0, and fix libusb.h #includes 2012-11-25 05:42:42 +01:00
Con Kolivas
8bc60506c5 Revert "Find libusb-1.0 with pkg-config except on mingw, and fix #include path"
This reverts commit ce72dbea7d.
2012-11-25 09:47:26 +11:00
nelisky
c93e5e95cd openwrt needs roundl 2012-11-24 13:11:46 -08:00
Con Kolivas
217be6ed98 Do away with the flaky free_work api in the driver code which would often lose the work data in opencl and simply flush it before exiting the opencl scanhash. 2012-11-25 00:37:46 +11:00
Con Kolivas
2d35ac2567 Track all dynamically allocated memory within the work struct by copying work structs in a common place, creating freshly allocated heap ram for all arrays within the copied struct.
Clear all work structs from the same place to ensure memory does not leak from arrays within the struct.
Convert the gbt coinbase and stratum strings within the work struct to heap ram.
This will allow arbitrary lengths without an upper limit for the strings, preventing the overflows that happen with GBT.
2012-11-24 10:47:20 +11:00
Peter Stuge
ce72dbea7d Find libusb-1.0 with pkg-config except on mingw, and fix #include path 2012-11-21 19:56:05 +01:00
Con Kolivas
e55ef04df6 Revert "Find libusb-1.0 using pkg-config and correct the libusb.h #include path"
This reverts commit 171c3d0c72.

Rollback breakage.
2012-11-18 23:44:08 +11:00
Con Kolivas
9ad02fe303 Support workid for block submission on GBT pools that use it. 2012-11-18 21:48:44 +11:00
Peter Stuge
171c3d0c72 Find libusb-1.0 using pkg-config and correct the libusb.h #include path 2012-11-16 00:26:55 +01:00
Con Kolivas
b3864d1a94 Support for fractional diffs and the classic just-below-1 share all FFs diff target. 2012-11-15 09:18:58 +11:00
Con Kolivas
598ee76d37 Hash1 is only used by the deprecated cpu mining code and never changes so remove it from the work struct and bypass needing to process the value for all other mining. 2012-11-11 09:51:37 +11:00
Con Kolivas
6893c0be43 Get a work item once per second for all getwork and GBT pools to test they're still alive and to maintain a current GBT template. 2012-11-07 23:28:49 +11:00
Con Kolivas
a8e1ebb11c Add endian swap defines for where missing. 2012-11-06 12:01:49 +11:00
Con Kolivas
10ea5fbf97 Use existing pool submit_old bool from gbt data. 2012-11-05 16:57:48 +11:00
Con Kolivas
f71b423080 Retrieve a new block template if more than 30 seconds has elapsed since the last one to keep the data current and test the pool is still alive. 2012-11-05 16:48:19 +11:00
Con Kolivas
85f400bf80 Correct last few components of GBT block generation courtesy of Luke-jr. 2012-11-05 15:57:47 +11:00
Con Kolivas
a4e78be1ed Flip all 80 bytes in the flip function which was wrongly named flip256 for its purpose. 2012-11-05 14:56:57 +11:00
Con Kolivas
0ba5f0f94b Use a standard function for flipping bytes. 2012-11-05 14:02:43 +11:00
Con Kolivas
88b6f7924c Make gbt_coinbase large enough for submissions, swap bytes correctly to make a header from GBT and encode the number of transactions in share submission. 2012-11-04 18:01:09 +11:00
Con Kolivas
889ed23934 Store the fixed size entries as static variables in GBT in binary form, byteswapping as is required. 2012-11-04 15:28:13 +11:00
Con Kolivas
6b34faf83c Construct block for submission when using GBT. 2012-11-04 10:24:09 +11:00
Con Kolivas
c5c5fb8273 Store all the transaction hashes in pool->txn_hashes instead of separating txn0 and correct generation of merkle root, fixing memory overwrites. 2012-11-04 08:35:50 +11:00
Con Kolivas
875ca0fcc6 Create extra work fields when generating GBT work. 2012-11-04 01:07:01 +11:00
Con Kolivas
cbc246eace Generate the merkle root for gbt work generation. 2012-11-03 19:45:37 +11:00
Con Kolivas
8d0f748246 Create a store of the transactions with GBT in the minimum size form required to generate work items with a varied coinbase. 2012-11-03 13:27:41 +11:00
Con Kolivas
4a72a1574f Create a function that generates a GBT coinbase from the existing pool variables. 2012-11-01 22:34:08 +11:00
Con Kolivas
813e814f6c Extract and store the various variables GBT uses when decoding gbt work. 2012-11-01 16:56:54 +11:00
Con Kolivas
d10699d4c3 Add a gbt mutex within the pool struct for protecting the gbt values. 2012-11-01 14:24:55 +11:00
Con Kolivas
8afc1f6512 Convert work decode function to prepare for decoding block templates. 2012-11-01 14:05:25 +11:00
Con Kolivas
1c456d4fb3 Check for GBT support on first probing the pool and convert to using the GBT request as the rpc request for that pool. 2012-11-01 13:53:12 +11:00
Con Kolivas
f4cc59f25f Make the rpc request used with getwork a pool variable to allow it to be converted to/from gbt requests. 2012-11-01 13:06:34 +11:00
ckolivas
a2d5783509 server and client sockaddr_in are no longer used in struct pool. 2012-10-30 16:45:27 +11:00
Con Kolivas
e575763a80 Avoid redefining macros and align to 4 byte boundaries. 2012-10-22 22:06:00 +11:00
Con Kolivas
17251795c3 Merge pull request #319 from kanoi/mmq
MMQ new initialisation (that works) and clocking control
2012-10-17 14:09:15 -07:00
Kano
fc14b2ee07 MMQ new initialisation (that works) and clocking control 2012-10-17 09:56:42 +11:00
Con Kolivas
7adb7a30e6 Display correct share hash and share difficulty with scrypt mining. 2012-10-15 23:10:24 +11:00
Con Kolivas
7450b25e75 Dramatically simplify the dynamic intensity calculation by oversampling many runs through the opencl kernel till we're likely well within the timer resolution on windows. 2012-10-14 12:07:27 +11:00
Con Kolivas
420fdf32d6 Display the actual share diff next to the pool required diff, using a suffix creation function to prevent values of >1000 being shown in their entirety. 2012-10-12 14:17:29 +11:00
Con Kolivas
d15c70f8a8 Fix wrong byteswap macro being used on mingw32 which was breaking target generation on stratum. 2012-10-12 11:30:35 +11:00
Con Kolivas
a977fa4766 Fix lack of htobe64 on mingw32. 2012-10-11 20:53:56 +11:00
Con Kolivas
4fbc570fa4 Reinstate the history on dynamic intensity mode to damp fluctuations in intensity but use an upper limit on how much the value can increase at any time to cope with rare overflows. 2012-10-11 20:30:47 +11:00
Con Kolivas
0a90207111 Merge branch 'master' into stratum 2012-10-07 13:22:17 +11:00
Con Kolivas
aa35fbcc9a Fix sign warning in ocl.c 2012-10-07 10:21:20 +11:00
Con Kolivas
40b747bae6 Put scrypt warning on separate line to avoid 0 being shown on windows as bufsize. 2012-10-07 10:08:45 +11:00
Con Kolivas
a8d693029a Move stratum sockets to curl infrastructure with locking around send+recv to begin support for proxies and ssl. 2012-10-05 12:37:29 +10:00
Con Kolivas
deb0a9b644 Windows doesn't work with MSG_PEEK on recv so move to a continuously updating buffer for incoming messages. 2012-10-04 23:18:33 +10:00
Con Kolivas
c113534feb Begin support for mingw stratum build.
Conflicts:
	configure.ac
2012-10-04 17:52:35 +10:00
Con Kolivas
2fae906440 Don't try to parse unneeded parameters in response to mining.subscribe. 2012-10-03 21:10:30 +10:00
Con Kolivas
284b786da7 Check the stratum pool difference has not changed compared to the work diff when testing whether a share meets the target or not and retarget if necessary. 2012-10-03 11:18:08 +10:00
Con Kolivas
fdaabf59c6 Make target on stratum scale to any size by clearing sequential bits according to diff. 2012-10-03 00:35:08 +10:00
Con Kolivas
2941febd05 Store a sockaddr url of the stripped url used in determining sockaddr to not confuse it with the stratum url and fix build warnings. 2012-10-02 00:00:55 +10:00
Con Kolivas
b97a33a58a Use statically allocated stratum strings in struct work to cope with the inability to safely deallocate dynamically allocated ram. 2012-10-01 14:44:44 +10:00
Con Kolivas
7415d7aaa0 Begin implementing a hash database of submissions and attempt sending results. 2012-09-29 16:10:13 +10:00
Con Kolivas
aa93fa336c Copy parameters from stratum work required for share submission. 2012-09-29 15:02:23 +10:00
Con Kolivas
ac47f7f3a6 Store and display stripped url in its own variable. 2012-09-29 14:16:16 +10:00
Con Kolivas
3db6fb4fac Create machinery to divert work requests to stratum. 2012-09-29 13:07:00 +10:00
Con Kolivas
1f6fe55152 Generate the coinbase for generation of stratum based work. 2012-09-29 02:16:22 +10:00
Con Kolivas
1f64491f62 The number of transactions is variable so make merkle a variable length dynamically allocated array and track how many there are for stratum. 2012-09-29 01:48:01 +10:00
Con Kolivas
1221a80d41 Rename nonce2 to n2size reflecting that it's a size variable and not the actual nonce. 2012-09-29 01:03:23 +10:00
Con Kolivas
56255a0c86 Create a stratum thread per pool that has stratum that monitors the socket and serves received data. 2012-09-28 18:01:33 +10:00
Con Kolivas
9d4a44e88e Create helper functions for duplicating json strings to avoid keeping json references in use. 2012-09-28 09:57:42 +10:00
Con Kolivas
a6f1a62220 Create helper functions for checking when a socket is ready to read on and receive a single line at a time.
Begin stratum authorisation process.
2012-09-28 04:35:16 +10:00
Con Kolivas
64df34cd4e Create a stratum work structure to store current work variables. 2012-09-27 13:26:09 +10:00
Con Kolivas
f6f43500c0 Detect stratum in common place when adding urls, and use a bool to tell us when it's active. 2012-09-27 09:06:56 +10:00
Con Kolivas
e3f1b02e9a Extract and store various parameters on stratum init confirming successful mining notify. 2012-09-26 16:49:51 +10:00
Con Kolivas
58873c1dfa Get detailed addressinfo from the parsed URL for future raw socket usage when possible. IPV4 only for now. 2012-09-25 20:23:59 +10:00
Con Kolivas
144a016097 Add data structures to pool struct for socket communications. 2012-09-24 16:50:04 +10:00
Kano
7c32562d80 API stats add some pool getwork difficulty stats 2012-09-24 11:34:50 +10:00
Con Kolivas
57a73dce34 Test for sequential getwork failures on a pool that might actually be up but failing to deliver work as we may end up hammering it repeatedly by mistake. 2012-09-24 08:30:07 +10:00
Con Kolivas
3243b91e2d Merge pull request #310 from kanoi/master
API debug, API-README, API Correct diff1 name, Device diff1, API diff1 etc.
2012-09-20 23:23:15 -07:00
Con Kolivas
618999026f As we average gpu time over 5 work intervals for dynamic GPU intensity, there is no need to maintain a rolling average and it avoids the potential long term corruption of a single overflow value. 2012-09-21 16:10:34 +10:00
Kano
a6bf276f6b API - Add last share difficulty for devices and pool 2012-09-19 01:14:43 +10:00
Kano
89b6989fb3 Store and report Accepted,Rejected,Stale difficulty in the summary and API 2012-09-19 00:54:55 +10:00
Kano
923b9e0d86 Calculate work difficulty for each getwork and display with WorkTime debug 2012-09-18 11:19:57 +10:00
Kano
796f3906c1 WorkTime - multiple nonce per work and identify the work source 2012-09-16 07:57:43 +10:00
Kano
bd3c98aaaf Optional WorkTime details with each Accepted/Rejected work item 2012-09-15 14:04:57 +10:00
Kano
99f0607fb2 API add display of and setting queue,scantime,expiry 2012-09-12 23:26:43 +10:00
Kano
cef9731fbc CURL support for individual proxy per pool and all proxy types 2012-09-12 07:44:00 +10:00
Kano
307d8da034 HW: error counter auto for all devices - ztex code not fixed 2012-09-04 15:57:11 +10:00
Kano
9487ba05cd API/BFL identify a device - currently only BFL to flash the led 2012-09-04 12:52:11 +10:00
Kano
7a2407f15c BFL add throttle count to internal stats + API 2012-09-04 02:26:17 +10:00
Kano
4023872b76 count device diff1 shares 2012-09-01 23:51:51 +10:00
Kano
a178039a65 miner.h max_hashes -> int64_t 2012-08-30 23:22:37 +10:00
Con Kolivas
3acc064be3 Merge pull request #306 from kanoi/api
Pools: add RollTime info to API 'stats' and 'Stats' button in miner.php (to display it)
2012-08-23 07:50:28 -07:00
Con Kolivas
618b3e8b11 Track queued and staged per pool once again for future use. 2012-08-23 23:50:38 +10:00
Kano
d5f485c517 Pools: add RollTime info to API 'stats' and 'Stats' button in miner.php 2012-08-23 19:20:12 +10:00
ckolivas
edd9b81622 Do not add time to dynamic opencl calculations over a getwork. 2012-08-22 10:07:20 +10:00
Kano
b3e9858c9f API new command 'coin' with mining information 2012-08-20 16:07:20 +10:00
Kano
9210abdf60 API V1.17 show Work Utility and Diff1 Shares 2012-08-19 15:09:45 +10:00
Con Kolivas
26ab7346e3 Implement a new pool strategy, BALANCE, which monitors work performed per pool as a rolling average every 10 minutes to try and distribute work evenly over all the pools.
Do this by monitoring diff1 solutions to allow different difficulty target pools to be treated equally, along with solo mining.
Update the documentation to describe this strategy and more accurately describe the load-balance one.
2012-08-18 15:27:53 +10:00
Con Kolivas
d8c76bbd08 Getwork fail was not being detected. Remove a vast amount of unused variables and functions used in the old queue request mechanism and redefine the getfail testing. 2012-08-18 11:26:11 +10:00
Con Kolivas
c3e32274ee Cull all the early queue requests since we request every time work is popped now. 2012-08-18 10:37:05 +10:00
Con Kolivas
5fadfdb219 Overlap queued decrementing with staged incrementing. 2012-08-18 10:37:05 +10:00
Con Kolivas
611f1cec7c Roll work whenever we can on getwork. 2012-08-18 10:37:05 +10:00
Con Kolivas
fd0be1bb51 Queue requests for getwork regardless and test whether we should send for a getwork from the getwork thread itself. 2012-08-18 10:37:04 +10:00
Con Kolivas
2480cf23cc Don't try to get bitforce temperature if we're polling for a result to minimise the chance of interleaved responses. 2012-08-15 10:54:38 +10:00
Con Kolivas
8745ba1e6d Windows' timer resolution is limited to 15ms accuracy. This was breaking dynamic intensity since it tries to measure below this.
Since we are repeatedly sampling similar timeframes, we can average the gpu_us result over 5 different values to get very fine precision.
2012-08-15 09:38:45 +10:00
Kano
95dff7363e API allow display/change failover-only setting 2012-08-14 12:54:27 +10:00
Con Kolivas
8aa61f6626 Make sure we have work from the current pool somewhere in the queue in case the queue is full of requests from a pool that has just died. 2012-08-11 16:47:49 +10:00
Con Kolivas
8085ae6854 Further simplify the queue request mechanism. 2012-08-11 14:04:55 +10:00
Con Kolivas
3576abf8a7 Make pool_disabled the first in the enums == 0, fixing the pool enabled count which compares if value is not enabled before enabling it. 2012-08-05 15:43:27 +10:00
Con Kolivas
fc44b6d7a1 Use different variables for command line specified lookup gap and thread concurrency to differentiate user defined versus auto chosen values. 2012-08-05 15:32:44 +10:00
Con Kolivas
bf9c324752 The queueing mechanism has become a complex state machine that is no longer predictable. Rewrite it from scratch watching only current queues in flight and staged work available on a pool by pool basis. 2012-08-05 13:40:46 +10:00
Con Kolivas
b70ec3cb66 Merge pull request #283 from kanoi/icarus
ICA support 57600 baud rate, up to 8 FPGA and partial working FPGA boards
2012-08-02 17:17:53 -07:00
Con Kolivas
7fa794a499 It is not critical getting the temperature response in bitforce so don't mandatorily wait on the mutex lock. 2012-08-03 09:26:43 +10:00
Kano
e067be421a ICA support 57600 baud rate, up to 8 FPGA and partial working FPGA boards 2012-08-01 22:50:30 +10:00
Con Kolivas
c91148f193 Remove the low hash count determinant of hardware being sick. A low hash rate can be for poor network connectivity or scrypt mining, neither of which are due to sick hardware. 2012-07-30 09:02:23 +10:00
Con Kolivas
500ed85bb3 Merge pull request #271 from luke-jr/cg_logfixes
Logging bugfixes
2012-07-29 03:46:49 -07:00
Con Kolivas
e87ff7c177 Keep a counter of enabled pools and use that instead of iterating over the pool list. Use that value to ensure we don't set the last remaining active pool to the rejecting state. 2012-07-29 13:15:39 +10:00
Con Kolivas
9a6c082ad1 Make the thread concurrency and lookup gap options hidden on the command line and autotune parameters with a newly parsed --shaders option. 2012-07-24 20:27:37 +10:00
Luke Dashjr
da4ff2bde1 Bugfix: Use a mutex to control non-curses output
Without this, there is no guarantee writes won't overlap (and it happens quite a bit on Windows with the bitforce driver)
2012-07-23 20:29:06 +00:00
Luke Dashjr
d98e561a0a Simplify code to a single vprintf path for curses-less printing 2012-07-23 20:29:02 +00:00
Luke Dashjr
80593c47fc Move opt_quiet check to my_log_curses, so it works for curses-less builds 2012-07-23 20:28:57 +00:00
Con Kolivas
89eb1fa393 Check the maximum allocable memory size per opencl device. 2012-07-23 17:41:31 +10:00
Con Kolivas
17dfe74f96 Allow intensities up to 20 if scrypt is compiled in. 2012-07-22 00:49:47 +10:00
Con Kolivas
39f7d2fa74 Allow lookup gap and thread concurrency to be passed per device and store details in kernel binary filename. 2012-07-21 17:31:06 +10:00
Con Kolivas
6ac14f4280 Don't enqueuewrite buffer at all for pad8 and pass work details around for scrypt in dev_blk. 2012-07-16 13:14:21 +10:00
Con Kolivas
0f43eb5eb7 Don't test nonce with sha and various fixes for scrypt. 2012-07-13 20:35:44 +10:00
Con Kolivas
b085c338f6 Make scrypt buffers and midstate compatible with cgminer. 2012-07-13 20:28:36 +10:00
Con Kolivas
dd740caa98 Provide initial support for the scrypt kernel to compile with and mine scrypt with the --scrypt option. 2012-07-13 19:02:43 +10:00
Con Kolivas
5a65415b1e Enable completely compiling scrypt out. 2012-07-13 14:47:02 +10:00
Con Kolivas
176cdf8bbc Begin import of scrypt opencl kernel from reaper. 2012-07-13 14:44:52 +10:00
Con Kolivas
c1c99f1dd2 Merge https://github.com/pshep/cgminer into pshep 2012-07-12 23:09:05 +10:00
Paul Sheppard
d4d5b28e5f Abbrv. correction 2012-07-11 14:46:09 -07:00
Luke Dashjr
c57c308d1f Bugfix: Don't declare devices SICK if they're just busy initializing
This mainly applies to ModMiner since it takes 4-5 minutes to upload the bitstream
2012-07-11 20:29:06 +00:00
Paul Sheppard
5f0a22d230 Remove superfluous ave_wait 2012-07-11 08:32:41 -07:00
Paul Sheppard
2c54522d7d Add average wait time to api stats 2012-07-11 08:11:53 -07:00
Paul Sheppard
01a69ee45e Revert "Merge branch 'ave_time' of https://github.com/pshep/cgminer.git"
This reverts commit 242e52cdf9, reversing
changes made to 4dc1bf2319.
2012-07-11 08:07:39 -07:00
ckolivas
5c7e03084a Modify te scanhash API to use an int64_t and return -1 on error, allowing zero to be a valid return value. 2012-07-11 22:59:58 +10:00
Paul Sheppard
3cc0aa76ad Add average return time to api stats 2012-07-10 15:34:01 -07:00
Paul Sheppard
953ecd9e6a Change timeouts to time-vals for accuracy. 2012-07-08 23:25:02 -07:00
Con Kolivas
2ce7f28bbc Merge pull request #254 from luke-jr/work_restart2
Turn work_restart array into a bool in thr_info
2012-07-08 04:24:55 -07:00
Con Kolivas
fd55fab96a Make bitforce nonce range support a command line option --bfl-range since enabling it decrease hashrate by 1%. 2012-07-06 16:54:00 +10:00
Luke Dashjr
d4af2d0535 Turn work_restart array into a bool in thr_info 2012-07-06 05:13:05 +00:00
Con Kolivas
3271be145f Provide a ms based sleep function that uses nanosleep to avoid the inaccuracy of usleep on SMP systems. 2012-07-06 15:01:39 +10:00
Con Kolivas
75eca07823 Restart_wait is only called with a ms value so incorporate that into the function. 2012-07-05 09:15:21 +10:00
Con Kolivas
e5aba76042 Fix off-by-one error in nonce increment in bfl. 2012-07-05 00:40:01 +10:00
Con Kolivas
6314a12b31 Initially enable support for nonce range support on bfl, splitting nonces up into 3/4 size and only disable it if it fails on work submit. 2012-07-04 23:53:55 +10:00
Con Kolivas
96fba30b6b Attempt to detect nonce range support in BFL by sending work requring its support. 2012-07-04 17:31:02 +10:00
Kano
ff0afb94ec Add API Notify counter 'Comms Error' 2012-07-03 13:14:30 +10:00
Con Kolivas
732783faa6 Merge branch 'bfl'
Conflicts:
	miner.h
2012-07-03 11:35:58 +10:00
Con Kolivas
2ec0fb9793 Merge pull request #247 from kanoi/master
api.c data structure + updated get_api_stats/driver-icarus.c
2012-07-02 18:26:18 -07:00
Con Kolivas
336dbd5c98 Remove needless roundl define. 2012-07-03 10:44:59 +10:00
Paul Sheppard
cc0ad5eaa7 Merge branch 'master' of git://github.com/ckolivas/cgminer.git
Conflicts:
	driver-bitforce.c
2012-07-01 23:35:06 -07:00
ckolivas
fd7b21ed56 Use a pthread conditional that is broadcast whenever work restarts are required. Create a generic wait function waiting a specified time on that conditional that returns if the condition is met or a specified time passed to it has elapsed. Use this to do smarter polling in bitforce to abort work, queue more work, and check for results to minimise time spent working needlessly. 2012-07-02 10:54:20 +10:00
Paul Sheppard
a4a2000cc0 Merge branch 'master' of git://github.com/ckolivas/cgminer.git 2012-06-30 20:45:56 -07:00
ckolivas
1e9421475c Timersub is supported on all build platforms so do away with custom timerval_subtract function. 2012-07-01 10:44:23 +10:00
Kano
eab9debc72 api.c data structure - all testing attempted successful 2012-06-30 23:41:22 +10:00
Kano
d8abfb713e api.c data structure - tested + updated get_api_stats/driver-icarus.c 2012-06-30 15:58:31 +10:00
Kano
538653a53e api.c data structure - 2nd - untested 2012-06-30 12:44:57 +10:00