Post
Topic
Board Announcements (Altcoins)
Re: [ANN][RIC] Riecoin, new prime numbers POW coin, CLIENT UPDATE v0.8.7 AVAILABLE
by
dga
on 26/03/2014, 13:46:48 UTC
If I recall correctly, there was a GPU miner for primecoin that somebody claimed to be developing, and took donations for it, but never delivered.

As far as I know there still is no GPU miner for primecoin, mostly because the CPU is still needed to do certain things efficiently, but the communication time between the CPU and GPU killed any performance gains from the GPU running any part of the code. Or it was something to that effect, AFAIK.

If it would be possible to make a GPU miner I think that would be better long-term for this coin. CPU coins get dominated by botnets, drowning out potential profits from people running it legitimately, since botnet operators don't care about electricity costs. That kind of kills a lot of potential enthusiasm for it. There's only so many people in the world willing to lose money calculating prime numbers for fun.

Yeah - that was an infamous one.

Barring advances in the algorithmic techniques for RIC, the basics of RIC mining in the context of the GPU look like this.

Given a target number T determined by the diff and the blockchain hash:

  (a)  Round T up to T' where T' is a multiple of the primorial being used.  (easy - do once on CPU for every block).
  (b)  Compute T%p for every prime p being used to sieve
        Less easy:  Requires bigint math in various forms.
        Potentially optimizable:  Because the p's are all known in advance and never change, you can optimize this by computing on the CPU once per difficulty 1/p, and then use this to compute T%p using multiplication.
        Requires:  Decently fast bigint multiplication on GPU
        http://www.hpcs.cs.tsukuba.ac.jp/~nakayama/cump/index.php?CUMP%20Performance%20Evaluation
 
        Note the 1000 decimal digit number results:  Slower than a dual proc opteron.  (!)
        But perhaps there's some speedup hiding in there if you do many of them in parallel.

  (c)  Sieve - write zeros to the sieve at the locations indicated by T%p.
        Easy:  Optimizing this is standard GPGPU programming.  It's not trivial, but there are a lot of people who could do it.

  (d)  Test candidates:
        Potentially painful:  Requires modular exponentiation  on the GPU   (2^(n-1) % n).
        Algorithmic competitiveness with GMP probably requires using montgomery reduction.

This is quite a bit of work.  There's nothing in this list that is impossible, but it's a substantial engineering challenge to make it worthwhile.  Otherwise, even though the GPU has more horsepower, the algorithmic and engineering advantages of GMP will dominate.

There are some fun possibilities for doing this - i.e., because a lot of the pain in the bigint is handling variable-length things, you could just synthesize the kernel when a new block arrives (or a new diff arrives).  But it's the kind of stuff that an expert at could go get a lot more money from security applications than hacking for a cryptocurrency. :-)