New demonstration CPU miner available

8 messages BitcoinTalk Jeff Garzik, Satoshi Nakamoto, BitLex November 25, 2010 — November 27, 2010
Jeff Garzik (jgarzik) November 25, 2010 00:45 UTC Source ·

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, mainnet and almost all pools.

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

Contributions welcomed! (GPL v2 license)

UPDATE: This has largely been superceded by Con Kolivas’s cgminer fork. See cgminer’s official forum thread for updates and details.

Jeff Garzik (jgarzik) November 26, 2010 19:47 UTC Source ·

FWIW, the default bitcoin miner also does this — it just doesn’t print out when it “finds some zeroes”, only when a real proof of work is found.

Thus, my CPU miner always shows when it stops working on a solution, and starts working on a new solution. Just giving you a bit more information on the whole process.

Jeff Garzik (jgarzik) November 26, 2010 21:32 UTC Source ·

Attached is a Windows executable build with mingw32. I’d be interested to know if it works.

run “minerd.exe —help” or “minerd.exe -h” to show command line options.

minerd.exe SHA-1 sum: 722fa3b956de3ed3438ed3294fe191f0d55c1514 minerd.exe MD5 sum: 9f75f8da7a5d02da1d45d46d4a032489

Satoshi Nakamoto November 26, 2010 22:02 UTC Source ·

You should try it with tcatm’s 4-way SSE2 SHA in sha256.cpp.  It compiles fine as a C file, just rename sha256.cpp to sha256.c.  I was able to get it to work in simple tests on Windows, but not when linked in with Bitcoin.  It may have a better chance of working as part of a C program instead of C++.

Currently it’s only enabled in the Linux build, so if you get it to work you could make it available to Windows users.  It’s about 100% speedup on AMD CPUs.

Jeff Garzik (jgarzik) November 26, 2010 23:03 UTC Source ·
Quote from: satoshi on November 26, 2010, 10:02:41 PM UTC

You should try it with tcatm’s 4-way SSE2 SHA in sha256.cpp. It compiles fine as a C file, just rename sha256.cpp to sha256.c. I was able to get it to work in simple tests on Windows, but not when linked in with Bitcoin. It may have a better chance of working as part of a C program instead of C++.

I’ll take a look. VIA Padlock support may also be similarly easy to integrate.

BitLex November 26, 2010 23:27 UTC Source ·

I’d be interested to see how well this works on Vista, XP, 7, …complaining about “libcurl-4.dll missing” (although it’s there at c:\CPU-miner\usr\i686-pc-mingw32\sys-root\mingw\bin) it won’t even start on 64bit XP&7, 32bit XP,

am i missing something?

Jeff Garzik (jgarzik) November 27, 2010 00:06 UTC Source ·
Quote from: BitLex on November 26, 2010, 11:27:55 PM UTC

I’d be interested to see how well this works on Vista, XP, 7, …complaining about “libcurl-4.dll missing” (although it’s there at c:\CPU-miner\usr\i686-pc-mingw32\sys-root\mingw\bin) it won’t even start on 64bit XP&7, 32bit XP, am i missing something?

Try adding c:\CPU-miner\usr\i686-pc-mingw32\sys-root\mingw\bin\ to your PATH, then run minerd.exe?

Jeff Garzik (jgarzik) November 27, 2010 00:09 UTC Source ·
Quote from: satoshi on November 26, 2010, 10:02:41 PM UTC

You should try it with tcatm’s 4-way SSE2 SHA in sha256.cpp.

Added. Users may select this by enabling SSE2 instructions in their compiler during build, and then

$ minerd --algo=4way

will select the 4way implementation, rather than the default ‘c’ implementation. Run “minerd —help” to make sure 4way is listed as an available option first; if not, you did not build with SSE2 enabled (-msse2, or many values of -march=xxx).