Bitcoin Forum
December 30, 2024, 11:01:41 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [20] 21 22 23 24 25 26 »
  Print  
Author Topic: New demonstration CPU miner available  (Read 386324 times)
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 03:00:25 AM
 #381

Yeah, I figured you were just doing some optimizations.  But I've learned that sometimes things get accidentally fixed while meaning to change something else.  So wanted to cover that base.  I'm about to attempt a compilation with MinGW to see if I can get a better compile than I already have by playing around with some options such as removing frame pointers, enabling other SSE specific optimizations and the like.  I hope to end with a 64-bit Windows compatible compile, but who knows.  I was also contemplating a different method of calculating the hashes by having two or more cores working on the same hash and giving each a specific job to complete.  By breaking it down, I'm hoping it might put the cpu/gpu's memory to good use while decreasing latency between instructions.  The main issue I know of is having one task taking longer than another and needing to optimize the timings of when one core should help another to fill the buffer and then switch back to its task.  A sort of CPU/GPU buffer under run protection so to speak.  But the biggest issue is I have no idea how to start coding it.  It screams assembly.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
-ck
Legendary
*
Offline Offline

Activity: 4340
Merit: 1650


Ruu \o/


View Profile WWW
June 09, 2011, 03:08:06 AM
 #382

This is why I started hacking on jgarzik's one instead. The c code in it is much more what I'm familiar with and I've dealt with Jeff before Smiley The other cpuminer is the one with the assembly code.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 03:47:04 AM
 #383

Yeah, but what I'm talking about is a different approach I believe.  Mine actually depends on multiple cores or hyperthreading doing different tasks to work as opposed to multiple threads doing the same thing.  If one core falls behind in its work, the other paired core will begin to assist it until the buffer is around 50% before returning to its own task.  But I don't think I can code it.  I know what I want it to do, I just don't know how to tell it if that makes sense.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
xf2_org
Member
**
Offline Offline

Activity: 98
Merit: 13


View Profile
June 09, 2011, 03:58:34 AM
 #384

Yeah, but what I'm talking about is a different approach I believe.  Mine actually depends on multiple cores or hyperthreading doing different tasks to work as opposed to multiple threads doing the same thing.  If one core falls behind in its work, the other paired core will begin to assist it until the buffer is around 50% before returning to its own task.  But I don't think I can code it.  I know what I want it to do, I just don't know how to tell it if that makes sense.

There is no buffer.  Mining is updating a single 32-bit value, and then restarting sha256(sha256(data)) algorithm

You can get 1 work, and tell multiple threads to work on that if you'd like.  It would reduce load on the upstream server a bit, but seems like too much complexity for too little gain.

d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 04:37:43 AM
 #385

I'm not actually certain that the gain would be so small.  If you look at the process of loading and unloading data and how many instruction sets are sent and processed by each core separately, it could offer a modest improvement in speed.  It could also speed-up confirmation times and get smaller results back to the RPC quicker for verification.  It shifts the focus from trying to get multiple results done in time to be sent before the next block, to ensuring that each result gets done and sent quickly giving yourself the possible edge in time.
And it could be that I'm misunderstanding how mining occurs exactly, but all ideas have some value even if they're a bad one.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
xf2_org
Member
**
Offline Offline

Activity: 98
Merit: 13


View Profile
June 09, 2011, 05:32:35 AM
 #386

It is open source.  Nobody said you were not free to experiment Smiley
-ck
Legendary
*
Offline Offline

Activity: 4340
Merit: 1650


Ruu \o/


View Profile WWW
June 09, 2011, 06:28:52 AM
 #387

JG if you comment out the sysconf for windows you'll have to set a default value for opt_n_threads on windows since it's now zero.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 11:22:40 AM
 #388

Yeah, I'll have to experiment with it once I get a few books to help me figure out how.  But first I have to get the original source code working.  Any ideas on what's going wrong above?

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
-ck
Legendary
*
Offline Offline

Activity: 4340
Merit: 1650


Ruu \o/


View Profile WWW
June 09, 2011, 11:26:49 AM
 #389

