Eth: 0x00cce8E2e56a543abc084920eee3f88eFD0921ea

Friday, November 27, 2015

Ethereum GPU Mining with Ubuntu 14.04 from Scratch

_________________
UPDATED 3/20/2016 - qtminer install instructions for pool mining and GPU_SINGLE_ALLOC_PERCENT=100 for 2GB GPUs
__________________

As the codebase developed, we now have a much simpler way to install and run a GPU miner for Ethereum.

Install Ubuntu
A quick note here for newbies, it'll be easier to manage your system in the long run if you install Ubuntu in headless mode. (Headless means it won't output anything to a monitor on bootup and you'll have to loginto the computer remotely via SSH). 

Install Graphics Drivers (AMD)
1) At the command line type:

 sudo apt-get -y update   
 sudo apt-get -y upgrade -f   
 sudo apt-get install fglrx-updates  
 sudo amdconfig --adapter=all --initial  

2) Reboot the machine.
3) You should now be able to see all the video cards installed on your system using the command:
 aticonfig --list-adapters   
The item with the star (*) next to it is the default graphics output of the computer. In our case we have set this to the integrated graphics card and we will use the GPUs installed in the PICe slots only for mining.

3) Trouble: If you're having trouble getting the system to display anything on the screen after boot, you are probably plugged into the wrong graphics card and you may have to change the defaults in BIOS as well as changing the default card the ubuntu uses for it's output. You can force use of the integrated graphics card by entering the following at the terminal:
 sudo aticonfig --pxl-igpu  

Install Geth
Note: If you have a different wallet software like MIST, you don't need to install geth to mine with a pool (non-solo mining).
1) Make a new directory for the latest version of geth
mkdir go-eth135
cd go-eth135

2) Download the master branch for github
git clone https://github.com/ethereum/go-ethereum
cd go-ethereum

3) Enable OPENCL and Build

  export GO_OPENCL=true   
  export GPU_MAX_ALLOC_PERCENT=100   
  export GPU_SINGLE_ALLOC_PERCENT=100  
  make geth   

4) Make a new coinbase account (where your Ether will be deposited)
 build/bin/geth account new  

(enter in a password 2x)


Install QT Miner

We use qt miner as are pool mining software. Several mining pools use qt miner.
1) Download the qtminer software for 14.04 or 15.04 from EthPool.org.

 tar zxvf qtminer.tgz  
 cd ./qtminer  
 chmod +x qtminer.sh  

Start Mining (Solo)
1) To start GPU Mining, go back to your go-eth directory

build/bin/geth -maxpeers '100' -mine -minergpus '0' -autodag console

2) Mine with Multiple GPUs
build/bin/geth -maxpeers '100' -mine -minergpus '0,1,2' -autodag console

Where '0,1,2' means mine with GPUs zero, one and two. You should change this to list however many GPUs you have. Thus if you have only 2 GPUs and they are devices 2 and 4 you would type : '2,4' instead of '0,1,2'. To see which devices your GPUs are listed as use the command:

aticonfig --list-adapters  

NOTE: All the rest of the commands are typed inside the go-ethereum console:

3) Ensure your rig is mining to your address
web3.eth.coinbase
 (This should be set to the same address that you just created when you made your coinbase account)
If this returns '0x0' that means you're mining rewards will get sent into a big black hole. Fix this by typing the following inside the geth java scrypt console:
 web3.miner.setEtherbase(web3.eth.accounts[0])

4) Check Profits
web3.fromWei(eth.getBalance(eth.coinbase), "ether")
 This will return how much ether you have in your account

5) Check Hash Rate
miner.hashrate


Start Mining (Pool)
1) Mining with ethermine.org, they have several servers throughout the world:
US East : us1.ethermine.org:4444
US West: us2.ethermine.org:4444
Asia       : asia1.ethermine.org:4444
Europe  : eu1.ethermine.org:4444

They use a PPLNS 1% fee system. I have used their companion service ethpool.org successfully for months.

Below, you should replace the address with your own wallet address given to you by geth when you made your account. I mine with US East so to start mining I type the following:

./qtminer.sh -s us1.ethermine.org:4444 -u 0x8e61bf5a2e46d15774172781cf100ed0962cbb63.rig1 -G

The command above will attempt to start all your video cards mining. In my case, this doesn't work because I have an AMD integrated graphics card as my first device (device '0' in the image below).


2) Troubleshooting: If you have a an issue like me where you have an integrated graphics card, that you can't mine on, or you just want to specify the cards to mine on, modify the above qtminer command as follows:

./qtminer.sh -s us1.ethermine.org:4444 -u 0x8e61bf5a2e46d15774172781cf100ed0962cbb63.rig1 -G --opencl-device '1'

This will start my first device. To start the rest of the non-integrated graphics mining I would then enter the following in separate terminals:

./qtminer.sh -s us1.ethermine.org:4444 -u 0x8e61bf5a2e46d15774172781cf100ed0962cbb63.rig2 -G --opencl-device '2'

./qtminer.sh -s us1.ethermine.org:4444 -u 0x8e61bf5a2e46d15774172781cf100ed0962cbb63.rig3 -G --opencl-device '3'


The End & Other Problems
If you have enjoyed this post, please consider sending me a beer!

Having problems with PCIe Extenders? Check Here for common solutions.

Problems with 2GB GPU? Make sure that the following is set before starting qtminer:

  export GPU_MAX_ALLOC_PERCENT=100   
  export GPU_SINGLE_ALLOC_PERCENT=100