Pages:
Author

Topic: [XPM] CUDA enabled qt client miner for primecoins. Source code inside. WIP - page 8. (Read 31761 times)

sr. member
Activity: 287
Merit: 250
Using GPU for primality testing is the logical first step.
legendary
Activity: 1246
Merit: 1011
legendary
Activity: 1246
Merit: 1000
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" ))
sr. member
Activity: 301
Merit: 250
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
newbie
Activity: 19
Merit: 0
This guy. This guy is a good person.
legendary
Activity: 1713
Merit: 1029
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.
full member
Activity: 224
Merit: 100
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.
legendary
Activity: 1713
Merit: 1029
Awesome Cheesy Send 50 Primecoins you way.
member
Activity: 99
Merit: 10
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.
hero member
Activity: 759
Merit: 500
full member
Activity: 120
Merit: 100
sr. member
Activity: 392
Merit: 250
member
Activity: 75
Merit: 10
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.
Pages:
Jump to: