Tag Archives: cgminer parameters explained

An Advanced Guide to Mining Dogecoin with CGMiner

If you haven’t already seen it, be sure to check out the guide to getting started with CGMiner.

Just a warning before we start, if you let your card run too hot, you can risk the chance of permanently damaging it.  80 is what I keep my cards at, and some can go to 85 and even higher safely, but you will want to check with the specific card on what it can handle, some can be more and some are less.

So the basic guide can get you started with mining, but you won’t be really getting the most out of your card.  This will go over some of the advanced settings that you can try out to get more out of it.

Beware, this can be tedious and/or frustrating.  Your card will crash and you will need to reboot when you are trying to find the best settings.   You may have driver issues. You might want to just find someone who has the same card as you and see what specs they used.  If you want to not go through the hassle, this is a good place to start.

So here’s what CGMiner looks like after I start it with the bare config:

The two most important values are highlighted above.  The Blue(on the left) is the temperature.  The red(on the right) is the kH/s (Kilohash/sec), which means how much work your cards are doing.

This is with 2x270s. This is really low.  So obviously I have a lot to work with.

1) Make sure you have a good set of drivers for your card.  I am using the latest catalyst beta drivers, found here.  Please note, some people have been having issues with these drivers, if you have drivers that are already working without issue with CGMiner, you may want to stick to those, or read more about which drivers may be best for your specific model card.  You can find some details around this here.

2) Next, you need to make a bat file or a launch script.  This guide will cover Windows.  We do this because there are some command line parameters we need to set to make your GPU work to its maximum potential.  Create the file cgminer.bat and place it in your CgMiner folder.

3) Copy this into the file:

setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1
cgminer.exe

This won’t work if you didn’t set your pool information in the cgminer.conf file from the first tutorial, so either do that as mentioned in the first tutorial or add them as parameters to cgminer.exe in the bat file.

Now from here we will start adding other parameters to increase our mining rate.  First I will go over some of the most used parameters and what they do, then afterwards we can see how we can actually go about getting the most out of our card.

Thread Concurrency:

--thread-concurrency is a parameter to tell your graphics cards how many different tasks it should be juggling at the same time. Depending on your card, this can be set for anything between 2-30,000.  It may or may not help your performance, but most people set it between 10,000-25000.  There is a way to get a good estimate on what thread count will be best, and this is detailed below.

GPU Overclocking Parameters:

The parameters --gpu-memclock and --gpu-engine allow you to specifically overclock your cards.  If you don’t know the defaults off the top of your head, a quick way is to go into CgMiner and Press G, it will take you to the graphics card details screen:

I’m running on low settings so it doesn’t lag me out while I do this tutorial = )

E: would be your --gpu-engine and  M: --gpu-memclock for GPU 1.  (You can also see these values if you go to change settings for a specific card). These are the baselines.  More detail on how to change these follows below.

Intensity: 

A value between 1-20, this is a general setting that makes our graphics cards work harder.  Putting it on 20 will put your cards into high speed. Intensity is usually the last parameter that you will set, after you tweak everything else.

Changing the file to this alone will make your hash rate go way up:

setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1
cgminer.exe -I 19

Where -I 19 is for intensity.

You can see the hash went up from 20kHs to almost 400kHs.  But you can also see that at the top, there is “HW:2″.  This is bad, it means we set the intensity too high.  We can try lowering it until we have no more HW errors.

So, Intensity is the clear cut choice to get fast results in your mining speed.  But there are other parameters that you may want to try out first.

Autofan and Temp Targets:

--auto-fan gives cgminer more control on keeping your cards a specific temperature. --temp-target 80 tells cgminer to keep your card around 80.  You can also use --temp-overheat 85  to help prevent overheating.  But these will need adjusted based on your card model.  You should have --auto-fan on when you are starting to put more work on your cards.

So before you start overclocking, lets start with this:

setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1
cgminer.exe --auto-fan --temp-target 80 --temp-overheat 85 -I 13

Depending on your card, your temp-target and temp-overheat may be different.  Be sure to look up some recommended temps for your card.  Reddit user RedstoneValley has pointed out that you shouldn’t be running your fans at 85% or more for long periods of time, as it will drastically reduce their lifespans.  So if you notice your fans going at full speed all the time, you should kick it down a few notches.  -I 13 is for Intensity 13, which we will use when we begin to overclock.

Changing the Parameters

Finding the Best Thread Concurrency

The Scrypt readme file has an excellent overview on finding the best thread concurrency:

First, find the highest thread concurrency that you can start it at. They should
all start at 8192 but some will go up to 3 times that. Don't go too high on the
intensity while testing and don't change gpu threads. If you cannot go above
8192, don't fret as you can still get a high hashrate.

Delete any .bin files so you're starting from scratch and see what bins get
generated.

First try without any thread concurrency or even shaders, as cgminer will try to
find an optimal value
cgminer -I 13

If that starts mining, see what bin was generated, it is likely the largest
meaningful TC you can set.
Starting it on mine I get:
scrypt130302Tahitiglg2tc22392w64l8.bin

See tc22392 that's telling you what thread concurrency it was. It should start
without TC parameters, but you never know. So if it doesn't, start with
--thread-concurrency 8192 and add 2048 to it at a time till you find the highest
value it will start successfully at.

So out of the file that looks like this in your cgminer directory:

scrypt130302Tahitiglg2tc22392w64l8.bin

Pull out the value that looks like the highlighted, and use + 2048 that for --thread-concurrencyif it works, add another 2048, and so forth.  When it crashes, use the value previous to that.  This will be for moving further into customizing the parameters, after we are finished overclocking, we will readjust it again.

So if you got to 24440 before you crashed, your file looks like this:

setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1
cgminer.exe --auto-fan --temp-target 80 --temp-overheat 85 -I 13 --thread-concurrency 24440

Overclocking your Card’s Memory Clock and Engine

Also, the Scrypt readme has an excellent explanation for finding the best parameters for your card:

Then start overclocking the eyeballs off your memory, as 7970s are exquisitely
sensitive to memory speed and amazingly overclockable but please make sure it
keeps adequately cooled with --auto-fan! Do it while it's running from the GPU
menu. Go up by 25 at a time every 30 seconds or so until your GPU crashes. Then
reboot and start it 25 lower as a rough start. Mine runs stable at 1900 memory
without overvolting. Overvolting is the only thing that can actually damage your
GPU so I wouldn't recommend it at all.

Then once you find the maximum memory clock speed, you need to find the sweet
spot engine clock speed that matches it. It's a fine line where one more MHz
will make the hashrate drop by 20%. It's somewhere in the .57 - 0.6 ratio range.
Start your engine clock speed at half your memory clock speed and then increase
it by 5 at a time. The hashrate should climb a little each rise in engine speed
and then suddenly drop above a certain value. Decrease it by 1 then until you
find it climbs dramatically. If your engine clock speed cannot get that high
without crashing the GPU, you will have to use a lower memclock.

Then, and only then, bother trying to increase intensity further.

So to do this, in CGMiner, from the main screen:

1. Press G

2. Then C for Change Settings

3. Then Select the GPU.  If all your GPUs are the same, I’d recommend NOT testing on the one that your monitor is hooked to, if you aren’t remoting in.

From here you can select E or M to modify these properties.

After you find good values, go add them to your bat file like this:

setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1
cgminer.exe --auto-fan --temp-target 80 --temp-overheat 85 -I 13 --thread-concurrency 24440 --gpu-engine xxxx --gpu-memclock xxxx

You can also find your specific model card(not just a 270, but which specific 270) and find out what other people are using in these parameters. This might give you an idea what might be good to use if you are feeling lazy. This is a good place to start.

Upping the Intensity

After you have found a good engine and memory clock, now you can start upping the intensity.  The -I 13 is what we started with, so you can go to -I 20, and if it shows HW errors or your fans start running too hard, take it down to 19, then 18, until you reach a comfortable level.

Refinding your Thread Concurrency

Final thoughts from the Author of CGMiner:

My final settings were:
--gpu-engine 1141  --gpu-memclock 1875 -I 20
for a hashrate of 745kH.

Note I did not bother setting a thread concurrency. Once you have the magic
endpoint, look at what tc was chosen by the bin file generated and then hard
code that in next time (eg --thread-concurrency 22392) as slight changes in
thread concurrency will happen every time if you don't specify one, and the tc
to clock ratios are critical!

So after you found good values for everything else, you take back out thread concurrency, and go back to letting the program generate the file. Then you copy the generated threadcount from the filename back to your startup script.

Other Parameters

Powertune:

This parameter tells CGminer that the cards are able to draw up to more power if it needs.  This is what it looks like as far as possible performance gains:

It is not advisable to set this over 20.  But it can be set with the --gpu-powertune command.

Shaders:

Shaders isn’t really used by anyone, because you can only use shaders or threadconcurrency, and thread concurrency is said to be superior . But this is what it does:

The --shaders XXX command provides a hint to cgminer on how to pick the best baseline parameters for mining.  I found this list for recommending settings for shaders:

GPU Shaders
7750 512
7770 640
7850 1024
7870 1280
7950 1792
7970 2048

6850 960
6870 1120
6950 1408
6970 1536
6990 (6970x2)

6570 480
6670 480
6790 800

6450 160

5670 400
5750 720
5770 800
5830 1120
5850 1440
5870 1600
5970 (5870x2)

It is from the cgminer readme on scrypt, found here.  It is also a good general readme on scrypt mining.  Again, --shaders doesn’t work with --thread-concurrency.

Work Size:

-w is the parameter for Work Size, or the size of jobs your cards will be doing.  Most people flag this at -256 to start for mid tier cards.  But the effect this parameter is described as “minimal”.

-g

This is labeled as an optional parameter that can give some small boost, but shouldn’t be be the first thing you go after.  It seems to crash cgminer if it is set any higher than 4, and many people leave it at 1 or 2.  Some people have gotten a lot more than others out of this.

Voltage:

Voltage may be set for cards by using --gpu-vddc.  This requires an unlocked BIOS and special drivers for your card.  Otherwise it won’t do anything.  This is a good one to explore if you want to make your cards run cooler/more energy efficient, but it is not generally recommended to touch for increasing, and you should know what you are doing here before you decide to touch it.

Example CGMiner.bat files

Sample completed bat file for a R9 270x (may not be your specific 270x), supplied from the wiki linked to above:

setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1
cgminer.exe -I 19 -g 1 -w 512 --thread-concurrency 15232

Sample 7950:

cgminer.exe -I 20 -w 256 --thread-concurrency 24000 --gpu-engine 1050 --gpu-memclock 1250 --gpu-vddc 1.087 --temp-target 80 --auto-fan

I left the pool info in the cgminer.conf doc, but you can add it as additional parameters to this file or leave it where it is. I prefer to have the pool info separate myself.

FAQ

This guide is not meant to be a starting point, please see the guide I posted here first.

1. Why doesn’t it work?

I set the --scrypt variable, the pool info, and other stuff in the last tutorial through the cgminer.conf file, if you are missing these values it won’t work.  Try getting the first tutorial to work first before you start on this tutorial.

If you are having problems starting CGMiner, try to go back to the basic config in the bat file. If there is a typo in your config file it won’t load up. Sometimes in two -- are getting transformed in my post to a single -- instead I tried to fix all of them, but maybe I missed one. So for parameters besides intensity try -- on the start.