How To: Mine Ethereum on your PC

ETHEREUM-LOGO_PORTRAIT_Black_small

This article will explain how you can begin to mine Ethereum on the PC that you have right now. I will keep to basics that will apply to almost everyone and toward the end of the article I will offer additional guidance for those who may want to setup dedicated computers for mining, also known as a rig.

First off a disclaimer; attempting to mine Ethereum, or any cryptocurrency for that matter on a computer, will tend to run it harder than normal. This combined with 24/7 operation can pose additional problems including, but not limited to: noise, excess heat build up, accelerated wear and failure of the PC, and increase risk of a fire hazard. Please carefully consider these risks before attempting to mine, as you do so at your own risk.

technology-computer-chips-gigabyte

To mine Ethereum on your own PC you will need to make sure it meets a few requirements. While you can mine on almost any PC that has a dedicated graphics card (even certain Notebooks), you will have the best results with a recent model AMD or Nvidia card that plugs into one of the PCI-E slots on the motherboard. The graphics card should also have 2GB+ (4 GB+)* of on-board memory to handle the DAG file. Ethereum can also be mined using just your CPU, but it has grown to the point now that you will gain little reward for your efforts. This guide is mainly going to be useful for those with a dedicated graphics card, so the remainder of the article assumes that is the case.

*Update May 2017: Ethereum now requires a graphic card with at least 4GB of on-board RAM as the DAG file has surpassed the abilities of 2GB cards. You can however still mine many Ethereum “‘Clones” such as Expanse with a 2GB card, or switch the the Equihash algorithm and mine coins such as Zcash. I would recommend if you are buying a GPU new at this point to get one with at least 4GB of RAM, and if the price difference isn’t too big even 8GB.

The second thing is you will want to ensure that your computer has at least 8 GB of RAM. This should be the case of most modern PCs, but you may run into issues with less than this amount. Other considerations are that you have a dedicated Internet connection as you will get the most benefit mining 24/7 and don’t want to be knocked offline if someone shuts down your router or network at night. You may also want to look at any power savings settings to make sure your computer is not configured to turn off or go to sleep, as we want to mine 24/7 for optimal mining results. Although you are free to mine only portions of the day, this guide is assuming you want to setup your system for 24/7 mining.

Not really a requirement, but good practice for going along with the above if you do plan to mine 24/7, is that you may want to ensure the computer is not in a room where mining will pose a problem, such as in a sleeping area. Since mining will be pushing the PC a bit harder than normal, its fans will be running at a higher speed causing more noise and heat than usual, so this could be a concern.

Miner04 3x R9-380 025
There is also the small chance of a fire hazard, should the PC give out due to the increased stress of running harder than usual, so you want to make sure it is situated where an errant spark would not start a fire. Make sure it is on a solid surface such as a desk that is free of any flammable materials and with plenty of space for ventilation. This is also another reason to not setup a mining PC in a sleeping area. If you do, please be sure you have a working smoke detector, which you should have in any event, near the PC.

This may also be a good time to shut your computer off and gently vacuum out any built up dust. This can especially build up around fans/heat-sinks and the power supply inlets. Since you will be running you computer a bit harder you will want to give it all the fresh cool air you can. Remember, plenty of ventilation to introduce cool air and exhaust warm air will go a long way to ensuring your PC runs stable and minimize any risks due to overheating.

OK, so with all that out of the way let’s get to setting up the computer to mine. For now I am assuming you are going to use your normal PC. Just keep in mind that mining will require heavy use of your graphics card, so you will not be able to do things like gaming when you are mining. Many people setup dedicated computers (rigs) for this reason, but for now it will be fine to use your main computer, just keep in mind it may run a but slower than usual.

cmd_mining

Download the mining software

You will need a program called, appropriately enough, a miner to be able to mine Ethereum. You can mine with the Ethereum client Eth directly to your wallet, but if you choose to mine to a pool and do not want to hassle of setting up the Ethereum command line client and downloading the blockchain, you can take a short cut and install a pre-compiled miner. You can download a zip file of the files you need here: Ethminer

Other options include Genoil’s Miner with discussion found here.

You can also try out Qtminer with a local zip file provided here: qtminer.zip.

*Update May 2017: The current go to favorite for first time miners is the latest version (9.4 as of this update) of the Claymore Ethereum Dual Miner that can be found on the Bitcoin Talk thread here.

Configuring the software

Extract the file somewhere on your computer that you can easily find. Now open up the folder and you will find several example .bat files inside that you can configure. If you are on Windows and have a AMD card, you can probably pick eth-mine-pool.bat to modify. Open up the .bat file, right click and select edit, if asked use notepad.

Inside you will see a line similar to:
eth -F http://eth-us.dwarfpool.com/0xf9421f887c720ffeba142a16c5f99a34470cf1f7/miner-05 -G

This line basically says: launch the (eth) miner program, use Farm mode (-F), point to pool (http://eth-us.dwarfpool.com/),
with wallet address (0xf9421f887c720ffeba142a16c5f99a34470cf1f7),
and separate the stats for a miner named (miner-05). The final (-G) just says to use OpenCL using your GPU.

*Update May 2017: You can use the following line in the batch file if you are using the Claymore 9.4 Ethereum Dual Miner linked above:

EthDcrMiner64.exe -epool us1.ethermine.org:4444 -ewal 0xf9421f887c720ffeba142a16c5f99a34470cf1f7.%COMPUTERNAME% -epsw x -esm 1 -estale 0 -mode 1 -asm 1 -dcri 8

You will need to change the pool url, wallet address and rig name to match your own settings. The %COMPUTERNAME% variable will use your PCs name and is useful if you have many rigs. Be sure to save the file when done.

If you need to setup an exchange wallet you can see the guide: How to: Setting up an wallet on an Exchange. If you need help with setting up a pool account, you can reference the guide: How To: Mine Ethereum at Dwarfpool

Mining_ENV_Variables
Running the software

Once you have all the above completed, running the software is as simple as double clicking on the .bat file you just modified and saved. A command window will open and begin generating a DAG file. This file is used by the miner to actually perform the hashing that will try and generate a valid mining share, Once a valid share has been computed it will forward it to the pool and if validated give you a credit.

If you see lines similar to: Solution found; Submitting to http://exp-us.dwarfpool.com.....
and a bit later main B-) Submitted and accepted., congratulations, you are successfully mining.

UPDATE: “GPU can’t allocate the DAG in a single chunk”

*Update May 2017: Note that since this previous update was posted the DAG file for Ethereum has grown beyond 2 GB and the following trick will no longer work on most cards. The best thing now is to  mine Ethereum on 4GB or larger cards. If you have 2GB cards, you can mine either an Ethereum clone such as Expanse, or switch to a Equihash algorithm such as Zcash, which will probably be a lot more profitable in any case with the older hardware.

I am copying this information from the post, Ethereum Mining – “GPU can’t allocate the DAG in a single chunk” which you can check for more back ground and information. I have listed the basic information related to mining below:

This is a known issue that the Ethereum developers have developed a work-around for, however it is not yet in any released version of miner software. The problem is that while there is technically enough memory, the card cannot allocate it all in one go, therefore it errors out.
ethminer-bat-file
There is a temporary workaround until an fix is officially released, in that by setting certain environmental variables on your computer you can mitigate the issue. The easiest way to do this is simply by adding a few commands to your miner launch batch (.bat) file. The following .bat file shows these environment variables for Windows:
setx GPU_FORCE_64BIT_PTR 0
setx GPU_MAX_HEAP_SIZE 100
setx GPU_USE_SYNC_OBJECTS 1
setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_SINGLE_ALLOC_PERCENT 100
timeout /t 3
ethminer --farm-recheck 400 -G -F http://172.16.0.225:8546/miner-09 --cl-global-work 16384 --cl-local-work 256

The setx is a command for Windows to set x(environmental) variables for the system to use. In this case we are setting GPU variables to maximize the allocation of memory to its max. While some miners have been using a subset of these since the scrypt mining days, the last variable “GPU_SINGLE_ALLOC_PERCENT” seems to be the one we will need to address the recent error, in that it allows a single allocation to use the maximum amount of memory.

The “timeout /3” is optional, and simply introduces a slight pause so you can watch for “Value successfully set” messages on launch.

The final line is the familiar launch string for the Ethminer program. The settings are suggested for video cards such as the AMD R9 380 and AMD R7 370 series. A “farm-recheck” value of 400 has shown to be effective with cl-global-work values of 16384 and 8192 which these cards are capable of. The cl-local-work value of 256 is also optimum for these cards and can be set to match the ” CL_DEVICE_MAX_WORK_GROUP_SIZE” value as shown below, in this case it is 256.

ethminer_work_group_size

You can also look at the “CL_DEVICE_MAX_MEM_ALLOC_SIZE” value, to see what the maximum DAG file your card will support. In this example I am using 2 GM cards, with a maximum usable memory allocation of: 1878490204 bytes (1.878 GB) before I would be unable to mine Ethereum with these anymore.

The current DAG file size is 1.384 GB in size, giving these cards about 500 MB more in DAG file growth before they will no longer mine Ethereum. Do note that there are other algorithms, such as SOIL and EXPANSE that also use the Dagger-Hashimoto algorithm and are currently profitable to mine, so once this point arrive it does not necessarily means the cards are worthless, you would just need to switch to another profitable coin.