Bitcoin Forum
April 23, 2024, 06:19:22 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 5 6 7 8 »  All
  Print  
Author Topic: [XPM] CUDA enabled qt client miner for primecoins. Source code inside. WIP  (Read 31713 times)
primedigger (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10


View Profile
July 19, 2013, 12:40:42 PM
Last edit: January 07, 2014, 06:55:52 PM by primedigger
 #1

The amount of greed surrounding a possible GPU primecoin miner seems to be phenomenal.
Too many people seem to fall for "send me bitcoin and get early access". Sorry, but soliciting payment for early access is just dirty.

Let stop that bullshit - I'm going to share my code, even though my miner isn't fully functional right now (but I think I've already taken it quite far).

Github link: http://github.com/primedigger/primecoin

I repeat, THE CODE DOESN'T RUN CORRECTLY CURRENTLY AND CRASHES, this is just for developers who want to join and help and to show that there is a transparent development.

My general plan for porting this to CUDA:

I couldn't get getblocktemplate to work, so I added CUDA directly to the qt-client.  
Let the CPU handle the candidate search, candidates get send to the GPU and the GPU acts as a co-processor that only does "ProbablePrimeChainTest" very fast. This makes it easier to have a proof-of-concept GPU miner soon.

What I did so far :

I started with the latest high performance client (hp4).

- Ported the code path in "ProbablePrimeChainTest" so that it runs with pure mpz_t like functions and minimised the number of functions that are needed. I compiled this successfully against the big integer library in https://github.com/dmatlack/cuda-rsa.

- Changed code in "MineProbablePrimeChain" so that candidates are collected for ProbablePrimeChainTest. I made sure to measure that candidate collection is much faster than testing them in "ProbablePrimeChainTest" and this will put a theoretical limit on the speed up. If I didn't do a mistake while measuring it, the upper limit is somwhere in the 100x-1000x range. So this should be a viable approach.

- Candidates are transfered to the GPU as hex char* strings. The big integer library in cuda-rsa has "mpz_set_str", but unfortunately that doesn't work on the GPU as of now. It might be better to produce the mpz format that the GPU needs directly on the CPU instead of parsing strings. Note: Later on, transfers to the GPU can be made async, so that CPU and GPU mine in tandem.

(I also changed the sieve of Erastothenes to sieve of Atkin - I had that code flying around anyway - , but that has nothing to do with the GPU.)

The hardest part is having a reliable big integer library for CUDA. Thats why there is no working GPU miner yet. The one in https://github.com/dmatlack/cuda-rsa needs more testing and someone could work on this independently from this project. It was the best library I could find for big integer+modulo arithmetic. If you know a better one let me know.

What I like: One way or another we will end up with a highly optimised big integer library for GPUs. That is something big on its own!

 Stop sending your money to someone claiming to give you early access - my guess, the first functional GPU miners won't be very fast anyway (e.g. single digit speedup compared to hp4). An unoptimised big integer library won't outperform GMP by much.
 
P.s. You should call the binary with "-printtoconsole -printmining -testnet" to debug. Also I'm developing this under linux 64bit with standard paths. I only updated the qtcreator project file, so if you have CUDA working under a 64bit linux you should be able to build the project with qtcreator.
1713853162
Hero Member
*
Offline Offline

Posts: 1713853162

View Profile Personal Message (Offline)

Ignore
1713853162
Reply with quote  #2

1713853162
Report to moderator
1713853162
Hero Member
*
Offline Offline

Posts: 1713853162

View Profile Personal Message (Offline)

Ignore
1713853162
Reply with quote  #2

1713853162
Report to moderator
1713853162
Hero Member
*
Offline Offline

Posts: 1713853162

View Profile Personal Message (Offline)

Ignore
1713853162
Reply with quote  #2

1713853162
Report to moderator
No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713853162
Hero Member
*
Offline Offline

Posts: 1713853162

View Profile Personal Message (Offline)

Ignore
1713853162
Reply with quote  #2

1713853162
Report to moderator
1713853162
Hero Member
*
Offline Offline

Posts: 1713853162

View Profile Personal Message (Offline)

Ignore
1713853162
Reply with quote  #2

1713853162
Report to moderator
1713853162
Hero Member
*
Offline Offline

Posts: 1713853162

View Profile Personal Message (Offline)

Ignore
1713853162
Reply with quote  #2

1713853162
Report to moderator
bidji29
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
July 19, 2013, 12:50:36 PM
 #2

Thanks for sharing

http://www.freebieservers.com/  100% FREE GAME SERVERS
tomtommy
Full Member
***
Offline Offline

Activity: 120
Merit: 100



View Profile
July 19, 2013, 12:51:22 PM
 #3

+1
junglist.massive
Hero Member
*****
Offline Offline

Activity: 759
Merit: 500



View Profile
July 19, 2013, 12:58:47 PM
 #4

lets try it
Chemisist
Member
**
Offline Offline

Activity: 99
Merit: 10



View Profile
July 19, 2013, 01:06:35 PM
 #5

Thanks for sharing!  Looking through your Weave() algo, might want to replace the "break" in line 841 with a "return false" since if a new block is detected, I'm pretty sure you'd want to terminate the Weave() algo immediately.

btc 1ChemaH12nRmd75M8BmPSiqd8x7B2wxFNF     ltc LaWX7jgJDyQ2oFaQYJvo5kqC1e1KYPoCfd     xpm Ab8NSgxHgGUJvHgSHYqMYBMWai6ZdsA91s
Vorksholk
Legendary
*
Offline Offline

Activity: 1713
Merit: 1029



View Profile WWW
July 19, 2013, 01:19:17 PM
 #6

Awesome Cheesy Send 50 Primecoins you way.

VeriBlock: Securing The World's Blockchains Using Bitcoin
https://veriblock.org
TheSwede75
Full Member
***
Offline Offline

Activity: 224
Merit: 100



View Profile
July 19, 2013, 01:21:03 PM
 #7

Accepting donations for "early access" is about as close to an outright scam as you can get, and I NEVER expected the person behind reaper etc. to pull something as cheap.
Vorksholk
Legendary
*
Offline Offline

Activity: 1713
Merit: 1029



View Profile WWW
July 19, 2013, 01:25:40 PM
 #8

Accepting donations for "early access" is about as close to an outright scam as you can get, and I NEVER expected the person behind reaper etc. to pull something as cheap.

It's essentially buying software. People give him money, he gives them a product. Anyone is perfectly entitled to buy, the only prerequisite is one Bitcoin, or less than $100. People in many fields purchase software and make money from the product of the software, think CAD, think Graphics Design, think electrical engineering, think multimedia...

Everyone freaks out when someone doesn't do something for free, it's a bit sad. The project will be released free, but for those who want early access, they can buy the software. He's selling a product. And taking pre-orders.

EDIT: Also, a 'scam' is generally when the person who pays money doesn't get a product. Sure we can't prove this is the true reaper developer, but if it is (and chances are high!), then it won't be a 'scam,' but rather not giving the software away to everyone. He wants to be paid for his work, but he still wants to be able to release the software as open source and support it as freeware. Mrtlt has earned like 21 Bitcoins, or around $2,000 for his efforts. If it takes him just 40 hours to develop the software, he's getting paid less than most top-notch programmers.

VeriBlock: Securing The World's Blockchains Using Bitcoin
https://veriblock.org
Stalast
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
July 19, 2013, 01:29:48 PM
 #9

This guy. This guy is a good person.
mikaelh
Sr. Member
****
Offline Offline

Activity: 301
Merit: 250


View Profile
July 19, 2013, 01:35:09 PM
 #10

Oh, wow. You integrated CUDA code into the Primecoin client. I'll take a closer look later. Maybe I can even get it working. Wink
ig0tik3d
Legendary
*
Offline Offline

Activity: 1246
Merit: 1000



View Profile
July 19, 2013, 01:38:41 PM
 #11

Oh, wow. You integrated CUDA code into the Primecoin client. I'll take a closer look later. Maybe I can even get it working. Wink
"In mikaelh We Trust" ))
vingaard
Legendary
*
Offline Offline

