Pages:
Author

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

legendary
Activity: 1386
Merit: 1097
December 19, 2010, 07:04:56 AM
#74
I made an infinite loop but it might be a good idea to set up a retry counter.
Code:
             val = json_rpc_call(rpc_url, userpass, rpc_req);
             if (!val) {
                           fprintf(stderr, "json_rpc_call failed. sleeping 60s\n");
                           sleep(60);
                          }

I'm not so familiar with miner sources, but don't forget server can sometimes return 'false' when PoW not meet server's target. Doesn't your patch deadlock script for ages in this case?
full member
Activity: 238
Merit: 100
December 19, 2010, 05:07:12 AM
#73
Could you post an example, please?

I made an infinite loop but it might be a good idea to set up a retry counter.
Code:
          /* obtain new work from bitcoin */
             do {
             val = json_rpc_call(rpc_url, userpass, rpc_req);
             if (!val) {
                           fprintf(stderr, "json_rpc_call failed. sleeping 60s\n");
                           sleep(60);
                          }
             } while (!val);

You should also do the same around fprintf("submit_work json_rpc_call failed\n") with maybe a shorter sleep(10).
hero member
Activity: 566
Merit: 500
Unselfish actions pay back better
December 19, 2010, 03:30:57 AM
#72
Code:
             val = json_rpc_call(rpc_url, userpass, rpc_req);
             if (!val) {
             fprintf(stderr, "json_rpc_call failed\n");
             return NULL;
            }
If there is a network or server problem, the client will fail and it happens quite frequently with pooled mining. I changed return NULL; to some sleep and
put it in a loop to wait until the network is up again. After such modification (and similar in submit_work) the client survived several server restarts.
Could you post an example, please?

