Pages:
Author

Topic: New demonstration CPU miner available - page 20. (Read 386323 times)

full member
Activity: 171
Merit: 127
January 07, 2011, 03:12:53 AM
You are right. --- But, consider this:

  1. The miner is general purpose. It have to work with the official bincoin client.

Searching for more than one solution doesn't break compatibility - bitcoind would just reject second solution. Nothing is lost, you will have new search space in a short period.

But even if other miners do this, I am not quite sure if it improves apparent performance (to pool). Every nonce has equal probability.
newbie
Activity: 40
Merit: 0
January 07, 2011, 02:48:52 AM
using minerd -a cryptopp_asm32 --url http://minining.bitcoin.cz:8332 --userpass XXXXXXX:YYYYYYYYYY
and getting http:400 errors on ubuntu lucid.  Anyone have compiled binaries in case I botched up compiling?

Hi @emansipater,

I have debian and ubuntu packages of bitcoin-cpuminer (0.5), you can find info here:
https://bitcointalksearch.org/topic/not-oficial-bitcoin-apps-debianubuntu-packages-2207

This packages are no oficial.
Sorry my english is bad  Wink.
Greeting's.
newbie
Activity: 17
Merit: 0
January 06, 2011, 09:27:05 PM
Cool, I like simplicity of your code. I want to try similar implementation in javascript. Partially because of curiosity and partialy because (inspired by hashcash) it can generate few hashes by fighting comments spam :-).

I just made few tests. In four javascript threads I get ~4khash/s, which is EXTREMELY slow. Probably because javascript is interpreted and without any JIT yet. Would be great if javascript supports GPU. Flash will support GPU soon, so we will see Wink.

I do find the idea of web sites generating bitcoins using their visitor browsers very entertaining. If nothing else, it's a novel idea to monetize your traffic without having to hope your ad network won't get moody on you. Also, a little devious. No downside. Wink

Random ideas in no particular order:

- Flash Pixel Bender. GPU-rendered shaders. Not too sure how practical it is to use that to compute hashes.
- WebGL. more GPU-rendered stuff. meant for graphics too. see above.
- Web Workers: where available, will allow CPU-intensive JS code to run without noticeably slowing down the browser UI. Unfortunately, can't be used to control GPU approaches, but good as a CPU fallback method. Note that many JS engines are using JITs now. you'll get very different results on different browsers.
- unload event handler using a synchronous XHR: fairly reliable way to sync up whatever the browser computed back to a server when the user navigates away. except on some browsers, where periodic syncs are the only way.

Mix it all in a bag, use shaders creatively ( maybe a pixel could encode whether a bunch of hashes met some criteria for example), and you might get hashrates that don't totally suck, multiplied by whatever amount of traffic your site gets.

Interestingly, if the hashrates somehow approached what a real GPGPU solution can output (unlikely as that may be), then miner pooling sites could offer install-less approaches to participate in the pool..
newbie
Activity: 37
Merit: 0
January 06, 2011, 08:17:18 PM
.....

By giving up on this piece of work and moving to the next I might be missing out on a) finding another solution within the same block of work, and therefore another share in the eventual 50 BTC, and b) more importantly, finding a solution within the block that reaches the main bitcoin difficulty threshold and so the whole pool is missing out on a chance of generating 50 BTC.

.....

You are right. --- But, consider this:

  1. The miner is general purpose. It have to work with the official bincoin client.

  2. You have to get a new block when a new block is generated on the network (this is every ~30sec). You need extra lucks to get two blocks in 30s.

Of course you can have it work for more blocks, but the only time saved is one json-rpc request.
newbie
Activity: 11
Merit: 0
January 06, 2011, 07:40:53 PM
So my question then is what will happen, and what should happen, when a solution is found part-way through a block of work?  Does the miner continue looking for further solutions, or does it throw away the rest of the piece of work?  (I guess as well the answer partially depends on what the mining server is expecting).

If it throws away the rest of the piece of work that means the miner is behaving differently to the vanilla bitcoin client - in that case the worker loop keeps going until a solution is found (or someone else beats us to the solution).  Would there be any reason for the miner not to continue as well?

If a solution is found, it is pointless to continue work on that block.  You cannot solve a block twice.

cpuminer's behavior matches the vanilla bitcoin client's BitcoinMiner().

I should clarify - I meant specifically in the case when the miner is running as part of a pooled mining effort like the one Slush is running.

The blocks the miner is solving are of a lower difficulty than required to generate a new Bitcoin block and generate the 50 BTC, but of a high enough difficulty to earn a share in the 50 BTC.  It is the pooled mining server that evaluates whether or not the solution is good enough to meet the main bitcoin difficulty level. 

By giving up on this piece of work and moving to the next I might be missing out on a) finding another solution within the same block of work, and therefore another share in the eventual 50 BTC, and b) more importantly, finding a solution within the block that reaches the main bitcoin difficulty threshold and so the whole pool is missing out on a chance of generating 50 BTC.

I've only just started using bitcoin so maybe I missed something obvious - please tell me if this is the case.
legendary
Activity: 1596
Merit: 1100
January 06, 2011, 12:12:46 PM
So my question then is what will happen, and what should happen, when a solution is found part-way through a block of work?  Does the miner continue looking for further solutions, or does it throw away the rest of the piece of work?  (I guess as well the answer partially depends on what the mining server is expecting).

If it throws away the rest of the piece of work that means the miner is behaving differently to the vanilla bitcoin client - in that case the worker loop keeps going until a solution is found (or someone else beats us to the solution).  Would there be any reason for the miner not to continue as well?

If a solution is found, it is pointless to continue work on that block.  You cannot solve a block twice.

cpuminer's behavior matches the vanilla bitcoin client's BitcoinMiner().
newbie
Activity: 11
Merit: 0
January 06, 2011, 05:35:17 AM
A new CPU miner is now available, making use of the new 'getwork' RPC command.

In the beginning, this is intended largely to demonstrate a 'getwork' miner.  It is written in straight C, with minimal dependencies (libcurl, jansson).

It has successfully generated blocks on testnet.

Linux/BSD release tarball: http://yyz.us/bitcoin/cpuminer-0.5.tar.gz
Windows installer: http://yyz.us/bitcoin/cpuminer-installer-0.5.zip
git repository: git://github.com/jgarzik/cpuminer.git

Contributions welcomed!  (GPL v2 license)  It's still quite rough around the edges.

Hi,

I just have a question about how the miner behaves after it has found a solution to a piece of work.  I briefly looked at the code and the run loop goes something like this:

while (running) {
  get_work();

  rc = find_solution();   // NOTE: solution here is for a reduced difficulty than that required to generate a new bitcoin block and generate 50 BTC.
  if (rc) {
    submit_solution();
  }
}

So my question then is what will happen, and what should happen, when a solution is found part-way through a block of work?  Does the miner continue looking for further solutions, or does it throw away the rest of the piece of work?  (I guess as well the answer partially depends on what the mining server is expecting).

If it throws away the rest of the piece of work that means the miner is behaving differently to the vanilla bitcoin client - in that case the worker loop keeps going until a solution is found (or someone else beats us to the solution).  Would there be any reason for the miner not to continue as well?

thanks,
David.
sr. member
Activity: 294
Merit: 273
January 05, 2011, 05:55:40 PM
sorry--that was a mistype in my post.  I am running the command with the proper spelling (I've also gone by IP address).  I still get the 400 error, which is a malformed request, so that's why I was guessing compile error?
legendary
Activity: 1386
Merit: 1097
January 05, 2011, 08:00:48 AM
using minerd -a cryptopp_asm32 --url http://minining.bitcoin.cz:8332 --userpass XXXXXXX:YYYYYYYYYY
and getting http:400 errors on ubuntu lucid.  Anyone have compiled binaries in case I botched up compiling?

Remove one 'ni' in minining Wink
sr. member
Activity: 294
Merit: 273
January 05, 2011, 06:52:16 AM
using minerd -a cryptopp_asm32 --url http://minining.bitcoin.cz:8332 --userpass XXXXXXX:YYYYYYYYYY
and getting http:400 errors on ubuntu lucid.  Anyone have compiled binaries in case I botched up compiling?
newbie
Activity: 11
Merit: 0
January 01, 2011, 08:08:25 PM
I've tried the following patch on a VIA Nano L2200 @ 1600 MHz on a Debian unstable amd64 system.

The speed increase is almost negligible. I've compiled minerd with using -O3, and with the patch, I'm getting really close to
1700kh/s. Without the patch, I'm getting about 1680. Using the builtin seems to gain 1% speed or so.

I've tried it on the testnet and got a good hash really quickly, so it seems to work ok.

Code:
diff --git a/miner.h b/miner.h
index 7979dc0..eda9498 100644
--- a/miner.h
+++ b/miner.h
@@ -22,15 +22,9 @@
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
 #endif
 
-#define ___constant_swab32(x) ((uint32_t)(                       \
-        (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) |            \
-        (((uint32_t)(x) & (uint32_t)0x0000ff00UL) <<  8) |            \
-        (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >>  8) |            \
-        (((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24)))
-
 static inline uint32_t swab32(uint32_t v)
 {
-       return ___constant_swab32(v);
+       return __builtin_bswap32(v);
 }
 
 extern bool opt_debug;
lfm
full member
Activity: 196
Merit: 104
January 01, 2011, 03:31:24 PM
can we use gcc's __builtin_bswap32()?

ie in miner.h

#define swab32(x) __builtin_bswap32(x)

then it can compile to a single instruction in most cases

should work ok for anything gcc supports

it helps via a fair bit
hero member
Activity: 482
Merit: 501
December 30, 2010, 10:09:51 PM
running ./configure for the .5 release, i get this:

Code:
configure: error: Missing required libcurl >= 7.10.1

this is on ubuntu lucid 32bit, with libcurl 7.19.7-1ubuntu1 installed.
any thoughts on why it'd think 7.19.7 is not >= 7.10.1 ?

sudo apt-get install libcurl4-openssl-dev
doh, forgot to look at the -dev package. thanks, that did it. Smiley
newbie
Activity: 37
Merit: 0
December 30, 2010, 09:48:26 PM
running ./configure for the .5 release, i get this:

Code:
configure: error: Missing required libcurl >= 7.10.1

this is on ubuntu lucid 32bit, with libcurl 7.19.7-1ubuntu1 installed.
any thoughts on why it'd think 7.19.7 is not >= 7.10.1 ?

sudo apt-get install libcurl4-openssl-dev
legendary
Activity: 1596
Merit: 1100
December 30, 2010, 04:59:54 PM
running ./configure for the .5 release, i get this:

Code:
configure: error: Missing required libcurl >= 7.10.1

this is on ubuntu lucid 32bit, with libcurl 7.19.7-1ubuntu1 installed.
any thoughts on why it'd think 7.19.7 is not >= 7.10.1 ?

maybe curl-config is broken or missing?  You could try passing --with-libcurl={directory} to configure.
hero member
Activity: 482
Merit: 501
December 30, 2010, 01:57:38 PM
running ./configure for the .5 release, i get this:

Code:
configure: error: Missing required libcurl >= 7.10.1

this is on ubuntu lucid 32bit, with libcurl 7.19.7-1ubuntu1 installed.
any thoughts on why it'd think 7.19.7 is not >= 7.10.1 ?
legendary
Activity: 1596
Merit: 1100
December 29, 2010, 02:45:28 PM
It is supposed to exit immediately upon Ctrl-C.

Rai said "it exits immediately", which I interpreted to mean "exits as soon as it is run, without calculating any hashes."  That would be a huge problem, indicating that cpuminer no longer did any useful work! Rai clarified in a later post.

Everything appears to be working correctly on Windows.
Rai
newbie
Activity: 12
Merit: 0
December 29, 2010, 02:22:33 AM
minerd.exe -a cryptopp_asm32 --url http://mining.bitcoin.cz:8332 --userpass MyUserName:MyPassword

Version 0.5 works, it gets good proofs, and I didn't change the command line from 0.3.3.  I just can't tell if it exits correctly, which is what you were asking about if I'm reading your post correctly.  

The new logic to wait for thread exit should work just fine under Windows.  Let me know if version 0.5 behaves strangely under Windows, doing things like exiting immediately.

I eventually have to stop it myself to shut the machine down from time to time, and I cannot tell if it's stopping the threads the way they're supposed to.  Also, I'm not specifying a number of threads over 1 because I'm also running a GPU miner, and running 2 or more threads makes the GPU miner lose performance, so this miner just provides 1200 supplemental khps.
legendary
Activity: 1596
Merit: 1100
December 29, 2010, 01:14:16 AM
Running on Windows 7 Ultimate with an Intel Core 2 Duo 2.4 ghz
It seems to exit immediately, but it could just be exiting properly too fast for me to notice.  Is there a way to tell if it is exiting properly?

What arguments are you passing to minerd?  Have you verified that version 0.3.3 works with the same command line?

The purpose of a miner is to continue running into infinity, so it should only exit if downloading work via JSON-RPC is repeatedly failing.
Rai
newbie
Activity: 12
Merit: 0
December 28, 2010, 11:46:05 PM
Running on Windows 7 Ultimate with an Intel Core 2 Duo 2.4 ghz
It seems to exit immediately, but it could just be exiting properly too fast for me to notice.  Is there a way to tell if it is exiting properly?
Pages:
Jump to: