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

647 Commits

Author SHA1 Message Date
ckolivas
b198423d17 Don't keep rolling work right up to the expire= cut off. Use 2/3 of the time between the scantime and the expiry as cutoff for reusing work. 2012-06-26 16:01:06 +10:00
ckolivas
6e80b63bb8 Revert "Increase the getwork delay factored in to determine if work vs share is stale to avoid too tight timing."
This reverts commit d8de1bbc5b.

Wrong fix.
2012-06-26 15:43:03 +10:00
ckolivas
d8de1bbc5b Increase the getwork delay factored in to determine if work vs share is stale to avoid too tight timing. 2012-06-26 13:07:08 +10:00
Paul Sheppard
1ef52e0bac Check for submit_stale before checking for work_restart
(to keep Kano happy)
2012-06-25 19:23:10 -07:00
Paul Sheppard
df9e76bd73 Merge branch 'master' of https://github.com/ckolivas/cgminer.git 2012-06-25 10:56:04 -07:00
Paul Sheppard
90d82aa61d Revert to pre pool merge 2012-06-25 10:27:08 -07:00
Con Kolivas
c027492fa4 Make the pools array a dynamically allocated array to allow unlimited pools to be added. 2012-06-25 17:06:26 +10:00
Con Kolivas
5cf4b7c432 Make the devices array a dynamically allocated array of pointers to allow unlimited devices. 2012-06-25 16:59:29 +10:00
Con Kolivas
17ba2dca63 Logic fail on queueing multiple requests at once. Just queue one at a time. 2012-06-25 10:51:45 +10:00
Con Kolivas
42ea29ca4e Use a queueing bool set under control_lock to prevent multiple calls to queue_request racing. 2012-06-25 00:58:18 +10:00
Con Kolivas
63dd598e2a Queue multiple requests at once when levels are low. 2012-06-25 00:42:51 +10:00
Con Kolivas
757922e4ce Use the work clone flag to determine if we should subtract it from the total queued variable and provide a subtract queued function to prevent looping over locked code. 2012-06-25 00:33:47 +10:00
Con Kolivas
49dd8fb548 Don't decrement staged extras count from longpoll work. 2012-06-25 00:25:38 +10:00
Con Kolivas
d93e5f710d Count longpoll's contribution to the queue. 2012-06-25 00:23:58 +10:00
Con Kolivas
05bc638d97 Increase queued count before pushing message. 2012-06-25 00:08:50 +10:00
Con Kolivas
32f5272123 Revert "With better bounds on the amount of work cloned, there is no need to age work and ageing it was picking off master work items that could be further rolled."
This reverts commit 5d90c50fc0.
2012-06-25 00:03:37 +10:00
Con Kolivas
5d90c50fc0 With better bounds on the amount of work cloned, there is no need to age work and ageing it was picking off master work items that could be further rolled. 2012-06-24 23:38:24 +10:00
Con Kolivas
47f66405c0 Alternatively check staged work count for rolltime capable pools when deciding to queue requests. 2012-06-24 23:10:02 +10:00
Con Kolivas
efa9569b66 Test we have enough work queued for pools with and without rolltime capability. 2012-06-24 22:59:56 +10:00
Con Kolivas
1bbc860a15 Don't count longpoll work as a staged extra work. 2012-06-24 22:47:51 +10:00
Con Kolivas
ebaa615f6d Count extra cloned work in the total queued count. 2012-06-24 22:16:04 +10:00
Con Kolivas
74cd6548a9 Use a static base measurement difference of how many items to clone since requests_staged may not climb while rolling. 2012-06-24 22:00:37 +10:00
Con Kolivas
7b57df1171 Allow 1/3 extra buffer of staged work when ageing it. 2012-06-24 21:58:52 +10:00
Con Kolivas
53269a97f3 Revert "Simplify the total_queued count to those staged not cloned and remove the locking since it's no longer a critical value."
This reverts commit 9f811c528f.
2012-06-24 21:57:49 +10:00
Con Kolivas
a05c8e3fd9 Revert "Take into account total_queued as well when deciding whether to queue a fresh request or not."
This reverts commit b20089fdb7.
2012-06-24 21:57:18 +10:00
Con Kolivas
750474bcfb Revert "Further simplify the total_queued counting mechanism and do all dec_queued from the one location."
This reverts commit 790acad9f9.
2012-06-24 21:56:53 +10:00
Con Kolivas
d2c1a6bd6b Revert "Make sure to have at least one staged work item when deciding whether to queue another request or not and dec queued in free work not discard work."
This reverts commit c860172275.
2012-06-24 21:56:36 +10:00
Con Kolivas
c860172275 Make sure to have at least one staged work item when deciding whether to queue another request or not and dec queued in free work not discard work. 2012-06-24 21:52:07 +10:00
Con Kolivas
790acad9f9 Further simplify the total_queued counting mechanism and do all dec_queued from the one location. 2012-06-24 21:42:34 +10:00
Con Kolivas
b20089fdb7 Take into account total_queued as well when deciding whether to queue a fresh request or not. 2012-06-24 20:59:55 +10:00
Con Kolivas
ded16838db Add the getwork delay time instead of subtracting it when determining if a share is stale. 2012-06-24 20:48:02 +10:00
Con Kolivas
b5757d124b Don't count getwork delay when determining if shares are stale. 2012-06-24 20:45:47 +10:00
Con Kolivas
9f811c528f Simplify the total_queued count to those staged not cloned and remove the locking since it's no longer a critical value.
Clone only anticipated difference sicne there will be a lag from the value returned by requests_staged().
Keep 1/3 buffer of extra work items when ageing them.
2012-06-24 20:38:40 +10:00
Con Kolivas
411784a99d As work is sorted by age, we can discard the oldest work at regular intervals to keep only 1 of the newest work items per mining thread. 2012-06-24 19:53:31 +10:00
Con Kolivas
359635a8cf Only roll enough work to have one staged work for each mining thread. 2012-06-24 18:44:09 +10:00
Con Kolivas
0c970bbd1c Roll work again after duplicating it to prevent duplicates on return to the clone function. 2012-06-24 18:22:20 +10:00
Con Kolivas
610302afcb Abstract out work cloning and clone $mining_threads copies whenever a rollable work item is found and return a clone instead. 2012-06-24 18:10:17 +10:00
Con Kolivas
a8ae1a43ea Rolltime should be used as the cutoff time for primary work as well as the rolled work, if present. 2012-06-24 14:38:31 +10:00
Con Kolivas
c20a89d998 Take into account average getwork delay as a marker of pool communications when considering work stale. 2012-06-24 14:20:29 +10:00
Con Kolivas
f32ffb8718 Work out a rolling average getwork delay stored in pool_stats. 2012-06-24 13:20:17 +10:00
Con Kolivas
4e60a62ae2 Getwork delay in stats should include retries for each getwork call. 2012-06-24 12:55:56 +10:00
ckolivas
6a45cbbdfb Merge branch 'master' of https://github.com/ckolivas/cgminer 2012-06-23 23:45:08 +10:00
ckolivas
c5a21fabf0 Extend nrolltime to support the expiry= parameter. Do this by turning the rolltime bool into an integer set to the expiry time. If the pool supports rolltime but not expiry= then set the expiry time to the standard scantime. 2012-06-23 23:43:22 +10:00
Paul Sheppard
6ce4871b94 Merge branch 'conf_pools' 2012-06-20 15:49:51 -07:00
Paul Sheppard
0bcdc2cac4 Add ability to disable pools in config file.
Also fix pool writing in priorty order.
2012-06-20 15:49:07 -07:00
Paul Sheppard
57fa2be13b Write pools in priority order 2012-06-20 11:40:28 -07:00
Paul Sheppard
e037028159 Merge branch 'master' of https://github.com/ckolivas/cgminer.git
Conflicts:
	driver-bitforce.c
2012-06-19 10:40:00 -07:00
Con Kolivas
f70577b097 Merge pull request #229 from luke-jr/modminer_primary
modminer: Don't delay 2nd+ FPGAs during work restart
2012-06-19 04:38:49 -07:00
Luke Dashjr
1215da39ee modminer: Don't delay 2nd+ FPGAs during work restart
Add primary_thread boolean to threads to identify a single one as the "primary" thread for shared-resource multithreading.
This is needed since ModMiners use multiple threads to interface with independent hashing components.
2012-06-18 05:51:09 +00:00
Paul Sheppard
af27b40e34 Merge branch 'master' of https://github.com/pshep/cgminer.git 2012-06-17 09:47:02 -07:00
Paul Sheppard
fe4c0869bf Merge branch 'master' of git://github.com/ckolivas/cgminer.git
Conflicts:
	cgminer.c
2012-06-17 09:44:42 -07:00
Paul Sheppard
7ae22e21e3 Disable OpenCL code when not available. 2012-06-16 20:24:40 -07:00
Con Kolivas
8faf3c90b8 Fix openwrt crashing on regeneratehash() by making check_solve a noop. 2012-06-16 09:22:11 +10:00
Paul Sheppard
6ed75c96cb Remove nDev limit in watchdog_thread
Can't work out why it was even there... so there could still be a reason
for it!
2012-06-15 12:11:28 -07:00
Paul Sheppard
fa3f357fc1 Sick/dead handling for non-gpus 2012-06-14 17:36:59 -07:00
Paul Sheppard
bc4a259af7 Merge branch 'master' of git://github.com/ckolivas/cgminer.git 2012-06-14 08:13:07 -07:00
Con Kolivas
bf3e15838f Fix sign warning. 2012-06-14 21:36:23 +10:00
Con Kolivas
83bf9f4334 can_roll and should_roll should have no bearing on the cycle period within the miner_thread so remove it. 2012-06-14 20:53:07 +10:00
Con Kolivas
ceec3f83c3 Check for strategy being changed to load balance when enabling LPs. 2012-06-14 20:36:17 +10:00
Con Kolivas
b0de3edeb8 Check that all threads on the device that called get_work are waiting on getwork before considering the pool lagging. 2012-06-14 17:28:24 +10:00
Con Kolivas
44f5d55d51 Iterate over each thread belonging to each device in the hashmeter instead of searching for them now that they're a list. 2012-06-14 17:16:37 +10:00
Paul Sheppard
2d1f961046 Merge branch 'master' of git://github.com/ckolivas/cgminer.git 2012-06-14 00:05:31 -07:00
Con Kolivas
6e2c12eeb0 When using rotate pool strategy, ensure we only select from alive enabled pools. 2012-06-14 16:11:29 +10:00
Con Kolivas
79f4b570f7 Start longpoll from every pool when load balance strategy is in use. 2012-06-14 15:58:18 +10:00
Con Kolivas
dbe9056df4 Add mandatory and block fields to the work struct. Flag any shares that are detected as blocks as mandatory to submit, along with longpoll work from a previously rejecting pool. 2012-06-14 15:42:43 +10:00
Paul Sheppard
b94e199649 Merge branch 'master' of https://github.com/ckolivas/cgminer.git 2012-06-13 17:31:20 -07:00
Paul Sheppard
eff2d04df0 Merge branch 'master' of https://github.com/ckolivas/cgminer.git
Conflicts:
	cgminer.c
2012-06-13 12:31:33 -07:00
Luke Dashjr
4eb23c7ea3 Bugfix: slay a variety of warnings 2012-06-13 17:03:26 +00:00
Paul Sheppard
2384d0fbc6 Removed idle mode... again!?
Changed work_reset rate to every 100ms & use defines rather than numerics.
Change total sleep time to 4300ms after performance testing/measurement (now good to 916MH/s).
Changed timeout to 15s - Throttle time is 15s.
Added support for 'Busy' when submitting work.
Improved logging text to include device identifier.
Added a thread_enable api function, called when a thread is re-enabled.
... and removed useless re-init inside scanhash.
Use modminer introduced mutex.
2012-06-12 18:20:18 -07:00
Luke Dashjr
a78d616bc5 modminer: Temperature sensor improvements
Display the temperature of each of the (up to) 4 FPGAs
2012-06-12 17:04:03 +00:00
Paul Sheppard
861388f960 Merge branch 'master' of https://github.com/ckolivas/cgminer.git 2012-06-12 09:04:42 -07:00
Luke Dashjr
76f96f4717 New driver: BTCFPGA ModMiner 2012-06-12 02:38:36 +00:00
Luke Dashjr
d3fa59d76f Abstract generally useful FPGA code into fpgautils.c 2012-06-12 02:35:45 +00:00
Paul Sheppard
bf4d6c3483 Merge branch 'master' of https://github.com/ckolivas/cgminer.git 2012-06-11 13:36:35 -07:00
Paul Sheppard
4889d7ecb2 Merge branch 'master' of git@github.com:pshep/cgminer.git
Conflicts:
	driver-bitforce.c
2012-06-11 13:09:27 -07:00
Paul Sheppard
820d662c9d Removed idle mode.
Added watchdog thread BFL temperature monitoring.
2012-06-10 23:11:59 -07:00
Paul Sheppard
ebeaf15f18 Added idle mode
Idle is only set by pgadisable, so GPU/CPU is unaffected.
For Icarus/Ztex, in scanhash the thread is immediately set disabled then returns.
2012-06-09 19:30:32 -07:00
Kano
fdcd72b9ae API add stats for pool getworks 2012-06-10 11:19:21 +10:00
Paul Sheppard
7f54adb4c9 Merge remote-tracking branch 'upstream/master' 2012-06-08 19:48:42 -07:00
Kano
3cb3f09a50 API save default config file if none specified 2012-05-31 23:18:55 +10:00
Con Kolivas
84064a2b1e Must unlock mutex within loop. 2012-05-31 19:25:33 +10:00
Con Kolivas
85bddde1c0 Must unlock mutex after waking up on pthread conditional. 2012-05-31 19:20:40 +10:00
Con Kolivas
598476cae1 Merge pull request #204 from kanoi/icarus-timer
Icarus: high accuracy timing and other bitstream speed support
2012-05-30 18:02:00 -07:00
Con Kolivas
624948e246 Open a longpoll connection if a pool is in the REJECTING state as it's the only way to re-enable it automatically. 2012-05-31 09:44:51 +10:00
Con Kolivas
2586bda59a Use only one longpoll as much as possible by using a pthread conditional broadcast that each longpoll thread waits on and checks if it's the current pool before opening its longpoll connection. 2012-05-31 09:40:32 +10:00
Con Kolivas
5c3a252b6d Merge branch 'master' of github.com:ckolivas/cgminer 2012-05-31 08:42:46 +10:00
Con Kolivas
85210ee7a8 If shares are known stale, don't use them to decide to disable a pool for sequential rejects. 2012-05-31 08:41:56 +10:00
Paul Sheppard
cebd647f50 Messing with BFL code 2012-05-22 08:10:00 -07:00
Paul Sheppard
4d3cc0bc6d Add check to 'i' (could be considered safer) 2012-05-18 10:57:19 -07:00
Paul Sheppard
407be57400 Change write_config so that pools are saved in priority order. 2012-05-16 16:26:05 -07:00
Kano
17b6f111a6 Icarus: make --icarus-timing hidden and document it in FPGA-README 2012-05-16 23:53:13 +10:00
Kano
b5ed958e84 Icarus: high accuracy timing and other bitstream speed support 2012-05-16 22:25:21 +10:00
Xiangfu
9414fa7c18 work_decode only needs swab32 on midstate under BIG ENDIAN 2012-05-11 12:15:30 +08:00
Kano
c2e2e7e437 save config bugfix: writing an extra ',' when no gpus 2012-05-07 20:23:20 +10:00
Con Kolivas
61696c072c In the unlikely event of finding a block, display the block solved count with the pool it came from for auditing. 2012-05-06 16:22:18 +10:00
Con Kolivas
6282dfb405 Display the device summary on exit even if a device has been disabled. 2012-05-06 16:15:20 +10:00
Con Kolivas
848373d13b Ensure we test for a pool recovering from idle so long as it's not set to disabled. 2012-05-06 14:24:50 +10:00
Con Kolivas
b85d7b5446 Revert "Perform all common pool initialisation in add_pool()."
This reverts commit f8b66bde28.

Sets pools to dead by mistake at startup.
2012-05-06 14:17:48 +10:00
Con Kolivas
801d9eaa7b Fix pool number display. 2012-05-06 14:13:39 +10:00
Con Kolivas
233a812f00 Give cgminer -T message only if curses is in use. 2012-05-06 13:30:27 +10:00
Con Kolivas
f8b66bde28 Perform all common pool initialisation in add_pool(). 2012-05-06 13:27:17 +10:00
Con Kolivas
85c9e0c4b6 Merge pull request #198 from kanoi/stats
API add getwork stats to cgminer - accesable from API 'stats' - and devices can add stats also
2012-05-05 06:38:30 -07:00
Kano
976e27c4cb API add getwork stats to cgminer - accesable from API 'stats' 2012-05-05 15:04:15 +10:00
Con Kolivas
46a679f39e Revert "Provide simple macros for the repeated use of checking the first value of the input char with strncasecmp."
This reverts commit 87708a6a0e.

Broken.
2012-05-05 12:55:00 +10:00
Con Kolivas
c322d9b55e Don't initialise variables to zero when in global scope since they're already initialised. 2012-05-05 09:40:46 +10:00
Con Kolivas
c8e1026dfb Get rid of unitialised variable warning when it's false. 2012-05-05 09:37:33 +10:00
Con Kolivas
b3bc506d9a Move a pool to POOL_REJECTING to be disabled only after 3 minutes of continuous rejected shares. 2012-05-05 09:31:48 +10:00
Con Kolivas
87708a6a0e Provide simple macros for the repeated use of checking the first value of the input char with strncasecmp. 2012-05-04 23:05:00 +10:00
Kano
5c2bf84a37 Change FPGA detection order since BFL hangs on an ICA 2012-05-04 22:18:31 +10:00
Con Kolivas
4987958e6a Add a temporarily disabled state for enabled pools called POOL_REJECTING and use the work from each longpoll to help determine when a rejecting pool has started working again.
Switch pools based on the multipool strategy once a pool is re-enabled.
2012-05-04 20:10:38 +10:00
Con Kolivas
d5eb6650e2 Merge pull request #193 from kanoi/master
API add last share time to each pool + Correct Icarus U: & MH/s
2012-05-04 02:43:56 -07:00
ckolivas
376fcd3c02 Fix the benchmark feature by bypassing the new networking code. 2012-05-04 13:10:18 +10:00
ckolivas
4d090a587c Reset sequential reject counter after a pool is disabled for when it is re-enabled. 2012-05-04 12:51:32 +10:00
Kano
44fc698750 API add last share time to each pool 2012-05-04 00:13:42 +10:00
Con Kolivas
852f6a0eb0 Don't try to reap curls if benchmarking is enabled. 2012-05-03 22:39:12 +10:00
Con Kolivas
f0985f9978 Only show longpoll warning once when it has failed. 2012-05-03 16:25:07 +10:00
Con Kolivas
41d5813d8f Convert hashes to an unsigned long long as well. 2012-05-03 15:37:29 +10:00
Con Kolivas
a4f1af1733 Detect pools that have issues represented by endless rejected shares and disable them, with a parameter to optionally disable this feature. 2012-05-03 15:35:13 +10:00
Luke Dashjr
068018225c Bugfix: Use a 64-bit type for hashes_done (miner_thread) since it can overflow 32-bit on some FPGAs 2012-05-02 23:24:07 -04:00
Con Kolivas
5081c1824a Limit the number of curls we recruit on communication failures and with delaynet enabled to 5 by maintaining a per-pool curl count, and using a pthread conditional that wakes up when one is returned to the ring buffer. 2012-05-03 10:49:42 +10:00
Con Kolivas
d4405de704 Generalise add_pool() functions since they're repeated in add_pool_details. 2012-05-03 10:49:42 +10:00
Luke Dashjr
4ba9006d0e Disable failing devices such that the user can attempt to re-enable them 2012-05-03 10:49:42 +10:00
ckolivas
5cf4e188fd Increase pool watch interval to 30 seconds. 2012-05-03 10:49:42 +10:00
ckolivas
85008a7853 Reap curls that are unused for over a minute.
This allows connections to be closed, thereby allowing the number of curl handles to always be the minimum necessary to not delay networking.
2012-05-03 10:48:05 +10:00
Con Kolivas
ec3d057016 Use the ringbuffer of curls from the same pool for submit as well as getwork threads.
Since the curl handles were already connected to the same pool and are immediately available, share submission will not be delayed by getworks.
2012-05-03 10:47:15 +10:00
Con Kolivas
7d288eac9f Implement a scaleable networking framework designed to cope with any sized network requirements, yet minimise the number of connections being reoped.
Do this by create a ring buffer linked list of curl handles to be used by getwork, recruiting extra handles when none is immediately available.
2012-05-03 10:41:57 +10:00
Con Kolivas
89053c78da There is no need for the submit and getwork curls to be tied to the pool struct. 2012-05-01 19:12:37 +10:00
ckolivas
adda6e6680 Do not recruit extra connection threads if there have been connection errors to the pool in question. 2012-05-01 17:48:23 +10:00
ckolivas
7638511290 We should not retry submitting shares indefinitely or we may end up with a huge backlog during network outages, so discard stale shares if we failed to submit them and they've become stale in the interim. 2012-05-01 09:54:34 +10:00
Con Kolivas
b015348df4 Shorten stale share messages slightly. 2012-04-29 10:08:12 +10:00
Con Kolivas
7233890d85 Protect the freeing of current_hash under mutex_lock to prevent racing on it when set_curblock is hit concurrently. 2012-04-29 10:03:01 +10:00
Con Kolivas
53c22551f7 Change default behaviour to submitting stale, removing the --submit-stale option and adding a --no-submit-stale option. 2012-04-29 09:12:23 +10:00
Con Kolivas
f9123f0587 Make sure to start the getwork and submit threads when a pool is added on the fly. 2012-04-29 08:55:59 +10:00
Con Kolivas
5ad942d187 Faster hardware can easily outstrip the speed we can get work and submit shares when using only one connection per pool.
Test the queued list to see if any get/submits are already queued and if they are, start recruiting extra connections by generating new threads.
This allows us to reuse network connections at low loads but recuit new open connections as they're needed, so that cgminer can scale to hardware of any size.
2012-04-29 00:56:23 +10:00
Con Kolivas
628ac19977 Get rid of confusing "waiting on fresh work" part of longpoll message to minimise log width and add pool number to longpoll work restart message. 2012-04-28 14:00:34 +10:00
Con Kolivas
972860c0af Remove unused variable. 2012-04-28 13:36:27 +10:00
Con Kolivas
3362a2a447 Give a longpoll message for any longpoll that detects a block change, primary or backup, and also display which pool it was. 2012-04-28 13:31:27 +10:00
Con Kolivas
e1cf5029d4 Decrease utility display to one decimal place. 2012-04-28 12:22:23 +10:00
Con Kolivas
7b370bb2e7 Small cosmetic output alignment. 2012-04-28 09:19:32 +10:00
Con Kolivas
669b0deda3 Add pool number to stale share message. 2012-04-28 08:39:06 +10:00
Con Kolivas
03fab3f438 Remove thread id display from rejected shares as well. 2012-04-28 00:16:34 +10:00
Con Kolivas
86e94edb89 Set have_longpoll to true when there is at least one pool with longpoll. 2012-04-27 15:47:21 +10:00
Con Kolivas
0365878ac5 Don't display the thread ID since it adds no useful information over the device number. 2012-04-27 15:30:42 +10:00
Con Kolivas
08c721080d Don't display the first 8 bytes of a share since they will always be zero at >= 1 difficulty. 2012-04-27 15:29:31 +10:00
Con Kolivas
501e35a0e6 work->longpoll is reset across test_work_current so we need to recheck what pool it belongs to. 2012-04-27 14:02:29 +10:00
Con Kolivas
03abb70467 Use longpolls from backup pools with failover-only enabled just to check for block changes, but don't use them as work. 2012-04-27 13:59:43 +10:00
Con Kolivas
1ab318d0f3 Start longpoll only after we have tried to extract the longpoll URL. 2012-04-27 13:11:19 +10:00
Con Kolivas
b1c273e71b Check for submitold flag on resubmit of shares, and give different message for stale shares on retry. 2012-04-27 12:54:29 +10:00
Con Kolivas
5ece966f07 Check for submitold before submitstale. 2012-04-27 12:47:13 +10:00
Con Kolivas
ed718b2b50 Don't force fresh curl connections on anything but longpoll threads. 2012-04-27 12:28:51 +10:00
Con Kolivas
eda382990a Create one longpoll thread per pool, using backup pools for those pools that don't have longpoll.
Use the work created from the longpoll return only if we don't have failover-enabled, and only flag the work as a longpoll if it is the current pool.
This will work around the problem of trying to restart the single longpoll thread on pool changes that was leading to race conditions.
It will also have less work restarts from the multiple longpolls received from different pools.
2012-04-27 11:58:47 +10:00
Con Kolivas
e502fde52b Remove the ability to disable longpoll. It is not a useful feature and will conflict with planned changes to longpoll code. 2012-04-27 11:13:52 +10:00
Con Kolivas
8e84abfc22 Merge pull request #184 from luke-jr/bugfix_const_warning
Bugfix: Make initial_args a const char** to satisfy exec argument type warning (MinGW)
2012-04-26 17:36:19 -07:00
Con Kolivas
8d8f4ff856 Merge pull request #182 from kanoi/master
api.c 'devdetails' list static details of devices + ZTex ++
2012-04-26 16:38:17 -07:00
Luke Dashjr
90c5ef1fa7 Bugfix: Make initial_args a const char** to satisfy exec argument type warning (on Windows only) 2012-04-26 14:58:31 -04:00
Con Kolivas
4cd973264f Create discrete persistent submit and get work threads per pool, thus allowing all submitworks belonging to the same pool to reuse the same curl handle, and all getworks to reuse their own handle.
Use separate handles for submission to not make getwork potentially delay share submission which is time critical.
This will allow much more reusing of persistent connections instead of opening new ones which can flood routers.
This mandated a rework of the extra longpoll support (for when pools are switched) and this is managed by restarting longpoll cleanly and waiting for a thread join.
2012-04-26 23:29:21 +10:00
Kano
b3ac249e71 cgminer.c sharelog code consistency and compile warning fix 2012-04-26 00:20:16 +10:00
Luke Dashjr
4648330c9d Support for share logging 2012-04-25 12:05:33 +10:00
Con Kolivas
f5f089f5b4 Add a --gpu-map option which will allow arbitrarily mapping ADL devices to OpenCL devices for instances where association by enumeration alone fails. 2012-04-23 17:40:47 +10:00
Con Kolivas
99331991ba Increase upper limit on number of extra items to queue as some FPGA code can't yet reliably keep many devices busy. 2012-04-23 09:53:40 +10:00
Con Kolivas
d6edd07c4a Display configuration file information when -c option is passed and only when file exists on loading default config file. 2012-04-22 21:09:36 +10:00
Con Kolivas
6ffdbc3aeb Display configuration file loaded, if any, and debug output if configuration file parsing failed. 2012-04-22 20:50:50 +10:00
Con Kolivas
cfe3eb0b8a Merge branch 'master' into ztex
Conflicts:
	configure.ac
