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 Nanopool (although it'll work for other pools too).
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.
Ensure you install the latest AMDGPU-pro drivers with OpenCL support first.
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.
Since Ethereum is optimized for GPU mining, one or more powerfull GPU's are great. Again, it doesn't matter if it's NVidia or AMD, though I prefer using the latter.
Also, make sure your GPU has enough memory. You might want to use a DAG size calculator to find out what you need. At the time of writing a 4GB card might barely work (if you stop
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).
For AMD card's you'll also need to install the AMDGPU-pro driver with OpenCL support before building Ethminer.
Installing AMDGPU pro driver with OpenCL support
Retrieve the latest drivers from AMD's Support page, then install with OpenCL support and reboot:
A change is required for Vega10 cards (or newer) , replace
Optionally, you might add the
--no-dkms options to the
./amdgpu-pro-install command if you don't want your desktop environment to load AMD's drivers:
./amdgpu-pro-install --opencl=legacy,pal --no-dkms --headless
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.
- First, install the required drivers for your video card:
For NVidia, use:
For AMD, install the driver with OpenCL support first, then use:
Also, make sure the required packages on your system exist:
mesa-common-dev fixes most build failures.
Now download the latest version from GitHub into a new folder:
Finally, build it (command's take some time, so be patient):
For AMD, use:
For NVidia use:
Optionally you can install as an executable:
Ethminer's first run
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:
Otherwise, you can run it directly:
The commands above show Ethminer's short documentation. For the long documentation, use the
--help-ext option, with one of the allowed extensions:
Optionally, you can have a look at all the options at cpp-ethereum's readme (which is the origin of the ethminer with GPU support).
To get an idea of the MHash/s your setup reaches, you might want to run a benchmark first.
For ATI/OpenCL, use:
For NVidia/CUDA, use:
If the benchmark returns an empty result (which it probably will the first few times), be patient until the DAG file has been generated.
Divide the “MAX” hashrate by 1000000 to get the rate in megahashes. This is your real hashrate in MH/s.
Mining with Ethminer
Mining trough Eth.nanopool.org
Finally, we're ready to start mining! The final step is actually very simple, just run the following command:
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.
Mining trough Other pools
Ethminer supports all latest protocols, allowing you to connect to any pool you want. See the examples on how to connect to different Pools to get started.
Getting system information
Some command I've used to get insight on what drivers or devices are recognised or not:
Ethminer benchmark keeps giving 0H/s
This mostly happens on CUDA-cards and/or when generating the DAG takes longer than the warmup-time. The
--benchmark-warmup option has been removed, so just be patient and let the DAG file generate.
Building Ethminer fails with error
#error -- unsupported GNU version! gcc versions later than 8 are not supported!
This error is actually quite self-explanatory, and can be solved my manually setting the gcc version:
Ethminer sees no usable devices with AMD card
Error: No usable mining devices found
clinfo, check to see if any OpenCL-capable platforms are found:
ethminer see no devices, it means the device driver you're using either doesn't work properly or has no OpenCL support. See above on how to install your device's driver. Remove any existing drivers beforehand. Optionally, you can check if AMD's driver is loaded in the kernel using
lsmod | grep amdgpu.
SIGSEGV, not enough memory available on device
Look at the lines above the trace message to find out what exactly went wrong. If your device doesn't have enough memory, you might squeeze some extra life out of your card by stopping all other programs, and/or stop your GUI/Desktop environment. Use a DAG size calculator to see the minimal amount of GPU-memory the mining process needs. Using
ethminer --list-devices shows the amount of memory that's available.
An alternative solution might be to mine other coins that rely on Ethash Proof of Work, like Expanse or Metaverse.
Other (compatibility) issues
Sometimes, using the latest release results in weird issues or bugs that haven't been fixed yet. Therefore you can checkout an earlier version (for example v0.18.0) and try if that works:
git clone --single-branch --branch v0.18.0 https://github.com/ethereum-mining/ethminer.git
Then follow the same building steps as mentioned above.
Furthermore, it's important to check if there are no conflicting drivers or other issues. For AMD, you might want to manually remove existing drivers:
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. After manually building it, 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.
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.
-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.
-j option to use all cpu cores while building, because it speeds up the process by a lot.
- Added documentation on how to install AMDGPU-pro drivers with OpenCL support.
- Added more troubleshooting info, out of memory solution and other minor fixes.
- Fixed specifying gcc and g++ version when building.
- Max supported gcc/g++ version is 8, replaced 6 in error fix.
sudo before commands requiring more privileges.