Overclock.net › Forums › Distributed Computing › Litecoin › [Guide] How to setup CGMiner for mining LTC
New Posts  All Forums:Forum Nav:

[Guide] How to setup CGMiner for mining LTC

post #1 of 98
Thread Starter 
So with the increase of people looking into coin mining i tought i would write a guide on how to setup CGMiner. Usually the people new to mining go with something like GUIMiner because its a little easier to setup. While its easier to setup CGMiner isn't hard to setup either and is easier to optimize for your GPU to get the most out of it. For this guide i'll be using Litecoin since i'm mining that but every other Scrypt based coin should work for this. Also this is my first guide so go easy on me tongue.gif

So before we start with CGMiner you should have already registered at a mining pool and have a wallet setup if not @Jeffinslaw has a nice guide on how to start mining for Litecoin [Tutorial] How to Start Mining Litecoins

Litecoin Pools: Warning: Spoiler! (Click to show)
So first we need to download 3.7.2 (which is the last version to support GPU mining) of CGMiner from here. After you have downloaded CGMiner unpack the Zip file with WinRAR or WinZip.

So now that you have the files its time to setup everything so that you get the most out of your GPU. There are 3 ways of settings up CGMiner which are trough the program itself, with a Config files and with a Batch file. For this guide i will be using the Batch file method and i might add the Config file method later down the road.

Now open Notepad or any other text editor you might be using and start by typing the following
Code:
cgminer --scrypt -o [poolurl:[port] -u [username].[workername] -p [password]

For example i mine on Give-Me-Coins so this is what it looks like for me.
Code:
cgminer --scrypt -o ltc.give-me-coins.com:3334 -u Stuuut.1 -p 1234

-u is your username+worker that you made on the pool website and -p is for the password you set it at. I recommend using a simple password since the only thing that it can be used for is mining for your account so its of no use to anybody unless they want to give you money.

At the top of the batch file put this code in this will allow your GPU to be fully used by CGMiner.
Code:
setx GPU_MAX_ALLOC_PERCENT 100

These settings will be enough to get you started mining without even optimizing it for your GPU. So now you should save this into your CGMiner folder as a batch file. Go to Save As in notepad and then change Save as type: to All Files and put .bat behind the name.


Sorry for the Dutch language on my laptop right now might change it in the near future

So now for the optimizing part. There are a few parameters to optimize your CGMiner to your GPU. Warning: Spoiler! (Click to show)
-w
Worksize 64, 128, 182 or 256 where 256 is the maximum

-I
Intensity is pretty crucial too high and it will lower your hash rate and give HW errors and too low will also lower your hash rate. Intensity can be set from 0 to 20.

-g
Once you have found the optimal shaders and intensity, you can start increasing the -g value till cgminer fails to start. Rarely will you be able to go over about -g 4 and each increase in -g only increases hashrate slightly.

--shaders
Use the shader count that your GPU has

--thread-concurrency
This tunes the optimal size of work that scrypt can do. It is internally tuned by cgminer to be the highest reasonable multiple of shaders that it can allocate on your GPU. Ideally it should be a multiple of your shader count. vliw5 architecture (R5XXX) would be best at 5x shaders, while VLIW4 (R6xxx and R7xxx) are best at 4x. Setting thread concurrency overrides anything you put into --shaders.

Now for your GPU settings in CGMiner i'll use mine as an example. Warning: Spoiler! (Click to show)
--gpu-engine 960 (gpu clocks you want to use)
--gpu-fan 10-85 (fan speed you want to use)
--gpu-memclock 1350(memory clocks you want to use)
--gpu-powertune 20 (powertune i always leave it at 20)
--gpu-vddc 0.000 (voltage control)
--temp-cutoff 95 (max temperature untill CGMiner stops i usually put it at 95)
--temp-overheat 85
--temp-target 75 (max temperature you want to reach so it can adjust the fan speed you set at --gpu-fan)

When CGMiner is running look out at the [R] and [HW] points [R] should be below 1% of your accepted other wise it will slow down your hashrate too much for [HW] errors there should be 0 if not your settings arn't the correct ones.



So here is what my batch file for CGMiner looks like with an unlocked HD6950 and remember these are guide lines so what works for me might not work good for you so you have to play a bit with these settings. Also my thread concurrency is higher then what this guide says it should be so as you can see its not the be all end all guide these are just guidelines.

So finally here is what my batch file looks like which gets me 470 khash/s
Code:
setx GPU_MAX_ALLOC_PERCENT 100
cgminer --scrypt -o ltc.give-me-coins.com:3334 -u Stuuut.1 -p 1234 --thread-concurrency 8064 -I 18 -w 256 -g 2 --gpu-engine 960 --gpu-fan 10-85 --gpu-memclock 1350 --gpu-powertune 20 --temp-cutoff 95 --temp-overheat 85 --temp-target 75

Also check https://litecoin.info/Mining_hardware_comparison for which settings might work for your GPU and tweak them from there.

Will update this thread for using 2 GPU's and 2 different GPU's and only using 1 of 2 GPU's in your PC soon

If you see something thats wrong please let me know. Other then that have fun mining guys thumb.gif
Also if you guys would like post your batch file settings in here and i'll add them to the OP so people can see some settings for their cards.
Edited by Stuuut - 12/13/13 at 3:59am
    
CPUMotherboardGraphicsGraphics
Intel Core i5-2500k @ 4.5GHz ASUS P8Z68-V Pro Sapphire Tri-X R9 290X Sapphire HD 6950 2GB DiRT 3 Edition / Unlocked ... 
RAMHard DriveHard DriveOptical Drive
16 GB Corsair Vengeance LP DDR3-1600 CL9 Western Digital Caviar Blue 1TB Samsung 830 256GB LG BH10LS30 
CoolingCoolingOSMonitor
Thermalright Venomous-X Black Edition 2x Noiseblocker S-Series M12-P Windows 7 Ultimate x64 HP 2510i 
KeyboardPowerCaseMouse
Corsair vengeance K90 EVGA SuperNOVA P2 Cooler Master HAF X Razer DeathAdder 3.5G 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
Intel Core i5-2500k @ 4.5GHz ASUS P8Z68-V Pro Sapphire Tri-X R9 290X Sapphire HD 6950 2GB DiRT 3 Edition / Unlocked ... 
RAMHard DriveHard DriveOptical Drive
16 GB Corsair Vengeance LP DDR3-1600 CL9 Western Digital Caviar Blue 1TB Samsung 830 256GB LG BH10LS30 
CoolingCoolingOSMonitor
Thermalright Venomous-X Black Edition 2x Noiseblocker S-Series M12-P Windows 7 Ultimate x64 HP 2510i 
KeyboardPowerCaseMouse
Corsair vengeance K90 EVGA SuperNOVA P2 Cooler Master HAF X Razer DeathAdder 3.5G 
  hide details  
Reply
post #2 of 98
delve into intensity a bit more. For example I think 14-17 are useless and will actually not work, and you can go over 20 but that will likely crash your driver. And while this may be debatable I think messing with thread concurrency vs shaders is more important for tweaking for better rates. https://www.youtube.com/watch?v=bj6-DUtHU2c

This guy provides a LOT of info in his 3 part youtube video series on starting up. Excellent guide btw, keep on adding to it biggrin.gif
Edited by DirkDaring - 12/12/13 at 6:46pm
BBW
(9 items)
 
  
CPUMotherboardGraphicsRAM
Bulldozer FX - 8120 Gigabyte GA-990FXA-UD3 Gigabyte Radeon HD 6850 Samsung's Best kept secret 
Hard DriveCoolingOSPower
Mushkin Enhanced Chronos Deluxe Spire TME 3 Windows 7 Ultimate 64 bit Corsair HX-850 
Case
Antec 1200 
  hide details  
Reply
BBW
(9 items)
 
  
CPUMotherboardGraphicsRAM
Bulldozer FX - 8120 Gigabyte GA-990FXA-UD3 Gigabyte Radeon HD 6850 Samsung's Best kept secret 
Hard DriveCoolingOSPower
Mushkin Enhanced Chronos Deluxe Spire TME 3 Windows 7 Ultimate 64 bit Corsair HX-850 
Case
Antec 1200 
  hide details  
Reply
post #3 of 98
Stuuut, what drivers are you using with your HD 6950?
post #4 of 98
The only missing thing is a simple explanation of the flags you used in your batch file, or others available. That takes me quite a bit of time at the beginning. I think it has it place in a cgminer guide. But other than that it's very clear and well done thumb.gif
post #5 of 98
Thread Starter 
Quote:
Originally Posted by DirkDaring View Post

delve into intensity a bit more. For example I think 14-17 are useless and will actually not work, and you can go over 20 but that will likely crash your driver. And while this may be debatable I think messing with thread concurrency vs shaders is more important for tweaking for better rates. https://www.youtube.com/watch?v=bj6-DUtHU2c

This guy provides a LOT of info in his 3 part youtube video series on starting up. Excellent guide btw, keep on adding to it biggrin.gif

Well intensity works differently on each card for example on my HD6950 an intensity of 20 works pretty good only problem is my PC becomes unusable because it slows down so much so i set it a little bit lower
Quote:
Originally Posted by MakubeX View Post

Stuuut, what drivers are you using with your HD 6950?

I'm on 13.4 i think.
Edited by Stuuut - 12/13/13 at 3:28am
    
CPUMotherboardGraphicsGraphics
Intel Core i5-2500k @ 4.5GHz ASUS P8Z68-V Pro Sapphire Tri-X R9 290X Sapphire HD 6950 2GB DiRT 3 Edition / Unlocked ... 
RAMHard DriveHard DriveOptical Drive
16 GB Corsair Vengeance LP DDR3-1600 CL9 Western Digital Caviar Blue 1TB Samsung 830 256GB LG BH10LS30 
CoolingCoolingOSMonitor
Thermalright Venomous-X Black Edition 2x Noiseblocker S-Series M12-P Windows 7 Ultimate x64 HP 2510i 
KeyboardPowerCaseMouse
Corsair vengeance K90 EVGA SuperNOVA P2 Cooler Master HAF X Razer DeathAdder 3.5G 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
Intel Core i5-2500k @ 4.5GHz ASUS P8Z68-V Pro Sapphire Tri-X R9 290X Sapphire HD 6950 2GB DiRT 3 Edition / Unlocked ... 
RAMHard DriveHard DriveOptical Drive
16 GB Corsair Vengeance LP DDR3-1600 CL9 Western Digital Caviar Blue 1TB Samsung 830 256GB LG BH10LS30 
CoolingCoolingOSMonitor
Thermalright Venomous-X Black Edition 2x Noiseblocker S-Series M12-P Windows 7 Ultimate x64 HP 2510i 
KeyboardPowerCaseMouse
Corsair vengeance K90 EVGA SuperNOVA P2 Cooler Master HAF X Razer DeathAdder 3.5G 
  hide details  
Reply
post #6 of 98
Quote:
Originally Posted by Stuuut View Post

I'm on 13.4 i think.
What a coincidence, iirc me too.

Btw, thanks for the tutorial. +rep thumb.gif
post #7 of 98
Thread Starter 
Quote:
Originally Posted by MakubeX View Post

What a coincidence, iirc me too.

If you want you can post your batch file here so i can add it to the op and make a library of settings and cards
    
CPUMotherboardGraphicsGraphics
Intel Core i5-2500k @ 4.5GHz ASUS P8Z68-V Pro Sapphire Tri-X R9 290X Sapphire HD 6950 2GB DiRT 3 Edition / Unlocked ... 
RAMHard DriveHard DriveOptical Drive
16 GB Corsair Vengeance LP DDR3-1600 CL9 Western Digital Caviar Blue 1TB Samsung 830 256GB LG BH10LS30 
CoolingCoolingOSMonitor
Thermalright Venomous-X Black Edition 2x Noiseblocker S-Series M12-P Windows 7 Ultimate x64 HP 2510i 
KeyboardPowerCaseMouse
Corsair vengeance K90 EVGA SuperNOVA P2 Cooler Master HAF X Razer DeathAdder 3.5G 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
Intel Core i5-2500k @ 4.5GHz ASUS P8Z68-V Pro Sapphire Tri-X R9 290X Sapphire HD 6950 2GB DiRT 3 Edition / Unlocked ... 
RAMHard DriveHard DriveOptical Drive
16 GB Corsair Vengeance LP DDR3-1600 CL9 Western Digital Caviar Blue 1TB Samsung 830 256GB LG BH10LS30 
CoolingCoolingOSMonitor
Thermalright Venomous-X Black Edition 2x Noiseblocker S-Series M12-P Windows 7 Ultimate x64 HP 2510i 
KeyboardPowerCaseMouse
Corsair vengeance K90 EVGA SuperNOVA P2 Cooler Master HAF X Razer DeathAdder 3.5G 
  hide details  
Reply
post #8 of 98
Sure, I can do that when I get home tonight.
post #9 of 98
Quote:
Originally Posted by Stuuut View Post

Well intensity works differently on each card for example on my HD6950 an intensity of 20 works pretty good only problem is my PC becomes unusable because it slows down so much so i set it a little bit lower
I'm on 13.4 i think.

Aye I guess it's more for tweaking later after people actually get comfortable with mining and start messing with settings. I hated running 20 because I couldn't do anything else ;-/. But found some settings that worked great biggrin.gif
BBW
(9 items)
 
  
CPUMotherboardGraphicsRAM
Bulldozer FX - 8120 Gigabyte GA-990FXA-UD3 Gigabyte Radeon HD 6850 Samsung's Best kept secret 
Hard DriveCoolingOSPower
Mushkin Enhanced Chronos Deluxe Spire TME 3 Windows 7 Ultimate 64 bit Corsair HX-850 
Case
Antec 1200 
  hide details  
Reply
BBW
(9 items)
 
  
CPUMotherboardGraphicsRAM
Bulldozer FX - 8120 Gigabyte GA-990FXA-UD3 Gigabyte Radeon HD 6850 Samsung's Best kept secret 
Hard DriveCoolingOSPower
Mushkin Enhanced Chronos Deluxe Spire TME 3 Windows 7 Ultimate 64 bit Corsair HX-850 
Case
Antec 1200 
  hide details  
Reply
post #10 of 98
your bat file should start out like this for the commands to pass to cgminer correctly what i read from mutiple sites. And once you run cgminer 1 time with the bat you can hit s and hit w to have it write the config for you so you dont have to even use a bat file. I use cgwatcher and configs so i can switch pools easy and cgwatcher can do alot of failsafe stuff incase a driver crashes so on.

my sample bat i used to use
Quote:
@echo on
ECHO "cgminer miner startup"
ECHO.
setx GPU_MAX_ALLOC_PERCENT 100
setx GPU_USE_SYNC_OBJECTS 1

cgminer.exe --scrypt -blah blah blah
SABERWOLF
(22 items)
 
XEON-WOLF
(18 items)
 
 
CPUMotherboardGraphicsRAM
X5675@4400 1.344 ASUS P6X58D-E asus 5850 F3-12800CL7T-6GBPI 6-7-6-21 1T 
RAMHard DriveHard DriveHard Drive
F3-12800CL9S-4GBRL WDC WD1001FALS-00J7B1 ST31000340AS WDC WD7500AAKS-00RBA0 
Hard DriveOptical DriveCoolingOS
Hitachi HDS723020BLA642 ihas 624-A SilverStone Heligon HE01 windows 10 64 Pro 
MonitorPower
Vizio 42inch lcd tv SeaSonic M12D SS-850 850W  
  hide details  
Reply
SABERWOLF
(22 items)
 
XEON-WOLF
(18 items)
 
 
CPUMotherboardGraphicsRAM
X5675@4400 1.344 ASUS P6X58D-E asus 5850 F3-12800CL7T-6GBPI 6-7-6-21 1T 
RAMHard DriveHard DriveHard Drive
F3-12800CL9S-4GBRL WDC WD1001FALS-00J7B1 ST31000340AS WDC WD7500AAKS-00RBA0 
Hard DriveOptical DriveCoolingOS
Hitachi HDS723020BLA642 ihas 624-A SilverStone Heligon HE01 windows 10 64 Pro 
MonitorPower
Vizio 42inch lcd tv SeaSonic M12D SS-850 850W  
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Litecoin
Overclock.net › Forums › Distributed Computing › Litecoin › [Guide] How to setup CGMiner for mining LTC