Reader small image

You're reading from  Bitcoin Essentials

Product typeBook
Published inFeb 2016
Publisher
ISBN-139781785281976
Edition1st Edition
Tools
Right arrow
Author (1)
Albert Szmigielski
Albert Szmigielski
author image
Albert Szmigielski

Albert Szmigielski is a thinker, a computing scientist, a software engineer, and a blockchain professional. He holds a BSc in Computer Science and an MSc in Digital Currency. He has been involved in a number of start-ups and software projects. He believes in a decentralized, distributed nature of storing information, and hence has an interest in Bitcoin and blockchain technology. Albert is a researcher at CryptoIQ and a mentor at the Blockchain Institute. He frequently contributes to his blog at blog.cryptoIQ.ca.
Read more about Albert Szmigielski

Right arrow

Chapter 3. GPU Mining

In this chapter, we will take a look at mining with Graphic Processing Units or GPUs. They are simply known as Video Cards. GPUs have a high degree of parallel processing built in and as such they are perfect for the repeated hashing of candidate blocks. That process is of course known as Bitcoin mining. GPUs can mine much faster than CPUs and hence are more desirable to a potential miner. In this chapter, we will cover the following topics:

  • Setting up your wallet, mining software to allow GPU mining

  • What happens when mining on the GPU?

  • Benchmarks of mining speeds with different GPUs

  • Pros and cons of GPU mining

  • CPU versus GPU mining

  • Best practices when mining with GPUs

  • Discussion of profitability

Setting up a GPU for mining


In order to use a GPU to mine, you must have at least one GPU installed in your machine. At first, we will go over how to mine with only one GPU. Using multiple GPUs in your system to mine is a very a straightforward extension from mining with a single one.

Drivers

We will concentrate here on AMD GPUs as they offer the best hashing performance for the money when it comes to hashing power, the cost of the GPU, and electricity efficiency. Nvidia GPUs can also be used as long as you have the drivers for your video card installed.

Note

In order to mine with AMD GPUs, we will need the latest AMD drivers. You can find the latest AMD drivers here: http://support.amd.com/en-us.

If your GPU has already been installed in your machine, chances are that you have your driver installed already.

Here are some helpful Linux commands:

  • lspci | grep VGA: This command displays the graphics cards in your system:

  • sudo aticonfig --adapter=all --odgt: This command displays the graphics cards...

Pros and cons of GPU mining


Mining with GPUs has its advantages and disadvantages. Let's examine these in order to better understand if and when it is appropriate to use your GPUs to mine Bitcoin. As you may recall, in the beginning everyone used a CPU to mine bitcoins; then clever people figured out how to do it on GPUs.

Pros of GPU mining

GPU mining is the second step in the mining evolution (first there was CPU mining); it's very useful in the process of understanding mining. We strongly believe that every miner should try mining with a GPU to experience how changing different options affects the speed and efficiency of GPU mining. Most likely, you already have a GPU in your desktop machine. In the process of setting up the software, you will learn all the little tricks that are applicable to your hardware. You will also learn how the GPU compares to more advanced hardware, such as FPGAs and ASICs.

To summarize, we encourage you to try GPU mining for the following reasons:

  • If you have a video...

Best practices when mining with GPUs


Let's look into recommended practices when mining with GPUs. Although mining Bitcoin is no longer profitable with GPUs, mining other coins may bring in some profits. If you are going to use your GPUs for mining, you might as well observe practices that are going to make it easier and safer for you.

First, make sure that your GPUs have adequate cooling and the GPU fans are at least two inches away from any other object. If your GPU is inside a desktop case, it is better to leave the case open. If you are building a mining rig with multiple GPUs, it is a good idea to add external fans to increase the airflow. It is also wise to leave the GPUs exposed (as in not enclosed), so that there is better air circulation. Remember that hot air rises, so it is best not to have anything above your mining rig. As you may have seen, people do use "milk crates" as enclosures for their mining rigs; it is a good starting point. However, now there are professional manufacturers...

Benchmarks of mining speeds with different GPUs


As we mentioned earlier, the Bitcoin network hash rate is really high now. Mining with GPUs is no longer guaranteed to bring profits. This is due to the fact that during the mining process you are competing with other miners to try to solve a block. If those other miners are running on faster hardware, you will be at a disadvantage, as your hardware can only make a certain number of guesses (hashes) in a given time frame.

To compare the mining speed of a few GPU's, look at the following table:

GPU

Mining speed (MH/s)

Power used (Watts)

AMD 4870

90

150

AMD 5770

240

100

AMD 5830

300

125

AMD 5850

400

180

AMD 5870

480

200

AMD 5970

800

350

AMD 6990

800

400

NVIDIA GT-210

4

30

NVIDIA GTX-280

60

230

NVIDIA GTX-480

140

250

NVIDIA Tesla S1070

155

800

NVIDIA Tesla S2070

750

900

Table: 3.1: Comparison of mining speed of GPUs

GPU versus CPU mining


As you can see from a comparison between Table 3-1 and Table 2-1, GPUs hash much faster than CPUs. The fastest in our list reaches 800 MH/s. This is a significant improvement over various CPUs and is due to the massively parallel nature of graphics cards. Even though GPUs mine much faster than CPUs, the mining speed of a GPU compared to the total mining power of the Bitcoin network is still just a tiny percentage of the total.

Profitability of GPU mining


To calculate expected rewards from mining, we can do the following. First, calculate what percentage of total hashing power you command. To look up the network mining speed, execute the getmininginfo command in the console of the Bitcoin Core wallet. We will do our calculations with a GPU that can hash at 1 GH/s = 0.1 TH/s. If the Bitcoin network hashes at 400,000 TH/s, then our proportion of the hashing power is:

0.1 / 400 000 = 0.00000025 of the total mining power

On average, a Bitcoin block is found every 10 minutes; it amounts to six per hour and 144 for a 24-hour period. The current reward per block is 25 BTC; therefore, in a day we have 144*25 = 3600 BTC mined.

If we command a certain percentage of the mining power, then on average we should earn that proportion of the newly minted bitcoins.

Multiplying our portion of hashing power by the number of bitcoins minted daily we arrive at:

0.00000025 * 3600 BTC = 0.0009 BTC

As we can see, this is less than $0.25 USD...

Summary


In this chapter, we have looked at GPU mining, setting up the required mining software, and at certain GPU settings. We delved into the most popular GPU mining software—cgminer. We showed you how to set it up and run it, so that you can start mining by connecting to a pool.

We touched upon the advantages and disadvantages of GPU mining. You can consider those when you decide to mine. We also presented a set of good practices to keep in mind while running your mining process. They are common sense to most but sometimes the most obvious things are forgotten. If you adhere to those practices, you should not encounter any problems while mining.

We also examined the profitability of GPU mining. We showed you a simple way of calculating, on average, your expected earnings. Even though GPU mining is no longer profitable, it is nevertheless a good educational experience.

In the next chapter, we will look at mining with more specialized hardware built for mining.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Bitcoin Essentials
Published in: Feb 2016Publisher: ISBN-13: 9781785281976
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Albert Szmigielski

Albert Szmigielski is a thinker, a computing scientist, a software engineer, and a blockchain professional. He holds a BSc in Computer Science and an MSc in Digital Currency. He has been involved in a number of start-ups and software projects. He believes in a decentralized, distributed nature of storing information, and hence has an interest in Bitcoin and blockchain technology. Albert is a researcher at CryptoIQ and a mentor at the Blockchain Institute. He frequently contributes to his blog at blog.cryptoIQ.ca.
Read more about Albert Szmigielski