Yeah, I'll have to experiment with it once I get a few books to help me figure out how.  But first I have to get the original source code working.  Any ideas on what's going wrong above?

You have jansson installed and it's an incompatible version with what cpuminer uses? You don't need jansson installed to make it build since it's included in the cpuminer code tarball. Try uninstalling your own version of jansson.

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 01:03:31 PM
 #390

Yeah, I'll have to experiment with it once I get a few books to help me figure out how.  But first I have to get the original source code working.  Any ideas on what's going wrong above?

You have jansson installed and it's an incompatible version with what cpuminer uses? You don't need jansson installed to make it build since it's included in the cpuminer code tarball. Try uninstalling your own version of jansson.
Actually, it's not my own version, I used the repository that Jansson setup.  But I'll give it a try without Jansson installed to see if any similar errors should arise.  Thank you!  I'll keep you posted.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
blap
Newbie
*
Offline Offline

Activity: 51
Merit: 0


View Profile
June 09, 2011, 01:06:04 PM
 #391

 Grin
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 01:30:17 PM
 #392

Code:
make  all-recursive
make[1]: Entering directory `/home/d337z/Desktop/cpuminer-1.0.1a'
Making all in compat
make[2]: Entering directory `/home/d337z/Desktop/cpuminer-1.0.1a/compat'
make[3]: Entering directory `/home/d337z/Desktop/cpuminer-1.0.1a/compat'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/d337z/Desktop/cpuminer-1.0.1a/compat'
make[2]: Leaving directory `/home/d337z/Desktop/cpuminer-1.0.1a/compat'
Making all in x86_64
make[2]: Entering directory `/home/d337z/Desktop/cpuminer-1.0.1a/x86_64'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/d337z/Desktop/cpuminer-1.0.1a/x86_64'
make[2]: Entering directory `/home/d337z/Desktop/cpuminer-1.0.1a'
gcc -DHAVE_CONFIG_H -I. -pthread -fno-strict-aliasing    -DHAS_YASM -g -O3 -msse2 -MT cpu-miner.o -MD -MP -MF .deps/cpu-miner.Tpo -c -o cpu-miner.o cpu-miner.c
cpu-miner.c:27:21: fatal error: jansson.h: No such file or directory
compilation terminated.
make[2]: *** [cpu-miner.o] Error 1
make[2]: Leaving directory `/home/d337z/Desktop/cpuminer-1.0.1a'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/d337z/Desktop/cpuminer-1.0.1a'
make: *** [all] Error 2

Now it just won't find it.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 01:37:31 PM
 #393

Wait!  We have win!  I entered the Jansson directory I first used to compile with and ran "sudo make uninstall" and it seems to have done the trick.  Thank you!

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 01:46:05 PM
 #394

Words to the wise, CPUminer is incompatible with Jansson 2.0.1 so use what's included and hope it works.  ^_^

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
-ck
Legendary
*
Offline Offline

Activity: 4340
Merit: 1650


Ruu \o/


View Profile WWW
June 09, 2011, 01:57:35 PM
 #395

Yeah when I said your own version, I hadn't really envisioned that you'd programmed your own jansson library Wink

Glad to see you got it going. Now see how you go Smiley

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 02:19:37 PM
 #396

Oh, I meant self-compiled vs. precompiled.  The repository version is 2.0.1 as of now under synaptic (when you add the repository to the list).  So the problem is either with 2.0.1 or updating the code to allow for 2.0.1 to be used.  It looks like jansson was wanting some extra commands that weren't required previously or just had a different syntax.  But it's unimportant since a compatible version is included with cpuminer anyway.
On a semi-related note, I'm achieving an entire Mhash/sec higher than I was in Windows using bitcoinminer which appeared to have the fastest rate on a Winbox via CPU usage at the time.  I don't know what effects including -march=core2 -mmmx -msse -msse3 -mssse3 and -fomit-frame-pointer has had on my compilation, but the program is working flawlessly so far.  I'll try a comparison to see if there's any difference in hashes/sec with different options outside of -march=native/core2.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
-ck
Legendary
*
Offline Offline

Activity: 4340
Merit: 1650


Ruu \o/


View Profile WWW
June 09, 2011, 02:26:00 PM
 #397

Is this with the version I posted? The CPU affinity that I added can have quite strong effects on certain hardware and kernels (comparing different linux kernels and windows especially) if the kernels aren't particularly good at soft affinity effects. Having spent most of my spare time coding CPU schedulers I obsess about these things...

Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel
2% Fee Solo mining at solo.ckpool.org
-ck
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 04:35:37 PM
 #398

Actually, yes it was.  However, I noticed very little difference in the speeds of the two.  But kudos!  It compiles and runs.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
ancow
Full Member
***
Offline Offline

Activity: 373
Merit: 100


View Profile WWW
June 09, 2011, 05:45:07 PM
 #399

The new changes seem to work rather well on my 64bit linux. However, since some of the usage texts are now incorrect, I'd like to suggest the following patch:
Code:
--- cpuminer-git/cpu-miner.c    2011-06-09 16:58:43.137777002 +0200
+++ cpuminer_build/cpu-miner.c  2011-06-09 19:25:52.087777001 +0200
@@ -140,24 +140,28 @@
          "(-h) Display this help text" },
 
        { "config FILE",
-         "(-c FILE) JSON-format configuration file (default: none)\n"
+         "(-c FILE) JSON-format configuration file (default: none)\n\t"
          "See example-cfg.json for an example configuration." },
 
        { "algo XXX",
          "(-a XXX) Specify sha256 implementation:\n"
-         "\tc\t\tLinux kernel sha256, implemented in C (default)"
+#ifdef WANT_X8664_SSE2
+         "\t\tc\t\tLinux kernel sha256, implemented in C"
+#else
+         "\t\tc\t\tLinux kernel sha256, implemented in C (default)"
+#endif
 #ifdef WANT_SSE2_4WAY
-         "\n\t4way\t\ttcatm's 4-way SSE2 implementation"
+         "\n\t\t4way\t\ttcatm's 4-way SSE2 implementation"
 #endif
 #ifdef WANT_VIA_PADLOCK
-         "\n\tvia\t\tVIA padlock implementation"
+         "\n\t\tvia\t\tVIA padlock implementation"
 #endif
-         "\n\tcryptopp\tCrypto++ C/C++ implementation"
+         "\n\t\tcryptopp\tCrypto++ C/C++ implementation"
 #ifdef WANT_CRYPTOPP_ASM32
-         "\n\tcryptopp_asm32\tCrypto++ 32-bit assembler implementation"
+         "\n\t\tcryptopp_asm32\tCrypto++ 32-bit assembler implementation"
 #endif
 #ifdef WANT_X8664_SSE2
-         "\n\tsse2_64\t\tSSE2 implementation for x86_64 machines"
+         "\n\t\tsse2_64\t\tSSE2 implementation for x86_64 machines (default)"
 #endif
          },
 
@@ -191,7 +195,11 @@
 #endif
 
        { "threads N",
+#ifdef WIN32
          "(-t N) Number of miner threads (default: 1)" },
+#else
+         "(-t N) Number of miner threads (default: #available cpus)" },
+#endif
 
        { "url URL",
          "URL for bitcoin JSON-RPC server "
@@ -753,7 +761,7 @@
                struct option_help *h;
 
                h = &options_help[i];
-               printf("--%s\n%s\n\n", h->name, h->helptext);
+               printf("--%s\n\t%s\n\n", h->name, h->helptext);
        }
 
        exit(1);

Summary of changes:
  • tabs before description items to improve readability
  • the default algorithm is now marked correctly
  • on Linux, it now says "default: #available cpus" instead of just "default: 1" (if anyone knows how to insert the actual numer here, be my guest)

BTC: 1GAHTMdBN4Yw3PU66sAmUBKSXy2qaq2SF4
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 09, 2011, 05:58:58 PM
 #400

I agree with your changes.  I think the default should be the maximum number of CPUs on board.  The default wasn't the SSE2_64?  Hmm, good thing I set that then.
But I don't think I've ever seen Via padlock not crash the program on start.  Does it actually have a use?  If no, it could be edited out until then.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [20] 21 22 23 24 25 26 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!