Although mining Ethereum is way easier on Windows (just keep bashing next in a few installers), there is probably a Hashrate improvement when you're using a Linux as your driver. Moreover, it's way more bad ass.

In this example I'm showing the simple steps on how to get started with GPU-Mining, by manually building Ethminer and setting it up to mine using Ethereumpool (although it'll work for other pools too).

Noob Notice

Mining will shorten the lifetime of your hardware and causes your PC to use more power, thus driving up your power bill. Also, you might lose all the money you invest. Thus, use your brain!

You, and only you, are responsible for any damage done to you, your hardware or financially.

TL;DR

apt-get install opencl-amdgpu-pro-icd cmake git mesa-common-dev
mkdir ~/ethminer; cd ~/ethminer
git clone https://github.com/ethereum-mining/ethminer.git .
git submodule update --init --recursive
mkdir build; cd build
cmake .. -DETHASHCUDA=OFF -DETHASHCL=ON
cmake --build .
sudo make install
ethminer -G -M
ethminer -G --report-hr -P stratum1+tcp://0x47e83baffbc118393c082b7d4a62130b0480bb11@eth-eu1.nanopool.org:9999/rigname
apt-get install nvidia-cuda-toolkit cmake mesa-common-dev
mkdir ~/ethminer; cd ~/ethminer
git clone https://github.com/ethereum-mining/ethminer.git .
git submodule update --init --recursive
mkdir build; cd build
cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF
cmake --build .
sudo make install
ethminer -U -M --benchmark-warmup 30
ethminer -U --report-hr -P stratum1+tcp://0x47e83baffbc118393c082b7d4a62130b0480bb11@eth-eu1.nanopool.org:9999/rigname

Ethereum versus Bitcoin

Bitcoin uses the Hashcash algorithm to verify transactions, which is a relatively simple calculation, which has been put on ASIC's that are capable of outperform many GPU's. Ethereum however, uses the Ethash algorithm, which is set up in such a way that it requires a big amount of Memory. This makes it very hard to transfer the algorithm onto ASIC's but makes GPU's the best method of mining it.

As a result, the difficulty of mining Ethereum increases much slower compared to other currencies using the Hashcash algorithm. Furthermore, it's optimized for mining with GPU's only and it even works when you're using an NVidia card, although AMD probably gives you a bigger bang for the buck.

Requirements

Since Ethereum is optimized for GPU mining, one or more nice GPU's are great. Again, it doesn't matter if it's NVidia or AMD, though I prefer using the latter.

Also, you need a Wallet to provide your unique Ether-address. Personally I recommend using Exodus, since it's easy to set up, supports multiple currencies, and doesn't eat all your system's resources like Mist does. Since I don't like the idea of others keeping your private keys, I suggest you keep away from cloud wallets (Exodus saves your keys local).

Building Ethminer

Manually building Ethminer isn't required at all, it's latest release can simply be downloaded from the releases page. However, if you're boss, and want the extra Hashes from your GPU, build it yourself by following the steps below.

  1. First, install the required drivers for your video card:
    1. For NVidia, use:

      apt-get install nvidia-cuda-toolkit
    2. For AMD, download the latest diver manually and use

      apt-get install opencl-amdgpu-pro-icd
  2. Also, make sure the required packages on your system exist:

    apt-get install cmake mesa-common-dev git

    The mesa-common-dev fixes most build failures.

  3. Now download the latest version from GitHub into a new folder:

    mkdir ~/ethminer; cd ~/ethminer
    git clone https://github.com/ethereum-mining/ethminer.git .
    git submodule update --init --recursive
  4. Finally, build it (command's take some time, so be patient):

    • For AMD, use:

      mkdir build; cd build
      cmake .. -DETHASHCUDA=OFF -DETHASHCL=ON
      cmake --build .
    • For NVidia use:

      mkdir build; cd build
      cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF
      cmake --build .
  5. Optionally you can install as an executable:

    sudo make install

Testing Ethminer

If you've omitted step 5 from above, you can run Ethminer from the ethminer-directory inside the build-directory you're probably still in:

./ethminer/ethminer --help

Otherwise, you can run it directly:

ethminer --help

The commands above should show Ethminer's documentation.

Benchmarking Ethminer

To get an idea of the MHash/s your setup reaches, you might want to run a benchmark first.

For OpenCL, use:

./ethminer/ethminer -G -M

For CUDA, use:

./ethminer/ethminer -U -M

If the benchmark returns an empty result (which it probably will the first few times), retry until you've got a viable reading or set the --benchmark-warmup. The result should look something like this:

ethminer benchmark results

Divide the “MAX” hashrate by 1000000 to get the rate in megahashes. This is your real hashrate in MH/s.

Mining with Ethminer trough Eth.nanopool.org

Finally, we're ready to start mining! The final step is actually very simple, just run the following command:

./ethminer/ethminer -G --report-hr -P stratum1+tcp://0x47e83baffbc118393c082b7d4a62130b0480bb11@eth-eu1.nanopool.org:9999/rigname

Replace 0x47e83BafFbc118393C082B7D4A62130b0480BB11 with your Eth wallet address and rigname with the name of your rig (or just remove it since it's optional).

Now the mining should start to run. Optionally you can monitor your progress by looking up your wallet address on the miner stats page.

Troubleshooting

Ethminer benchmark keeps giving 0H/s

This mostly happens on CUDA-cards and/or when generating the DAG takes longer than the warmup-time. This is solved when manually setting a longer warmup-time:

# For OpenCL cards
./ethminer/ethminer -G -M --benchmark-warmup 60
# For CUDA cards
./ethminer/ethminer -U -M --benchmark-warmup 60

Building Ethminer fails with error #error -- unsupported GNU version! gcc versions later than 5 are not supported!

This error is actually quite self-explanatory, and can be solved my manually setting the gcc version:

# First remove any existing files from the current 'build' directory
rm -Rf ./*
# Now install required libs and restart building
apt-get install gcc-5 g++-5
export CC=`which gcc-5`
export CXX=`which g++-5`
# For Nvidia/CUDA use
cmake .. -DETHASHCUDA=ON -DETHASHCL=OFF
cmake --build .
# For ATI/OpenCL use
cmake ..
cmake --build .

Conclusion

When I started out on Windows 10, my single R9 Nano reached a maximum hashrate of around 22MH/s. After setting up Linux with a prebuilt version of Ethminer the hashrate jumped to nearly 24MH/s and after manually building the miner the rate averages just shy of 25MH/s, and if the wheater is cool slightly above.

Therefore, I must conclude the extra effort on getting the miner and the drivers running is really worth it.

Found this post helpful?

Support us by sending a small tip

Changelog

2019-01-10
Removed eth.pp.ua since it died a long time ago, and use eth.nanopool.org instead. Added commands to ensure GIT submodules are up to date and other fixes in commands to ensure building works again.
2019-01-11
Removed -t 1 flag, since it's not needed. Added --report-hr flag, to report Hashrate to pool. Changed AMD's driver download page to ensure user always get's latest driver release.