Difference between revisions of "FPGA mining"

From DigiByte Wiki
Jump to navigation Jump to search
m (Slowly adding more detailed instructions)
m (→‎Getting ready for mining: Added overview of components needed for solo-mining etc)
Line 15: Line 15:
  
 
Don't plug your FPGA in just yet, you'll be instructed to do-so later. When you do, you only need the power and the USB cable connected to your PC.
 
Don't plug your FPGA in just yet, you'll be instructed to do-so later. When you do, you only need the power and the USB cable connected to your PC.
 +
 +
There are going to be a few software components that you need to be aware of:
 +
* '''Quartus Prime''', this is required to run your FPGA miner
 +
* '''Autocompiler''', this re-creates the software your FPGA uses every 10 days based on the new seed
 +
* '''FPGA mining controller''', one for each FPGA you have
 +
* '''Mining Pool''', ''optional'', in case you are wanting to solo-mine
 +
* '''DigiByte Core''', ''optional'', if you're wanting to solo-mine. Can be pointed at any wallet otherwise.
  
 
=== Quartus Prime ===
 
=== Quartus Prime ===

Revision as of 18:48, 28 April 2019

Introduction

FPGA mining for Odocrypt is far more efficient than CPU-mining. A single Cyclone V FPGA is around 1000-1500X more powerful than a normal desktop CPU (Depending on the CPU that you're comparing against).

FPGA's are also incredibly energy efficient compared to the likes of a GPU. Where a GTX1070 might consume ~180W (Not allowing for underclocking etc), a consumer-grade FPGA will use around 8W. This means that once a user has purchased a FPGA up-front, the on-going costs are negligible compared with a GPU.

FPGA's are also multi-purpose, bringing in the possibility for users who have existing hardware to mine DigiByte, or to use that same hardware to also mine other non-Odocrypt algorithms. They are far more flexible than an ASIC in that respect. Because FPGAs are reprogrammable, in the event that an ASIC were developed for Odocrypt (Though the advantage of doing-so over an FPGA would arguably be minimal and pointless), the algorithm could be modified easily enough to render the ASICs obsolete similar to what XMR does with CryptoNight, and requiring minimal adjustment of FPGA's.

The up-front cost is also a significant factor, as FPGAs are an "off the shelf" piece of hardware compared to an ASIC, they're far less likely to have an extreme vendor-tax on them as we have seen throughout 2015-2019 specifically with ASIC mining equipment.

All of this combined makes a FPGA-based algorithm a strong arrow in the quiver of DigiByte, both as another non-ASIC hashing algorithm that will aid in the security of the network, but also in the decentralization of mining thanks to the borderline commodity nature of FPGAs.

Getting ready for mining

These instructions presume you are running Linux natively, though you should also be able to run it through WSL on Windows 10.

Don't plug your FPGA in just yet, you'll be instructed to do-so later. When you do, you only need the power and the USB cable connected to your PC.

There are going to be a few software components that you need to be aware of:

  • Quartus Prime, this is required to run your FPGA miner
  • Autocompiler, this re-creates the software your FPGA uses every 10 days based on the new seed
  • FPGA mining controller, one for each FPGA you have
  • Mining Pool, optional, in case you are wanting to solo-mine
  • DigiByte Core, optional, if you're wanting to solo-mine. Can be pointed at any wallet otherwise.

Quartus Prime

Quartus Prime is required to both compile and run this miner. It is currently available at https://fpgasoftware.intel.com/ . To figure out what edition you need, check the device support list. To minimize your download, choose the Individual Files tab, then download only Quartus Prime, and the device support files for the devices you're using. Install according to the instructions on their website.

Other prerequisites

Once you have Quartus Prime, you're going to want to clone the Odocrypt miner repository. Fire up a terminal and run the following:

git clone https://github.com/MentalCollatz/odo-miner.git

You'll also want python and a few modules:

apt install python python-pip
pip install base58 requests

Profile setup

You'll want to edit ~/.profile and add the following line to the bottom:

export QUARTUSPATH="/home/miner/altera/18.1/quartus/bin"

Naturally you'll need to update the username / path there depending on where you've extracted it. Put it in there though to keep life simple.

You can either log out of your X session, or you can run the following command in the terminal session:

source ~/.profile

Device setup

Normally only root can access the FPGA hardware, but running things as root is just bad practice, so we want to allow your user-account to access the hardware.

cd ~/odo-miner
sed -i s/1000/$(whoami)/ 99-altera.rules

This is going to edit the altera rules file with your username, to allow your user access Now we need to put it into the udev rules:

sudo cp 99-altera.rules /etc/udev/rules.d/
sudo udevadm control --reload


More information to be added...