2012-04-22 10:43:31 +10:00
Luke Dashjr
0d92069760 Merge branch 'master' into align_temps
Conflicts:
	cgminer.c
2012-04-21 03:32:57 -04:00
Luke Dashjr
657716e563 Merge branch 'master' into ztex 2012-04-21 02:56:20 -04:00
Con Kolivas
7b947882fe Merge pull request #157 from luke-jr/unify_drivers
Unify drivers as driver-*.c and add driver name to API
2012-04-20 23:41:46 -07:00
Con Kolivas
86671f80a8 Make the status window and log window as large as can fit on startup, rechecking to see if it can be enlarged after the fact. This allows any number of devices to be displayed provided the window is made long enough without corrupting the output. 2012-04-21 16:39:14 +10:00
Luke Dashjr
b8778839e9 Merge branch 'master' into unify_drivers
Conflicts:
	cgminer.c
2012-04-21 02:36:19 -04:00
Con Kolivas
c7cc2e4226 Merge branch 'master' into ztex 2012-04-21 14:03:41 +10:00
Con Kolivas
e08936c3fb Merge pull request #166 from kanoi/master
api.c escape required characters in return strings + pools returns the username
2012-04-20 15:00:39 -07:00
Kano
2e1d2017de API add removepool like the screen interface 2012-04-21 03:15:41 +10:00
Con Kolivas
46faefbe82 Merge branch 'ztex-master' of https://github.com/nelisky/cgminer into ztex 2012-04-20 21:20:03 +10:00
ckolivas
b80d22b9d2 Increase maximum number of displayed devices to 14, beyond which the screen becomes corrupted. 2012-04-20 14:24:58 +10:00
nelisky
7fe7d18dba removing unused libusb_context pointer 2012-04-16 14:14:52 -07:00
nelisky
608a520573 Tweaks to make ztex work on a tp-link router with openwrt 2012-04-16 11:34:54 -07:00
nelisky
c3bda2b709 adding path to libusb include 2012-04-16 04:07:19 -07:00
nelisky
99a188f94f initial commit with some support for ztex 1.15x board.
This version is just a rough draft, but it does alredy mine.

Conflicts:

	cgminer.c
	configure.ac
