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

157 Commits

Author SHA1 Message Date
Ycros
9fe2106467 Fixed up using config.h instead of cpuminer-config.h. 2011-07-04 19:56:27 +10:00
Con Kolivas
edd0591e19 Make the number of queued work items configurable and default to 2. 2011-07-04 19:56:27 +10:00
Con Kolivas
131f60a5ee Move queueing of one request to separate function in preparation for variable length queues. 2011-07-04 19:56:27 +10:00
Con Kolivas
ffdffe77d3 Make sure the work gets attributed to the correct gpu.
Add an fflush to stderr to minimise garbled output when multiple threads write at once.
2011-07-04 19:56:27 +10:00
Con Kolivas
86e40ed9c8 Stale block control makes it possible to make 2 threads per gpu the default again. 2011-07-04 19:56:27 +10:00
Con Kolivas
48caf248a7 Check for stale block after failed submission as well. 2011-07-04 19:56:27 +10:00
Con Kolivas
09104ce3e8 Flag the work back to just thread 0 used by all the threads to avoid lots of queued older work for each thread. 2011-07-04 19:56:27 +10:00
Con Kolivas
bed692152f Get rid of the requirement for a static struct that needs locking to cache work.
Make it possible to use the thread id for getting work again.
Flag the getwork() function when we have a new block to explicitly discard any cached work when a new block is detected.
Store the header of each new work and compare it to blocks we're about to submit to decide if they're stale due to a new block and don't try to submit them.
This should significantly decrease the number of rejected blocks.
2011-07-04 19:56:26 +10:00
Con Kolivas
e2fb3e84cb Queueing all kernel parameters dramatically reduces stale block rates. 2011-07-04 19:56:26 +10:00
ckolivas
7ae9afc40f Profile points and warning clean ups. 2011-07-04 19:56:26 +10:00
ckolivas
b54a342529 Change default number of threads back to 1. The 2nd just increases the time taken to complete a work item thus increasing stale blocks, despite increasing the rate slightly. 2011-07-04 19:56:26 +10:00
Con Kolivas
88d9d631e3 Use two separate curl instances for submit and get and use separate threads for each to prevent one blocking the other. 2011-07-04 19:47:46 +10:00
Con Kolivas
72baac0889 Clearly delineate the cpus from the gpus for their local data. 2011-07-04 19:47:46 +10:00
Con Kolivas
142576a961 We already have gpu/cpu from id, so use that. Likely the current convoluted code is wrong and leading to segfaults! 2011-07-04 19:47:46 +10:00
Con Kolivas
18f8b0f9a5 Submit work async is still unreliable and only used for cpu mining, so back it out for now. 2011-07-04 19:47:46 +10:00
Con Kolivas
d5d4d1da16 Don't want to free the work data out of the transient structs. 2011-07-04 19:47:46 +10:00
Con Kolivas
d100281df3 Make sure correct thread id is in work struct and correct cpu is set for per-cpu data. 2011-07-04 19:47:46 +10:00
Con Kolivas
998d8d45f4 Postcalc hash is already its own thread so work can be submitted synchronously from that. 2011-07-04 19:47:46 +10:00
Con Kolivas
2b6e841673 Use a buffer of up to 512 * 4 integers when retrieving work from the GPU.
This allows each local thread id to have one slot to put any positive results into, thus making overlapping results far less likely.
Thus races will be much rarer, allowing more threads.
It should also pick up blocks close to each other more reliably and hopefully decrease the number of rejects and opencl errors.
Do the search over the buffer entirely in a separate thread to allow the GPU to stay as busy as possible.
Detach threads from themselves to prevent unlucky even where dereferencing occurs by freeing the data that stores the thread info.
2011-07-04 19:47:46 +10:00
ckolivas
6af84770d0 Add spaces to make output clearer. 2011-07-04 19:47:46 +10:00
ckolivas
e1dd27c5c2 Ensure that we don't overflow due to 32 bit limitations. 2011-07-04 19:47:45 +10:00
ckolivas
b38a02bd24 Make the log time hash rate a rolling exponential average so it doesn't fluctuate so dramatically. 2011-07-04 19:47:45 +10:00
ckolivas
08a7821072 Make the log show what the thread is: cpu or gpu and what number. 2011-07-04 19:47:45 +10:00
ckolivas
f490143a9a Add local thread count to info, store hw error count, and make share submission debug only. 2011-07-04 19:47:45 +10:00
Con Kolivas
e016d0c8f3 Increase maximum intensity configurable to 14. 2011-07-04 19:47:45 +10:00
Con Kolivas
dfc52fd543 Make sure we can have gpu and cpu threads running. 2011-07-04 19:47:45 +10:00
Con Kolivas
24a28e29e9 Make it possible to run as a pure cpu miner by setting gpu threads to 0. 2011-07-04 19:47:45 +10:00
ckolivas
e1d01d0635 Minor fixes. 2011-07-04 19:47:45 +10:00
Con Kolivas
6374e0fafe Import the phatk kernel. Enable it only for hardware with amd media ops for now since it crashes nvidia et. al.
Fallback to the poclbm kernel for the rest. Try harder to avoid stale blocks around longpoll detecting new blocks.
2011-07-04 19:47:45 +10:00
Con Kolivas
948b514cf2 The buffer needs to be flushed before enqueueing the kernel again.
Further optimise the mining loop by removing the need_work bool.
2011-07-04 19:47:45 +10:00
Con Kolivas
a45c54aaf8 Make postcalc_hash asynchronous as well. 2011-07-04 19:47:45 +10:00
Con Kolivas
378d18f8eb Submit all work asynchronously via a submit_work thread. 2011-07-04 19:47:45 +10:00
Con Kolivas
612c3a456f Curl doesn't like multiple instances so go back to one instance. 2011-07-04 19:47:45 +10:00
Con Kolivas
f0dcd127b4 Show which cpu mining thread when giving affinity message. 2011-07-04 19:47:45 +10:00
Con Kolivas
58f6bf42e2 Prevent 32bit overflow of local_mhashes as well. 2011-07-04 19:47:45 +10:00
Con Kolivas
00de822534 Upper limit should be -hashes. 2011-07-04 19:47:45 +10:00
Con Kolivas
c29a4322dd Only update the hashmeter once per second from gpu mining threads. 2011-07-04 19:47:45 +10:00
Con Kolivas
063adc6434 Implement runtime selectable numbers of GPU threads and rename CPU threads option. 2011-07-04 19:47:45 +10:00
Con Kolivas
b6ae1db838 The submit_lock is not required nor helpful. 2011-07-04 19:47:45 +10:00
Con Kolivas
d1c0cccdf1 Show correct GPU from thread number. 2011-07-04 19:47:45 +10:00
Con Kolivas
f11149928a Implement a potentially variable number of threads per gpu, setting it to 2 for now. 2011-07-04 19:47:45 +10:00
Con Kolivas
08f56f5f2f Set default CPU threads to 0 if GPU mining. 2011-07-04 19:47:45 +10:00
Con Kolivas
295ef0f9b8 Discard accumulated work when longpoll indicates a new block. 2011-07-04 19:47:45 +10:00
Con Kolivas
f44e8fac12 Curl appears to be not thread safe so only have one curl open at a time. 2011-07-04 19:47:45 +10:00
Con Kolivas
343ae85137 Intensity 5 is too high for a normal desktop causing unacceptable lag so change the default to 4. 2011-07-04 19:47:45 +10:00
Con Kolivas
88e2cf7b34 Initialise libcurl properly. 2011-07-04 19:47:45 +10:00
Con Kolivas
656b485d80 Make the worksize and vector width configurable. 2011-07-04 19:47:45 +10:00
Con Kolivas
ead1281b57 Cleanup of return codes. 2011-07-04 19:47:45 +10:00
Con Kolivas
f6486efb71 Make the getting of work asynchronous from the mining threads requests by always having one work item queued.
This prevents drops in hash rates when getting work from a pool that is slow to respond.
Use a local static struct work in get_work that is used to queue one extra work item.
2011-07-04 19:47:45 +10:00
Con Kolivas
0cef8f8da4 Default scan timeout of 5 seconds is way too short leading to abandoning blocks too early and being seen as an "inefficient" miner. Increase it to 60. 2011-07-04 19:47:45 +10:00