Bitcoin Forum
April 18, 2024, 11:03:03 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 5 6 »  All
  Print  
Author Topic: An estimate of fpga performance  (Read 51407 times)
mimarob (OP)
Full Member
***
Offline Offline

Activity: 354
Merit: 103



View Profile
December 19, 2010, 03:39:46 PM
Merited by ABCbits (3)
 #1

Hello!

I converted the sha256 available in opencores.org into vhdl, just to see what to expect.

I got an xc3s500E about 1/3 full on the logic gates, so with a shoe horn one could maybe fit 3 cores into one of these. That does not include the communications with the host, nor the "less than" compare if the result is below the current threshhold.

 (I used an antique ISE (8.something) so maybe newer versions will compute better).

Assuming a maximum of 300 MHz and about 80 cycles to read in, process and output the result (8 + 64 + Cool

You'd get 3*300/80 ~= 11 Mhash/s

This device can be had on a nice DIP socket (GOP modules) at about 60 EUR.

If you want to run this simulation (only tried on Linus), you need ghdl and gtkwave packages (and probably some more stuff that I forgot).

The tar in the attachement contains the synthable file sha256.vhd and the test_sha256.vhd and a simple Makefile.

1713481383
Hero Member
*
Offline Offline

Posts: 1713481383

View Profile Personal Message (Offline)

Ignore
1713481383
Reply with quote  #2

1713481383
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713481383
Hero Member
*
Offline Offline

Posts: 1713481383

View Profile Personal Message (Offline)

Ignore
1713481383
Reply with quote  #2

1713481383
Report to moderator
1713481383
Hero Member
*
Offline Offline

Posts: 1713481383

View Profile Personal Message (Offline)

Ignore
1713481383
Reply with quote  #2

1713481383
Report to moderator
1713481383
Hero Member
*
Offline Offline

Posts: 1713481383

View Profile Personal Message (Offline)

Ignore
1713481383
Reply with quote  #2

1713481383
Report to moderator
grondilu
Legendary
*
Offline Offline

Activity: 1288
Merit: 1076


View Profile
December 19, 2010, 04:10:39 PM
 #2

Ok but in order to mine don't you need a full VHDL implementation of the miner code ?
Because if you must communicate between your PC and your FPGA, this might slow it down quite a lot.

Also I don't understand :  have you just done simulations or have you tried on the actual device ?

bytemaster
Hero Member
*****
Offline Offline

Activity: 770
Merit: 566

fractally


View Profile WWW
December 19, 2010, 05:45:54 PM
 #3

How does this compare to a GPU?   

https://fractally.com - the next generation of decentralized autonomous organizations (DAOs).
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
December 19, 2010, 05:46:17 PM
 #4

Because if you must communicate between your PC and your FPGA, this might slow it down quite a lot.

As long as the FPGA performs millions of hashes for each "call" (host sents work to FPGA), host<->FPGA communication cost is small.

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
bitcoin2
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
December 19, 2010, 06:16:21 PM
 #5

Nice  Smiley
A full implementation would be great!
bitcoin2
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
December 19, 2010, 06:28:26 PM
 #6

How does this compare to a GPU?   


One AMD radeon 5970 (570 Mhash/s) = ~ 50 * xc3s500E (11 Mhash/s). But with FPGAs the Mhash/W should be better as with GPUs.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
December 19, 2010, 06:42:25 PM
 #7

One AMD radeon 5970 (570 Mhash/s) = ~ 50 * xc3s500E (11 Mhash/s). But with FPGAs the Mhash/W should be better as with GPUs.

I'm not sure what Mhash/W is.  But, GPUs are ASIC so they begin with a significant advantage over FPGAs.

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
bitcoin2
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
December 19, 2010, 07:06:52 PM
Last edit: December 19, 2010, 07:43:49 PM by bitcoin2
 #8

One AMD radeon 5970 (570 Mhash/s) = ~ 50 * xc3s500E (11 Mhash/s). But with FPGAs the Mhash/W should be better as with GPUs.

I'm not sure what Mhash/W is.  But, GPUs are ASIC so they begin with a significant advantage over FPGAs.

Mhash/watt. FPGAs should be has a better power efficients than GPUs. ASIC (Application-specific integrated circuit) for mining only (like Deep Crack for DES) would be the greatest variant, but this is very expensive in development (maybe 300,000 USD?).
GeorgeH
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile
December 19, 2010, 08:21:03 PM
 #9

Under my rough calculations, the highest end Virtex 5 could hit 40-50 mhps. At $3000+ for a PCIE dev board, it is far more cost effective to buy ATI video cards.

Edit:

Of course, if one were to connect a bunch of these things in parallel, they could make a big dent, ie:
http://www.sciengines.com/copacobana/

1DSpPtPTGXTYjkZehPsiAbjkXLkB1jsZ2x
mimarob (OP)
Full Member
***
Offline Offline

Activity: 354
Merit: 103



View Profile
December 20, 2010, 05:23:58 AM
 #10

hello again!

Just to clarify, I did run the program under simulation only, but I also compiled the module into the Xilinx synthesis tool (ISE) just to see how much space it would take in the chip. (I don't even own a spartan fpga :-)

A full implementation.. well I'm just trying to understand the criteria for a found block, not being an expert in cryptography. This will also need to be in hardware, I think, so the fpga only reports back when it has found something.

I just checked in at the calculator (http://www.alloscomp.com/bitcoin/calculator.php).
What is the correlation between the "difficulty factor" and the "hash target"? Why do we use two concepts?

I also checked in to the bitcoin code, but it seems that the routine I'm trying to accelerate (ScanHash_CryptoPP) is only checking for a certain number of zeroes and then returning.

Where is the code that checks if you've found a block? I guess it would only be a simple less-than compare in the hardware.

The code would also need to contain some uart comms or similar, I thought of broadcasting the request to all devices and then daisy-chaining the results back so that the "winning" device could break the chain and report back to the host computer.

jib
Member
**
Offline Offline

Activity: 92
Merit: 10


View Profile
December 20, 2010, 05:41:40 AM
 #11

Difficulty = (2^224)/target. They're just two representations of the same thing. To check if you've found a block, you check if the hash is less than the target.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
December 20, 2010, 06:07:17 AM
 #12

I also checked in to the bitcoin code, but it seems that the routine I'm trying to accelerate (ScanHash_CryptoPP) is only checking for a certain number of zeroes and then returning.

Correct.  The scanner performs a fast-path check, and then a more exhaustive check if the fast-path check exits the scanner loop.


Quote
Where is the code that checks if you've found a block? I guess it would only be a simple less-than compare in the hardware.

See CheckWork().  It is a less-than compare, on an unsigned 256-bit little endian integer.

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
romkyns
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
December 20, 2010, 05:00:24 PM
 #13

http://www.dinigroup.com/product/data/DNDPB_S327/images/board_front6.jpg

Drool...

By my own estimates, this thing could generate a block every few hours at the current difficulty. I doubt it would cost less than $25k-$50k though...

(source: http://www.dinigroup.com/new/products.html)
mimarob (OP)
Full Member
***
Offline Offline

Activity: 354
Merit: 103



View Profile
December 21, 2010, 02:33:44 PM
 #14

Yeah that seems about right, that altera board contains 12 times as many 4 input lut's as an xc3s500 spartan module in the GOP module. 12 x 27 = 324 times the 11 MHash in my calcs => 3564000 khash/sec input in the calculator gives you 4 hours for a block. Counting at 2000 blocks per year you get 100000 BTC or $25k a year assuming moderate difficulty increase.

So I guess the graphics cards beat the crap out of the fpga's. But what about power consumption? Also the graphics cards need a motherboard, host cpu etc.

Wonder how far you could optimize the gate count?

Putting a few hundreds of these DIP formfactor boards together would also give you a priceless 80's feeling :-)

http://shop.trenz-electronic.de/catalog/product_info.php?products_id=81
bitcoin2
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
December 21, 2010, 06:49:11 PM
 #15

ArtForz has developed sha256 ASICs and let them (100 pieces) manufacturing for about $500/engine. This ASICs beats 5970 on hash/W by a factor of 6 but loses to 5970 on hash/$ by about a factor of 3, he said. These ASICs are not exactly a real standard cell ASIC but "metal-layer defined ASIC, basically FPGA without the FP part" (source: #bitcoin-dev).
MoonShadow
Legendary
*
Offline Offline

Activity: 1708
Merit: 1007



View Profile
December 22, 2010, 05:45:16 PM
 #16

ArtForz has developed sha256 ASICs and let them (100 pieces) manufacturing for about $500/engine. This ASICs beats 5970 on hash/W by a factor of 6 but loses to 5970 on hash/$ by about a factor of 3, he said. These ASICs are not exactly a real standard cell ASIC but "metal-layer defined ASIC, basically FPGA without the FP part" (source: #bitcoin-dev).

What kind of ASIC is it?  Is this a custom PCI card?  Would higher production volumes improve the price point?  I'm interested in this, as a purpose made PCI card would be as big a boon as buying an expensive GPU.

"The powers of financial capitalism had another far-reaching aim, nothing less than to create a world system of financial control in private hands able to dominate the political system of each country and the economy of the world as a whole. This system was to be controlled in a feudalist fashion by the central banks of the world acting in concert, by secret agreements arrived at in frequent meetings and conferences. The apex of the systems was to be the Bank for International Settlements in Basel, Switzerland, a private bank owned and controlled by the world's central banks which were themselves private corporations. Each central bank...sought to dominate its government by its ability to control Treasury loans, to manipulate foreign exchanges, to influence the level of economic activity in the country, and to influence cooperative politicians by subsequent economic rewards in the business world."

- Carroll Quigley, CFR member, mentor to Bill Clinton, from 'Tragedy And Hope'
bitcoin2
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile
December 22, 2010, 07:27:09 PM
 #17

ArtForz has developed sha256 ASICs and let them (100 pieces) manufacturing for about $500/engine. This ASICs beats 5970 on hash/W by a factor of 6 but loses to 5970 on hash/$ by about a factor of 3, he said. These ASICs are not exactly a real standard cell ASIC but "metal-layer defined ASIC, basically FPGA without the FP part" (source: #bitcoin-dev).

What kind of ASIC is it?  Is this a custom PCI card?  Would higher production volumes improve the price point?  I'm interested in this, as a purpose made PCI card would be as big a boon as buying an expensive GPU.

ArtForz expect the arrive in february:
https://stuff.caurea.org/irssi/freenode/%23bitcoin-dev/2010/12/%23bitcoin-dev-2010-12-20.log : 18:36

Maybe the first step to develop a ASIC is this vhdl code. I don't believe that ArtForz will give us his code. If we put money together, maybe we could have enough money to let manufacturing a real ASIC.
Cdecker
Hero Member
*****
Offline Offline

Activity: 489
Merit: 504



View Profile WWW
December 22, 2010, 08:28:00 PM
 #18

Just for reference again the logs for that moment: http://veritas.maximilianeum.ch/bitcoin/irc/logs/2010/12/20#l2461

Want to see what developers are chatting about? http://bitcoinstats.com/irc/bitcoin-dev/logs/
Bitcoin-OTC Rating
GeorgeH
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile
December 23, 2010, 05:57:55 AM
 #19

Just for reference again the logs for that moment: http://veritas.maximilianeum.ch/bitcoin/irc/logs/2010/12/20#l2461

Thanks, that was a good read.

1DSpPtPTGXTYjkZehPsiAbjkXLkB1jsZ2x
grondilu
Legendary
*
Offline Offline

Activity: 1288
Merit: 1076


View Profile
December 23, 2010, 06:19:14 AM
 #20


If some people created a bitcoin-dedicated ASIC, I'd be amazed.  It would be a strong indicator about how involved are some people into the bitcoin project.

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