Activity: 1246
Merit: 1011



View Profile
July 19, 2013, 02:03:01 PM
 #12

Thanks  Wink
mustyoshi
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile
July 19, 2013, 02:04:09 PM
 #13

Using GPU for primality testing is the logical first step.
billotronic
Legendary
*
Offline Offline

Activity: 1610
Merit: 1000


Crackpot Idealist


View Profile
July 19, 2013, 02:12:24 PM
 #14

+1

This post sums up why all this bullshit is a scam
Read It. Hate It. Change the facts that it represents.
https://bitcointalk.org/index.php?topic=1606638.msg16139644#msg16139644
Vorksholk
Legendary
*
Offline Offline

Activity: 1713
Merit: 1029



View Profile WWW
July 19, 2013, 02:19:22 PM
 #15

I'm sure OP is already aware, but I have a bounty for 6 BTC for a primecoin CUDA miner, which this is well on the way to earning. Bounty of course requires a public release of the code and binaries, which it looks like OP is going to provide no problem.   

VeriBlock: Securing The World's Blockchains Using Bitcoin
https://veriblock.org
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
July 19, 2013, 02:21:54 PM
 #16

Why all the attention to CUDA?

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
blastbob
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500



View Profile
July 19, 2013, 02:22:24 PM
 #17

Good post to get prices unstable Smiley

Bitrated user: blastbob.
6strings
Sr. Member
****
Offline Offline

Activity: 441
Merit: 250



View Profile
July 19, 2013, 02:25:01 PM
 #18

Awesome.
So does that mean I have to order an Nvidia card now rather than the 7950 I was going to buy with the BTC I made last night off XPM? lol
Vorksholk
Legendary
*
Offline Offline

Activity: 1713
Merit: 1029



View Profile WWW
July 19, 2013, 02:27:11 PM
 #19

Why all the attention to CUDA?

Based on previous prime-number-based-research projects, CUDA has outperformed OpenCL.

VeriBlock: Securing The World's Blockchains Using Bitcoin
https://veriblock.org
svirus
Member
**
Offline Offline

Activity: 72
Merit: 10


View Profile WWW
July 19, 2013, 02:43:12 PM
 #20

anyone try this and find block ?

Pages: [1] 2 3 4 5 6 7 8 »  All
  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!