2012-04-16 04:01:51 -07:00
Con Kolivas
7c6090fbaf Cache the initial arguments passed to cgminer and implement an attempted restart option from the settings menu. 2012-04-14 15:48:31 +10:00
Con Kolivas
f3e4305620 Disable per-device status lines when there are more than 8 devices since screen output will be corrupted, enumerating them to the log output instead at startup. 2012-04-14 14:11:58 +10:00
Con Kolivas
dceaa71a7b Make sure to disable devices with any status not being DEV_ENABLED to ensure that thermal cutoff code works as it was setting the status to DEV_RECOVER. 2012-04-14 00:56:31 +10:00
Con Kolivas
0a4a2d9d65 Damping small changes in hashrate so dramatically has the tendency to always make the hashrate underread so go back to gentle damping instead. 2012-03-31 14:39:40 +11:00
Con Kolivas
c99c09d389 Merge pull request #161 from kanoi/master
When using '-m' on linux, send the forked process a SIGTERM on exit
2012-03-30 06:25:38 -07:00
Con Kolivas
7f64adc473 Merge pull request #160 from luke-jr/bugfix_realquiet_2
Bugfix: Skip enabling curses, if --real-quiet or listing devices
2012-03-30 06:25:07 -07:00
Kano
f9af5acf13 When using '-m' on linux, send the forked process a SIGTERM on exit 2012-03-30 22:28:43 +11:00
Con Kolivas
88ff55e70e Use a time constant 0.63 for when large changes in hashrate are detected to damp change in case the large change is an aliasing artefact instead of a real change. 2012-03-29 21:02:42 +11:00
Con Kolivas
a1879c8057 Only increment stale counter if the detected stales are discarded. 2012-03-29 20:53:16 +11:00
ckolivas
35de9d1e07 Use slightly more damping on the decay time function in the never-ending quest to smooth off the hashmeter. 2012-03-29 09:35:48 +11:00
Con Kolivas
eb4233d500 Merge pull request #156 from luke-jr/ignore_redundant
Ignore redundant-with-build options
2012-03-28 04:26:20 -07:00
Con Kolivas
7458927f02 Merge pull request #155 from luke-jr/no_curses
Make curses TUI support optional at compile-time.
2012-03-28 04:25:54 -07:00
Con Kolivas
2beb3500d4 Merge pull request #153 from kanoi/master
Add API support for Icarus and Bitforce + Icarus fixes ++
2012-03-28 04:24:41 -07:00
Con Kolivas
ef1eafa40a Provide locking around updates of cgpu hashrates as well to prevent multiple threads accessing data fields on the same device. 2012-03-28 21:58:04 +11:00
Con Kolivas
fa5e0675d6 Display the beginning of the new block in verbose mode in the logs. 2012-03-28 20:32:49 +11:00
Kano
eeec98098f code changes for supporting a simple device history 2012-03-23 01:50:45 +11:00
Luke Dashjr
f05a319e01 CGPU API for device names 2012-03-18 21:32:01 -04:00
Luke Dashjr
303dbf4664 Abstract add_cgpu function, to handle device id numbering and devices array 2012-03-18 20:09:03 -04:00
Luke Dashjr
c739d0dc15 Merge branch 'bugfix_realquiet' into bugfix_realquiet_2
Conflicts:
	cgminer.c
2012-03-13 13:11:55 -04:00
Luke Dashjr
03c94c02e9 Bugfix: Skip enabling curses, if --real-quiet or listing devices 2012-03-13 13:10:31 -04:00
Luke Dashjr
e131dfab31 Unify drivers as driver-*.c and add driver name to API 2012-03-13 12:18:23 -04:00
Luke Dashjr
b6ae200dad Ignore reduntant-with-build options --disable-gpu, --no-adl, and --no-restart 2012-03-13 09:13:19 -04:00
Luke Dashjr
ed8382c88d Make curses TUI support optional at compile-time. 2012-03-12 18:38:45 -04:00
Luke Dashjr
3a003b9ab8 Bugfix: Allow enabling CPU even without OpenCL support 2012-02-25 14:43:28 -05:00
Con Kolivas
daf1eff13c Change failed-to-mine number of requested shares messge to avoid segfault on recursive calling of quit(). 2012-02-26 00:46:19 +11:00
Con Kolivas
0412ac7c21 Only send out extra longpoll requests if we want longpolls. 2012-02-24 14:14:05 +11:00
Con Kolivas
dbb04a6922 Increase the speed of hashrate adaptation. 2012-02-24 14:14:05 +11:00
Con Kolivas
50a33aa6a3 Consider extra longpoll work items as staged_extra so as to make sure we queue more work if queueing regular work items as longpolls. 2012-02-23 20:43:18 +11:00
Con Kolivas
553d53fcee Reset all hash counters at the same time as resetting start times to get accurate hashrates on exiting which is mandatory for benchmarking. 2012-02-23 17:58:06 +11:00
Con Kolivas
88a9d83e19 Report thread in during getting of work in benchmark mode. 2012-02-23 17:54:27 +11:00
Con Kolivas
49ba39627c Report thread out before it starts to avoid being flagged as sick when waiting for the first work item. 2012-02-23 17:52:01 +11:00
Con Kolivas
f4df8c82a7 Merge pull request #135 from kanoi/master
API new commands enablepool and disablepool
2012-02-22 21:56:48 -08:00
Kano
60c5ac6844 API new commands enablepool and disablepool (version already incremented) 2012-02-23 16:10:17 +11:00
Kano
4458f3d5c7 Modify cgminer.c pool control to allow API to call it 2012-02-23 13:58:33 +11:00
Con Kolivas
4dd6b649d5 Merge pull request #131 from kanoi/master
Allow configuration file to include another recursively
2012-02-22 15:40:56 -08:00
Kano
ca2b2d9b9a Don't save 'include' when saving the configuration 2012-02-23 01:44:41 +11:00
Kano
915c72d8e7 Allow configuration file to include another recursively 2012-02-23 01:31:52 +11:00
Con Kolivas
527e611b74 Fix !HAVE_OPENCL build. 2012-02-23 01:27:36 +11:00
ckolivas
0db998c5d0 Add a --benchmark feature which works on a fake item indefinitely to compare device performance without any server or networking influence. 2012-02-22 22:21:18 +11:00
ckolivas
d3ad87f5d2 Allow writing of multiple worksizes to the configuration file. 2012-02-22 20:13:23 +11:00
ckolivas
1b1fa5cd89 Allow writing of multiple vector sizes to the configuration file. 2012-02-22 20:08:29 +11:00
ckolivas
994cd77501 Allow writing of multiple kernels to the configuration file. 2012-02-22 20:01:09 +11:00
ckolivas
93efb726bb Allow multiple different kernels to be chosen per device. 2012-02-22 19:38:01 +11:00
Con Kolivas
26c59fbf0f Allow the worksize to be set per-device. 2012-02-22 16:59:28 +11:00
Con Kolivas
deff55c640 Allow different vectors to be set per device. 2012-02-22 16:54:06 +11:00
Con Kolivas
bca9814d41 Reset times after all mining threads are started to make estimating hashrates easier at startup. 2012-02-22 11:50:35 +11:00
Con Kolivas
d1cddf8bad Update licensing to GPL V3. 2012-02-21 22:23:07 +11:00
Con Kolivas
882e4d85de Merge pull request #123 from xiangfu/icarus
Add Icarus Support to Cgminer
2012-02-21 03:14:20 -08:00
Con Kolivas
2f3a4a47c8 Reset the longpoll flag after it's been used once to prevent it restarting work again. 2012-02-21 21:56:30 +11:00
Con Kolivas
2ca8d38e0e Merge pull request #124 from kanoi/master
API commits - IP 0/0 means all, add "Log Interval" to config, restrict access to modify commands
2012-02-21 02:49:25 -08:00
Con Kolivas
00290a3e02 Select diablo kernel on all but GCN+SDK 2.6. 2012-02-21 21:48:10 +11:00
Kano
e3281c2643 When API shuts down cgminer don't kill itself 2012-02-21 20:03:13 +11:00
Con Kolivas
af7368daca Don't make rolled work from the longpoll be seen as other longpoll work items. 2012-02-21 16:43:24 +11:00
Con Kolivas
f4284a21a8 Set the lp_sent variable under lock since there will almost always be a race on setting this variable, potentially leading to multiple LPs being sent
out.
2012-02-21 09:22:04 +11:00
Con Kolivas
89b32b1738 Officially support diakgcn in code and docs. 2012-02-20 09:28:01 +11:00
Con Kolivas
fe4b5e1fc6 Set the lp_sent bool earlier to minimise the number of extra longpolls sent out. 2012-02-20 08:26:46 +11:00
Xiangfu
f46c2b28a0 add icarus to cgminer.c 2012-02-19 22:22:02 +08:00
Con Kolivas
3cdac04f4f Flag the pool that is the longpoll thread to avoid sending multiple longpolls during the slight delays between requesting and setting the lp_sent flag. 2012-02-19 23:13:02 +11:00
Con Kolivas
56baa87437 Make sure to request on the lp url when requesting a longpoll indrectly via get upstream work. 2012-02-19 22:19:59 +11:00
Con Kolivas
79e95dd95c Store whether a work item is the result of a longpoll or not in struct work and use it to help determine block changes directly from the work longpoll
bool.
2012-02-19 22:15:55 +11:00
Con Kolivas
39906718d2 Keep track of when a longpoll has been sent for a pool and if the current pool is requesting work but has not sent a longpoll request, convert one of
the work items to a longpoll as we may have switched pools but still be using the longpoll from the previous pool.
2012-02-19 22:07:31 +11:00
Con Kolivas
4eca1aa05c Store the longpoll url in the pool struct and update it from the pool_active test in case it changes. This is to allow further changes to longpoll
management on switching pools.
2012-02-19 21:50:02 +11:00
Con Kolivas
f85b85d244 Re-check for a longpoll supporting pool every 30 seconds if none is found initially. 2012-02-19 21:28:23 +11:00
Con Kolivas
b217cbee0d Report threads as busy waiting on getwork on startup to avoid them being flagged sick on startup during slow networking. 2012-02-19 20:33:09 +11:00
Con Kolivas
02295c69c8 Allow devices that are disabled due to overheating to be flagged as recovering instead of disabling them and re-enable them if they're below ideal
temperatures and --no-restart has not been set.
2012-02-19 20:19:47 +11:00
Con Kolivas
810ad04578 More copyright updates. 2012-02-18 23:16:08 +11:00
Con Kolivas
17cc279adb Always use a fresh connection for longpoll as prolonged persistent connections can fail for many reasons. 2012-02-18 22:41:48 +11:00
Con Kolivas
06721957a0 Freeze the queues on all threads that are sent the pause message to prevent them trying to start up again with saved pings in their queues. 2012-02-18 16:34:06 +11:00
Con Kolivas
f0e12fc593 Consolidate all screen updates to the watchdog thread and touch both windows before refresh. 2012-02-18 00:25:48 +11:00
Con Kolivas
d2b3fbc90c Curses will be disabled in clean_up so don't do it early in kill_work, and disable_adl so that GPU settings may be restored to normal in case shutting
down curses leads to instability on windows.
2012-02-17 23:11:50 +11:00
Con Kolivas
61328a4292 Stop the mining threads before trying to kill them. 2012-02-17 23:10:01 +11:00
Con Kolivas
1c211c5f41 Plain refresh() does not give reliably screen updates so get rid of all uses of it. 2012-02-17 22:55:33 +11:00
ckolivas
9a0e4f8fac Move logwindow down once number of devices is known. 2012-02-15 15:21:43 +11:00
ckolivas
c235c7e373 Allow the refresh interval to be adjusted in dynamic intensity with a --gpu-dyninterval parameter. 2012-02-15 14:35:13 +11:00
ckolivas
e259a994f1 Make curses display visible right from the beginning and fix the window sizes so the initial messages don't get lost once the status window is drawn. 2012-02-15 13:53:26 +11:00
ckolivas
c531f1bd04 Use the max_hashes variable to determine when to abandon work. 2012-02-15 10:34:26 +11:00
monson
8047af5af4 fix strcpy NULL pointer if env HOME unset. 2012-02-14 14:20:50 +08:00
Con Kolivas
56907db2d6 Fix harmless warnings with -Wsign-compare to allow cgminer to build with -W. 2012-02-12 18:21:30 +11:00
Con Kolivas
111238489f Fix missing field initialisers warnings. 2012-02-12 17:53:50 +11:00
Con Kolivas
1885374802 Merge pull request #112 from luke-jr/jansson_compat
Restore compatibility with Jansson 1.3 and 2.0 (api.c required 2.1)
2012-02-11 22:01:51 -08:00
Luke Dashjr
fdadb0b549 Restore compatibility with Jansson 1.3 and 2.0 (api.c required 2.1) 2012-02-11 15:46:08 -05:00
zefir
e0fec35751 modularized logging, support for priority based logging
Functions related to logging are extracted into dedicated source files
for better maintainability.

The existing low-level logging API is extended with a generalized scheme
providing log functions log_{error, warning, notice, info, debug} that
log messages based on a global opt_log_level.

opt_log_level for now is set to LOG_NOTICE and might be modified via
command line options or config files in future releases.
2012-02-11 20:26:25 +01:00
zefir
713e8be629 move CPU chipset specific optimization into device-cpu 2012-02-11 20:25:41 +01:00
Con Kolivas
405a2120f8 Remove unnecessary check for opt_debug on every invocation of applog at LOG_DEBUG and place the check in applog(). 2012-02-11 20:11:18 +11:00
Con Kolivas
81d4f620ff Various string fixes for reject reason. 2012-02-11 15:15:03 +11:00
Con Kolivas
b706da9374 Merge branch 'reject_reason' of https://github.com/luke-jr/cgminer into reject 2012-02-11 14:55:12 +11:00
Luke Dashjr
543265d66a Generalize --temp-cutoff and implement support for reading temperature from BitFORCE FPGAs 2012-02-10 22:14:27 -05:00
Con Kolivas
8c609579f4 Merge pull request #107 from kanoi/master
Allow API to restrict access by IP address + other commits
2012-02-10 19:07:53 -08:00
Con Kolivas
d24ee7824a Change message from recovered to alive since it is used on startup as well as when a pool has recovered. 2012-02-11 13:57:35 +11:00
Con Kolivas
8e682a2c32 Start mining as soon as any pool is found active and rely on the watchpool thread to bring up other pools. 2012-02-11 13:53:09 +11:00
Con Kolivas
405fcd76ca Delayed responses from testing pools that are down can hold up the watchdog thread from getting to its device testing code, leading to false detection
of the GPU not checking in, and can substantially delay auto gpu/auto fan management leading to overheating. Move pool watching to its own thread.
2012-02-11 13:38:17 +11:00
Con Kolivas
5ec684ce2b Space out retrieval of extra work according to the number of mining threads. 2012-02-11 13:20:32 +11:00
Con Kolivas
37374bb44b Make shutdown more robust.
Enable the input thread only after the other threads exist.
Don't kill off the workio thread and use it to exit main() only if there is an unexpected problem.
Use kill_work() for all anticipated shutdowns where possible.
Remove unused thread entry.
2012-02-11 13:11:56 +11:00
ckolivas
95a989da4d Conflicting entries of cl_kernel may have been causing problems, and automatically chosen kernel type was not being passed on. Rename the enum to cl_kernels and store the chosen kernel in each clState. 2012-02-11 11:48:12 +11:00
Con Kolivas
6e3ad7ad25 Logic fail on queue request. 2012-02-09 22:40:33 +11:00
Con Kolivas
d40979d173 No point discarding a share even if opt_fail is enabled. 2012-02-09 22:28:59 +11:00
Con Kolivas
435e5c85f6 Work items have a tendency to expire at exactly the same time and we don't queue extra items when there are plenty in the queue, regardless of age.
Allow extra work items to be queued if adequate time has passed since we last requested work even if over the limit.
2012-02-09 22:27:20 +11:00
Con Kolivas
ffbf15ad82 Discard work when failover-only is enabled and the work has come from a different pool. 2012-02-09 22:00:04 +11:00
Con Kolivas
5b4761003c Move from the thread safe localtime_r to regular localtime which is the only one supported on newer pthread libraries on mingw32 to make it compile with
the newer ming. Thread safety is of no importance where localtime is used in this code.
2012-02-09 21:54:23 +11:00
Kano
f19e67fe3a Allow API to restrict access by IP address 2012-02-08 19:06:24 +11:00
Luke Dashjr
f7a9897e13 Display X-Reject-Reason, when provided 2012-02-06 09:44:42 -05:00
Con Kolivas
e0540bd44a Revert "Rewrite the convoluted get_work() function to be much simpler and roll work as much as possible with each new work item."
This reverts commit dec99ab739.

This seems to cause a race on work in free_work(). Presumably other threads are still accessing the structure.
2012-02-06 21:35:24 +11:00
Con Kolivas
de4c6c29d7 Provide support for the submitold extension on a per-pool basis based on the value being detected in a longpoll. 2012-02-06 18:12:22 +11:00
Con Kolivas
dec99ab739 Rewrite the convoluted get_work() function to be much simpler and roll work as much as possible with each new work item. 2012-02-06 17:36:51 +11:00
Con Kolivas
a3e77937c8 Roll as much work as possible from the work returned from a longpoll. 2012-02-06 16:11:53 +11:00
Con Kolivas
eff9fe43b2 Rolling work on each loop through the mining thread serves no purpose. 2012-02-06 10:42:52 +11:00
Con Kolivas
d42d0c8ebd Allow to stage more than necessary work items if we're just rolling work. 2012-02-06 10:41:05 +11:00
Con Kolivas
b9612715aa Replace divide_work with reuse_work function used twice. 2012-02-06 10:40:04 +11:00
Con Kolivas
0307f9bb4e Give rolled work a new ID to make sure there is no confusion in the hashtable lookups. 2012-02-06 10:37:29 +11:00
Con Kolivas
d991a09e53 Remove now-defunct hash_div variables. 2012-02-06 08:00:09 +11:00
Con Kolivas
36d2fa485c Silence unused parameter warnings. 2012-02-05 22:39:28 +11:00
Con Kolivas
294ac0b6bf Stagger the restart of every next thread per device to keep devices busy ahead of accessory threads per device. 2012-02-05 22:33:58 +11:00
Con Kolivas
82f74af533 Deprecate the --donation feature.
Needlessly complex, questionable usefulness, depends on author's server and a central pool of some kind, and was not heavily adopted.
2012-02-05 21:36:41 +11:00
Con Kolivas
488a3b7338 It's devices that report back now, not threads. 2012-02-05 17:31:19 +11:00
Con Kolivas
23685aa41e Continue auto-management of fan and engine speeds even if a device is disabled for safety reasons. 2012-02-05 17:28:53 +11:00
Con Kolivas
01659bcc6c Abstract out tests for whether work has come from a block that has been seen before and whether a string is from a previously seen block. 2012-02-05 14:35:45 +11:00
Kano
0ebc0c9d8a Add last share's pool info in cgpu_info 2012-02-04 17:49:49 +11:00
ckolivas
53c1e9ae37 Allow the OpenCL platform ID to be chosen with --gpu-platform. 2012-02-04 15:15:57 +11:00
ckolivas
cda798d91b Only enable curses on failure if curses is desired. 2012-02-04 13:05:28 +11:00
zefir
e0b0a6c030 Modularize code: main.c -> device-cpu + device-gpu
This patch is an initial attempt to re-structure cgminer source
code from its monolithic design (with nearly all code being
concentrated in main.c) to a more modular one.

In this first stage, the conditionally compiled functions for
GPU and CPU mining were extracted into dedicated files:
 * device-cpu.h and device-cpu.c covering WANT_CPUMINE functions
 * device-gpu.h and device-gpu.c covering HAVE_OPENCL functions

The main.c file is left untouched as reference, while the
remainder without the extracted parts is located in cgminer.c.

The Makefile.am has been updated to use the re-structured
source files for the build.

Above pure re-structuring *NO* functional modifications were
made. The sources were tested to compile and run on on a
current Linux system with working CPU and GPU mining
(Bitforce not tested due to loack of hardware).
2012-02-04 10:23:06 +11:00