Cheers,
Klaus
hero member
Activity: 566
Merit: 500
Unselfish actions pay back better
December 18, 2010, 04:50:05 PM
#71
I started mining with cpuminer/minerd a few days ago, and to keep the dæmon in the air I'm using Gerrit Pape's “runit” (an equivalent to DJB's dæmontools).  However, since stdout is fully buffered by default I don't see any informative output until stdout's buffer is full.  By making stdout line buffered each HashMeter line can be read as it happens.  Here's a tiny patch:

Code:
diff --git a/cpu-miner.c b/cpu-miner.c
index 5371296..82c1355 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -402,6 +402,7 @@ static void parse_cmdline(int argc, char *argv[])
 int main (int argc, char *argv[])
 {
  int i;
+        int dummy = setvbuf(stdout, (char *) NULL, _IOLBF, 0);
 
  /* parse command line */
  parse_cmdline(argc, argv);

Cheers,
legendary
Activity: 1596
Merit: 1100
December 18, 2010, 04:44:49 PM
#70
Note that older versions are moved, with each new release, to http://yyz.us/bitcoin/old/
legendary
Activity: 1596
Merit: 1100
December 18, 2010, 04:35:39 PM
#69
New version 0.3 released (see top post for URLs).

Changes:
  • Add crypto++ 32bit assembly implementation
  • show version upon 'minerd --help'
  • work around gcc 4.5.x bug that killed 4way performance

SHA1: e748faf3272a766f6de3e99ad1b6e434a0f3d023  cpuminer-installer-0.3.zip
MD5: c1fc335c2548afa726ac49871ff73d08  cpuminer-installer-0.3.zip
LZ
legendary
Activity: 1722
Merit: 1072
P2P Cryptocurrency
December 18, 2010, 02:54:44 PM
#68
HP Mini 2133 (1 thread)
--algo c ~140-150 khps
--algo 4way ~165-175 khps
--algo via ~800-1200 khps
--algo cryptopp ~115-125 khps

It's great! Thanks! Cheesy
full member
Activity: 238
Merit: 100
December 18, 2010, 08:28:51 AM
#67
I like the miner for its simplicity (and is also a bit faster than standard bitcoin program).

While using this miner in the pooled mining I came across a few problems and I'd like to offer suggestions.

First one is in the code that reads the work
Code:
             val = json_rpc_call(rpc_url, userpass, rpc_req);
             if (!val) {
             fprintf(stderr, "json_rpc_call failed\n");
             return NULL;
            }
If there is a network or server problem, the client will fail and it happens quite frequently with pooled mining. I changed return NULL; to some sleep and
put it in a loop to wait until the network is up again. After such modification (and similar in submit_work) the client survived several server restarts.

Another suggestion is in the 4way code. The code will not compile with Intel Compiler due to non-standard use of bit operations. If you change the lines that define macros to:

Code:
static inline __m128i Ch(const __m128i b, const __m128i c, const __m128i d) {
    return _mm_xor_si128(_mm_and_si128(b,c),_mm_andnot_si128(b,d));
}

static inline __m128i Maj(const __m128i b, const __m128i c, const __m128i d) {
    return _mm_xor_si128(_mm_xor_si128(_mm_and_si128(b,c),_mm_and_si128(b,d)),_mm_and_si128(c,d));
}

static inline __m128i ROTR(__m128i x, const int n) {
    return _mm_or_si128(_mm_srli_epi32(x, n),_mm_slli_epi32(x, 32 - n));
}

static inline __m128i SHR(__m128i x, const int n) {
    return _mm_srli_epi32(x, n);
}

/* SHA256 Functions */
#define BIGSIGMA0_256(x)    (_mm_xor_si128(_mm_xor_si128(ROTR((x), 2),ROTR((x), 13)),ROTR((x), 22)))
#define BIGSIGMA1_256(x)    (_mm_xor_si128(_mm_xor_si128(ROTR((x), 6),ROTR((x), 11)),ROTR((x), 25)))


#define SIGMA0_256(x)       (_mm_xor_si128(_mm_xor_si128(ROTR((x), 7),ROTR((x), 18)), SHR((x), 3 )))
#define SIGMA1_256(x)       (_mm_xor_si128(_mm_xor_si128(ROTR((x),17),ROTR((x), 19)), SHR((x), 10)))
it will compile with both gcc and icc. I hoped for a significant speed-up but for me Intel compiler is only about 10% faster on only one of my machines (Core i5) and slower on Core 2 and Opteron.  Nevertheless, the code is more universal. Isn't a similar code used also in the main bitcoin cruncher?

Last issue is very mysterious and I may have come across a strange race-condition bug in GLIBC (or something else) on my Cent OS. The program randomly segfaulted in multithreaded mode while working fine in single-threaded one and working OK on my another Ubuntu machine. Long story short, it seems it was related in name resolving and  I (hopefully) solved the problem by compiling libcurl with --enable-ares, which uses an asynchronous name resolution.
legendary
Activity: 1596
Merit: 1100
December 17, 2010, 01:02:08 AM
#66
Updated first post with a release tarball for Linux/BSD, so that people don't have to bother with autotools and the git repo.

Recommend avoiding gcc 4.5.x at the moment.
legendary
Activity: 1596
Merit: 1100
December 16, 2010, 10:27:08 PM
#65
when I run this I get a json_rpc_call failed, does anyone know why?

The miner is unable to connect to the URL you gave it, for some reason.


Quote from: slush
Hi jgarzik, as I promised somewhere on this forum, I'm sending you my first reward from cooperative mining, because your code helped me a lot to understand, how mining works inside. So 38 BTC is yours, enjoy :-).

Thanks!
legendary
Activity: 1386
Merit: 1097
December 16, 2010, 10:23:01 PM
#64
Hi jgarzik, as I promised somewhere on this forum, I'm sending you my first reward from cooperative mining, because your code helped me a lot to understand, how mining works inside. So 38 BTC is yours, enjoy :-).
newbie
Activity: 19
Merit: 0
December 16, 2010, 09:13:02 PM
#63
when I run this I get a json_rpc_call failed, does anyone know why?
newbie
Activity: 19
Merit: 0
December 16, 2010, 01:40:26 PM
#62
Quote from: Azetab
i need a portable file to run on certain computers
just "install" it once and copy the folder to your thumbdrive, works fine for me (note that i only used 0.2.1, newer versions slow 4way down on my phenomX3).

oh didnt know i could do that thanks!
hero member
Activity: 532
Merit: 505
December 16, 2010, 01:16:11 PM
#61
Quote from: Azetab
i need a portable file to run on certain computers
just "install" it once and copy the folder to your thumbdrive, works fine for me (note that i only used 0.2.1, newer versions slow 4way down on my phenomX3).
newbie
Activity: 19
Merit: 0
December 16, 2010, 01:11:41 PM
#60
hey, can someone upload a binary zip version of the cpu miner?
pc
sr. member
Activity: 253
Merit: 250
December 12, 2010, 10:19:26 PM
#59
I've compiled a binary for 64-bit Intel Mac and have it posted at http://dl.dropbox.com/u/16187822/minerd

It gives better performance than the native Bitcoin client on CPU generation, and even better with 4way on my system that has a processor that supports it. I couldn't get 4way to work in the native Bitcoin client, so I'm glad that I've got a chance to use it. It's not enough to compete with some of those GPU monsters, but every hash counts, right?
newbie
Activity: 40
Merit: 0
December 11, 2010, 01:34:44 AM
#58
Hi,

I created a debian/ubuntu package from this app, if somebody will like test or support this package, give feedbacks here:
https://bitcointalksearch.org/topic/not-oficial-bitcoin-apps-debianubuntu-packages-2207

Sorry my english is bad.
Greeting's.
legendary
Activity: 1386
Merit: 1097
December 07, 2010, 09:49:40 AM
#57
Thanks. I tried to find solution here before post, but missed this comment  Roll Eyes
Scroll up to this post, in the current thread.  Your libcurl devel pkg is missing, or your libcurl devel pkg is missing autoconf macros.
legendary
Activity: 1596
Merit: 1100
December 07, 2010, 03:56:00 AM
#56
Hi jgarzik, getting problem with configure on pretty old CentOS 5. Any idea, please?  Roll Eyes

Quote
./configure: line 4516: `LIBCURL_CHECK_CONFIG(, 7.10.1, ,'

Scroll up to this post, in the current thread.  Your libcurl devel pkg is missing, or your libcurl devel pkg is missing autoconf macros.
legendary
Activity: 1386
Merit: 1097
December 07, 2010, 03:41:47 AM
#55
Hi jgarzik, getting problem with configure on pretty old CentOS 5. Any idea, please?  Roll Eyes

Quote
[root@virt10 jgarzik-cpuminer-080ddb6]# ./autogen.sh
[root@virt10 jgarzik-cpuminer-080ddb6]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...
checking pkg-config is at least version 0.9.0... yes
./configure: line 4516: syntax error near unexpected token `,'
./configure: line 4516: `LIBCURL_CHECK_CONFIG(, 7.10.1, ,'
Pages:
Jump to: