How to Mine Bitcoins With a GPU Using CGMiner

Updated on February 11, 2018
skear profile image

Sam has been mining Bitcoin and other cryptocurrencies since 2013. He has experience building and optimizing GPU and ASIC mining systems.

With their recent jump in value Bitcoins are becoming more popular than ever. This sudden increase in popularity has created a gold rush causing everyone to gain interest in this new digital currency.

While many people find it easier to simply buy Bitcoins others have discovered Bitcoin mining is a fun and challenging hobby.

Mining for Bitcoins can be both fun, and profitable and it's actually easier to get started then you might think. In this hub I'll explain how to start mining for Bitcoins using your GPU and a program called CGMiner.

GPU mining rig.
GPU mining rig.

Have you heard of Bitcoins before?

See results

Hardware Requirements

AMD Radeon video cards are the best GPUs for mining Bitcoins. Unfortunately Nvidia cards do not perform very well at all when it comes to mining when compared to AMD cards.

If you already have an AMD Radeon 5800 or newer video card installed then you are in good shape to start mining for coins.

I wouldn't recommend going out and purchasing a new video card just to mine Bitcoins with but if you need to replace an older card anyway you might consider purchasing a Radeon card instead of Nvidia Hardware..

With newer ASIC based Bitcoin miners hitting the market in the near future GPU based mining may soon be obsolete so be cautious of investing heavily in GPU hardware just for mining.

If you're hardware isn't powerful enough to mine Bitcoin you can still earn Bitcoin by using NiceHash which mines other cryptocurrencies but pays users in BTC.

Triple GPU Bitcoin mining rig.
Triple GPU Bitcoin mining rig.

Why MIne Using a GPU?

GPUs are much better than CPUs when it comes to mining for Bitcoins due to the nature of their design. Graphics rendering requires tons of mathematical computations which GPUs are specifically designed to do.

Since Bitcoin mining also requires math computations (hashing) GPUs work very well for this purpose.

While CPUs can also be used to generate hashes they are not nearly as effective as a GPU.

Here is a popular analogy:

A CPU is like a small group of very smart people who can quickly perform any task they are asked to do.

A GPU is like a large group of dumb people who on their own are not very fast or intelligent, but they can be taught to do repetitive tasks, and as a group they can be more productive due to the sheer number of them.

Create an Online Bitcoin Wallet

Before you start mining for Bitcoins you will need to create an online wallet that will be used to receive and store Bitcoins.

There are several places to create online wallets but I recommend using Blockchain. Blockchain allows you to create a free, and secure wallet that provides many useful features.

Blockchain.info is a great place to create a free online Bitcoin wallet.
Blockchain.info is a great place to create a free online Bitcoin wallet.

To create a wallet click on the link labeled 'Create my free wallet'. To set up the new account enter an alias (think of this as the username for the account), a secure password, and the capcha answer.

Blockchain will generate a password recovery mnemonic, be sure to store this somewhere safe in case you ever need to recover access to your wallet.

It's important to use a very secure password for the wallet. If anyone were to gain access to your wallet they could quickly steal all of the coins inside.

Creating an online wallet is very simple to do at Blockchain.info.
Creating an online wallet is very simple to do at Blockchain.info.

Find Your Bitcoin Wallet Address

After creating the account log into the wallet using the identifier and password. The address of the wallet can be found on the main wallet home tab.

The address consists of 27-34 alphanumeric characters. This address is what you will provide to people so they can send you payments using Bitcoins.

Once you have a wallet you can give out your address so people can send you Bitcoins!
Once you have a wallet you can give out your address so people can send you Bitcoins!

Join a Bitcoin Mining Pool

While it is possible to mine for Bitcoins on your own it is not something I would recommend doing. Solo mining requires an incredible amount of processing power which most people don't have access to.

Pooled mining allows miners to group up to solve blocks and earn Bitcoins together. Each miner that joins the pool earns shares for the work they contribute.

Each time the pool finds a block (currently worth 12.5 BTC) the Bitcoins earned are divided among the users in the pool based on how many shares they earned in the particular round.

There are many different mining pools you can join, each pool has their on pros and cons. As you learn more about Bitcoins you will be able to make a more educated decision of which pool is best for you.

I recommend joining AntPool because it has some great features and is very easy to use.

Creating an Account at AntPool

The process for joining most Bitcoin mining pools is very similar but in this guide I'll show you how to start mining with AntPool.

The first step in joining the pool is to register for a new account.

AntPool registration page.
AntPool registration page.

Create a Subaccount

After registering with AntPool you will need to create a sub account and associate a Bitcoin wallet. Payments will be sent from the pool to this wallet address once the payment threshold has been reached.

After logging in click on the settings like to create a new sub account. Once you've created a sub account click the edit link to add your Bitcoin wallet address.

The changes to your account will need to be confirmed by responding to the email sent from AntPool.

AntPool sub account management.
AntPool sub account management.

Creating a Worker

Next you need to setup a worker, click on the dashboard tab then workers. You will need one worker account for each copy of CGMiner you intend to run.

Creating an AntPool worker.
Creating an AntPool worker.

Download and Configure CGMiner

At this point you should have a Bitcoin wallet which is now associated with the AntPool worker. This means you are finally ready to start actually mining for Bitcoins!

There are several different Bitcoin mining clients available but I will be showing you how to use CGMiner.

CGMiner is a GPU/FPGA bitcoin mining program written in C. It is compatible with both Windows and Linux operating systems.

Among the great features of CGMiner are support for overclocking, hardware monitoring, fan speed control and also remote interface capabilities.

Cgminer version 3.7.2 is the latest version with GPU support. Versions later than 3.7.2 do not support GPUs (only ASICs).

Extract the Contents of the Zipfile

After downloading the compressed zip file open the archive. You can use 7zip to extract the contents of the file. Inside the archive you'll find a folder called cgminer-3.7.2-windows.

Move this folder to C:\ and rename it to cgminer.

You should end up a with a folder called c:\cgminer , the contents should like like the image below.

Edit the CGMiner.conf File

Nest you need to enter the pool settings into the cgminer.conf file contained inside the c:\cgminer directory where you extracted the files.

Edit the existing cgminer.conf file and modify the pools section as shown below. Replace subaccount.worker with the name of your own sub account and worker you created in the AntPool dashboard.

Remove the extra pool sections unless you intend to add configure multiple pools.

"pools" : [
	{
		"url" : "stratum+tcp://stratum.antpool.com:3333",
		"user" : "subaccount.worker",
		"pass" : ""
	}
The finished cgminer.conf file should look similar to this.
The finished cgminer.conf file should look similar to this.

Launching CGMiner

Once the config file has been modified you are ready to start mining for Bitcoins using CGMiner. Double click on cgminer.exe to start the miner.

If your configuration is correct CGMiner launch, connect to the mining pool, and start mining for Bitcoins.

Each of the GPUs detected by CGMiner will be lised in the second section below the summary. The current hash rate for each card will be displayed in Mh/s (Mega hashes per second).

CGMiner in operation mining for Bitcoins.
CGMiner in operation mining for Bitcoins.

Troubleshooting CGMiner

If you're unable to get CGMiner working here are some common things you should check first.

  • Install the latest version of the video card drivers
  • Try launching cgminer directly from the command prompt instead o to check for error messages.
  • Double check the worker name entered in the cgminer.conf file.

CGMiner Video Tutorial

Checking the Worker Stats in the Mining Pool

Once CGMiner starts mining for Bitcoins you can check the status of the worker in the mining pool web interface. Most pools take somewhere between 5-15 minutes before they will start showing statistics for the worker online.

If CGMiner was able to successfully connect to the pool you will see the current speed and an estimate of the workers profitability per day.

If you do not see any stats after the miner has been running for a while check the username and pool settings in the CGMiner config file.

AntPool worker dashboard.
AntPool worker dashboard.

Moving Forward with Bitcoin

Mining for your own Bitcoins is a great way to learn more about digital currency. You might find that you enjoy mining enough to become a hardcore enthusiast and purchase high end mining hardware such as the ASIC miners designed by Bitmain.

If you decide that mining Bitcoins isn't for you it's still easy to be involved with Bitcoins in other ways. You can buy and sell Bitcoins on many of the popular exchanges such as Coinbase.

Questions & Answers

  • In terms of Bitcoins, should you only run 1 miner per GPU? I've started 2, but wonder if that is more or less efficient.

    Generally, the most optimal configuration is to run a single copy of cgminer as it should efficiently use the entire GPU. To test which method is best you can add the hash rate of the two miners together and compare if it is higher or lower than the total hash rate of a single miner.

© 2013 Sam Kear

What are your thoughts on Bitcoins?

    0 of 8192 characters used
    Post Comment

    • profile image

      Majid 

      4 weeks ago

      Starting to do these instructions, I did not receive any Hash rate on top of Antpool. What is the problem with hashing results demonstration on my Antpool account?

    • skear profile imageAUTHOR

      Sam Kear 

      5 months ago from Kansas City

      @mariusz

      The Raspberry Pi works great for controlling ASIC miners. I'm not aware of any mining software for other microcontrollers, most requires either Windows, Linux, or Mac.

      https://www.samkear.com/hardware/raspberry-pi-cont...

    • profile image

      mariusz 

      5 months ago

      hello, is there a commercial sense of connecting arduino 328, leonardo, stm32, teens. where to look for ready examples of mini excavators.

    • profile image

      Ananth 

      7 months ago

      How to get gpu device ? Just regular cpu and add graphics card?

    • skear profile imageAUTHOR

      Sam Kear 

      8 months ago from Kansas City

      @Chris

      It sounds like it's unable to connect to the mining pool. Double check the server address, worker name, and password in cgminer.conf and make sure they are correct.

    • profile image

      Chris 

      8 months ago

      I followed this guide now and i get this in cgminer: pool 0 JSON stratum auth failed: (null) Do you know whats wrong?

    • profile image

      Chris 

      8 months ago

      I tried doing this but i always get this message: Rejected and there are some numbers and its says GPU 0 ( Too low Difficulty)

    • skear profile imageAUTHOR

      Sam Kear 

      8 months ago from Kansas City

      @Plamen

      The Eclipse pool has shutdown. I'm currently working on updating this article but in the mean time I recommend checking out www.antpool.com instead.

      You may also want to take a look at my most recent mining article which explains how to earn Bitcoins with NiceHash. I suspect you may earn more with it instead.

      https://toughnickel.com/personal-finance/How-to-Ea...

    • profile image

      Antho 

      9 months ago

      I have 3 gpus, i can only get 2 of them mining.. It shows 3 gpus in cgminer screen after running batch file, one off them show OFF, any idea why?? Thanks

    • profile image

      Felippe 

      10 months ago

      I'm getting this error:

      cgminer.exe: -d: unrecognized option

      I'm using the latest version (4.10.0)

    • profile image

      Ness 

      10 months ago

      OK, great intro. Thanks.

      But, what if miner.bat not opening? Seems it starts, shows 2 fast cmd windows, and that's it. Nothing opened after that...

    • profile image

      tarun.soni2308@gmail.com 

      20 months ago

      Perfect blog info about bitcoin.

    • profile image

      Dan 

      2 years ago

      CGMiner throws up errors with the other switches except username/password.

      I think the biggest flaw is the /? switch isn't supported :(

    • skear profile imageAUTHOR

      Sam Kear 

      2 years ago from Kansas City

      @muhammad

      Try running the batch file from a command prompt in order to see what error message you are receiving.

    • moviesreviews profile image

      Cacey Taylor 

      3 years ago from San Diego, CA

      Great article - Very educational

    • tsadjatko profile image

      4 years ago from now on

      You see this? http://www.wallstreetdaily.com/wallstreet-research...

      Isn't it true the more bitcoins that are mined (added to the total out there) the longer it takes to create one and then more expensive machine you'll need to mine them in a reasonable time. Isn't it very late to come to this party all ready (seems like a ponzi scheme).

    • skear profile imageAUTHOR

      Sam Kear 

      5 years ago from Kansas City

      @Michael - Once more of the ASIC miners start coming on line GPU mining will probably become much more difficult. Many people are actually planning to start mining Litecoins at that time.

      You are correct in that it can take quite a while to generate one Bitcoin depending on how powerful your system is. Luckily by joining a pool you can earn fractions of a Bitcoin. Each coin is divisible by 8 decimal places.

      At today's current price .1 BTC is still worth about $12.

      You can run a quick calculation to determine if mining is profitable for you using one of the many online tools. You'll need to know the power draw of your miner, hash rate, and how much you pay per kilowatt for electricity.

      http://www.bitcoinx.com/profit/

    • Michael Poon profile image

      Michael 

      5 years ago from Australia

      very interesting, i'm still wondering if doing this is worth it...i have a very good GPU, but i've heard it can take up to months just to find 1 coin

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, toughnickel.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://toughnickel.com/privacy-policy#gdpr

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)