Sunday, June 29, 2014

Ultimate guide to CGMiner

Settings you will need to understand to truely tweak your gpu. I will explain how to adjust each one later but you must understand each of these settings:


Intensity: How hard the miner is working. Each increase by one is DOUBLE the previous number of threads:

I:13 = 8192 threads

I:14 = 16384 threads

I:15 = 32768 threads

I:16 = 65536 threads

I:17 = 131072 threads

I:18 = 262144 threads

I:19 = 524288 threads

I:20 = 1048576 threads


As you can see this makes a major impact from level to level. You can use a comparison chart (Wiki) for all settings to get a good starting point for your gpu. If your feeling more crafty you can use xintensity.


Also with the new miners intensity limit has been increased up to 25. If your using a 290/290x you may want to go beyond the normal spectrum of 20 to see what happens thumb.gif (thanks for the reminder bargulator smile.gif)


xIntensity: Very new and still experimental and as far as I know only available from the kalroth release (see below). Seems to work flawlessly so far and gives a much more wide range of intensity. You can only use xintensity OR intensity NOT both. Calculated instead by the number of shaders your gpu has and multiplied by xintensity (Shaders*xI). So for example my 7870 and 270x have 1280 shaders, so any number I put in as the xintensity would be multiplied by 1280. both 80 (102400 which if you view above is equal to 16.7ish) and 111 (142080=17.25ish) seem to work really well on single thread I am not decided yet which is best will take some testing still biggrin.gif. Due to this I have also been able to get 2 threads to work which was not possible in the past. Its actually more productive and less system intensive to run 2 threads. I managed to get mine to run at xintensity=4 gpu-threads=2. This was NOT possible using normal intensity increases, Thanks kalroth!


Gpu-Threads: Now with the release of xintensity more cards will be able to hash at 2 threads and lower intensity. The reason you want this is less rejects. It may not work on all cards but its worth a shot. Alot of 280x/290x have no problem running 2 threads at a good hashrate (as they generally run at i-12 or i-13 with 2 threads anyways). My 7870 had to run on 1 thread to get the most performance. You will likely always end up on 1 or 2 threads.


Thread-Concurrency: This will be a tough one to tweak aswell. Best results are generally shaders*n+1. So for example my 7870 has 1280 shaders and i ended up personally thinking the best results came from 1280*8+1=10241 and also from 8193 which turns out seems to be a great number for MANY different cards using 2 threads. You will likely want to start with whats most common in the wiki.


Worksize: Can vary majorly from card to card. Alot of the tahiti and pitcairn cards use worksize 256. But you will still want to refer to the comparison chart (Wiki) to get the best starting point for your card. Then you will want to at least attempt multiple variations: 64,96,128,256 its possible any variation could see improvements. Most 7870 are at 128 or 256 while I personally got MUCH better results from 96. TRY EVERYTHING you never know what your card could do.


Device: Sets which gpu to use. I highly recommend using seperate cgminers for seperate gpu. You will have to make seperate config files (will explain later). But you want to set to “device” : “0″ for your first gpu then 1,2,3 etc for others. If multiple gpu of the same types end up on the same settings you can run them in the same cgminer window, again much easier to tweak seperately though (Easier to mine seperate servers, coins etc).


Queue, Scan-Time and Expiry: All these settings have to do with the work being accepted and givin back to the server. In most cases you will see much less stales and generally better wu/m from setting queue=0 scan-time=1 and expiry=1. Its very difficult to see results from adjusting these settings but best to either set them that way and forget about it or set to stock. Seems to help on multipools more then others.


Those were all the settings you will be tweaking in cgminer to get the best results from your card. I will explain below how to set everything up but you will first need to download the miner. As mentioned above as far as I know Kalroth’s release is the only one with xintensity. If you are not going to use xintensity then I recommend using sgminer. You can use the same settings for either one with only one minor difference I will mention below:


DOWNLOAD YOUR MINER


NEW MINER SGMINER 4.1 does xintensity, rawintensity and still follows the same sgminer updates. Will be updating guide soon with more info but heres the spot to get it if you need:


http://www.gigacog.com/sgminer-4.1.0.zip


another link if needed


https://www.dropbox.com/s/e9lk9yq7gshcn7o/sgminer-4.1-windows.zip


cgminer 3.7.3 Kalroth (highly recommended for optimum tweaking):


http://k-dev.net/cgminer/


sgminer 4.0.0 (recommended for normal settings, windows release in first reply):


http://www.reddit.com/r/litecoinmining/comments/1va8g2/ann_sgminer_400_release/


Either miner will work great and are much improved over the original cgminer 3.7.2 release.


CREATE A CONFIG


Once you have your miner downloaded and unzipped to a place you can easily access. You will then want to go into notepad and copy this:


CGMINER KALROTH:

Code:


“pools” : [


"url" : "stratum+tcp://mainpoolswebsite.com:7777",

"user" : "poolusername.workername",

"pass" : "workerpassword"

,


"url" : "stratum+tcp://backuppool.com:3333",

"user" : "backupuser.backupworker",

"pass" : "backupworkerpass"


]

,

“xintensity” : “4″,

“worksize” : “256″,

“lookup-gap” : “2″,

“thread-concurrency” : “8193″,

“temp-cutoff” : “90″,

“expiry” : “1″,

“failover-only” : true,

“log” : “5″,

“queue” : “0″,

“scan-time” : “1″,

“device” : “0″,

“gpu-threads” : “2″


SGMINER:

Code:


“pools” : [


"url" : "stratum+tcp://mainpoolswebsite.com:7777",

"user" : "poolusername.workername",

"pass" : "workerpassword"

,


"url" : "stratum+tcp://backuppool.com:3333",

"user" : "backupuser.backupworker",

"pass" : "backupworkerpass"


]

,

“intensity” : “13″,

“worksize” : “256″,

“lookup-gap” : “2″,

“thread-concurrency” : “8193″,

“temp-cutoff” : “90″,

“expiry” : “1″,

“failover-only” : true,

“log” : “5″,

“queue” : “0″,

“scan-time” : “1″,

“device” : “0″,

“gpu-threads” : “2″


As you can see most of the information is either from above or self explanatory. Insert your pools website information and worker name + worker password. Again you must refer to the wiki to get yourself a good starting point. Find what others used and insert the information accordingly. You will end up adjusting later to get the most out of your card but for now get a good starting point.


The first config is pre-setup for my 7870 and my 270x at 2 gpu threads using xintensity. The second config is for sgminer and is pre-setup for regular intensity on a 280x with 2 threads. Results may vary and you will likely need adjustments even if using the same cards. Although recent reports show that the 270x settings seem to be working for multiple people at around 500kh/s biggrin.gif.


Make sure you change everything you need changed including worksize, intensity, gpu-threads and thread-concurrency. (referred to on the wiki as -w -I -g and –thread-concurrency)


Make sure you setup a back-up pool SEPERATE from the one you are on. If they have there own backup pool you will want to add a 3rd pool and make sure its seperate from the originals. Always have one pool from a completely different website as you never know what could happen! Failover-only will make sure that when a pool fails it goes to the backup. but when that first pool is available again it will switch back automatically.


After you have it all setup you then save your file into the cgminer folder. Make sure you name it cgminer.conf (or sgminer.conf for sgminer). If you end up accidently saving as a text file make sure you delete “.txt” from the end so it becomes a config file (should say cgminer.conf or sgminer.conf)


CREATE YOUR BATCH FILE


Then go back and make a new text file and insert this:


CGminer:

Code:

setx GPU_MAX_ALLOC_PERCENT 100

setx GPU_USE_SYNC_OBJECTS 1

timeout /t 4

cgminer.exe –scrypt


SGminer:

Code:

setx GPU_MAX_ALLOC_PERCENT 100

setx GPU_USE_SYNC_OBJECTS 1

timeout /t 4

sgminer.exe


Very similar but if using cgminer make sure you include –scrypt. If using sgminer it WILL NOT WORK with –scrypt included.


Use the timeout to give yourself time to re-size the miner as it will be locked in once it starts mining. Also if you set the miner to auto-start with PC you can increase the timeout to give your PC time to start-up.


Save the file as anything you want but add “.bat” to the end. Same as with the conf if you accidently save as .txt just remove the txt from the end and make sure its a .bat file.


TEST RUN!


That’s it you now have set-up your miner. All you need to do is run the .bat file and you are up and mining! Heres some of the info you will want to focus on and information about each:


kh/s: This is how hard your gpu is running. Generally this is what people watch as they tweak there gpu. Using a multipool can effect testing. Generally you want to do your tweaking on a single coin dedicated pool to avoid loss of kh/s during coin switch. Otherwise you may end up with a headache.


wu/m: This is the real major factor. kh/s is nothing without work being submitted. Ive seen some high kh/s on my card that produced horrible wu/m. This is wildly random at first and goes up and down significantly. But after hours it will even out. Sometimes you will see wu referred to on a ratio vs kh/s. Most the time you want atleast .9 ratio vs kh/s. so for every 100/khs you should have at least 90wu/m. This can vary though and has a little to do with luck and again will take a long time to even out.


[P]ool management / [G]pu management / Settings / [D]isplay options [Q]uit

Somewhat self explanatory but I thought I would mention. Press Q to quit you dont want to X out and lose work. Also you can access most of the settings from your config from inside of cgminer while its running. This is the best way to adjust xintensity. Simply press G for gpu management and a new menu will pop up. press x for xintensity and adjust up and down 1 intensity at a time and you will find the “sweet spot” ever 3 or 4 intensity levels that give your card a boost. Just gotta find the right sweet spot that gives good wu/m and kh/s combination.


HW: This should ALWAYS be 0. There may be some bad luck with a pool that causes errors but that is extremely rare. This number has been 0 for me for over 2 months unless I have bad settings. HW means hardware errors. If you have ANY HW then you need to find the problem. Generally it means too low of thread concurrency OR too high of intensity (or sometimes too high of thread concurrency as well). Always adjust settings one at a time to pin-point the problem.


A:, R: These are work accepted and work rejected. you can see rejects represented by a percentage on newer miners. This can vary from pool to pool based on connectivity but you will want this to be super low. If you have a good pool connection it should be as low as 1 percent or even lower. multi-pools will have higher rejects due to coin switching as well as p2pools tend to have higher rejects too. Even under extreme circumstances 4%+ is too high you generally need to lower intensity or find other solutions.


Most of the other information is irrelevant. keep an eye on GF: as this is getwork failures. if this keeps going up too much you have a really bad connection to your pool and may want to consider switching pools. after 24 hours i have about 150 getwork failures on a somewhat bad pool connection (to give comparison).


TWEAKING TIME


Now that you kinda understand what your working with wink.gif (its all confusing at first, give it time biggrin.gif). Its time to do some tweaking to optimize performance.


Some cards do extremely well with the wiki settings and you may not be able to get much more out of them.


At first you will want to start by changing the worksize. This settings fairly easy to tweak. Here are all the work-size possibilities you should try:

48,64,96,128,192,256,288,320,384,448,480,512

Start with your wiki setting and move up and down to see what happens. If hashrate increases keep the new setting. When you are done tweaking everything else, you may want to go back to worksize to make one more attempt to assure best setting.


You will next want to start tweaking intensity. If you used regular intensity just try to push it up one and see if it works better. If not go back down. fairly simply done just by increasing the intensity in your conf file and saving it. then re-open cgminer. Or you can do this within cgminer by pressing G then I and entering the new intensity.


If you ended up using 1 gpu thread you likely are already at a higher intensity. This can generally be pushed up a bit but you wont want to go too high as later on your overclock wont get to push you as far biggrin.gif. Also you may want to consider using a very low xintensity (3,4,5,6) and attempting 2 gpu threads (with kalroths cgminer). This is newly discovered for cards that could not previously do this. Generally gives you less stales and less stress on gpu. It will not work at all it seems at any setting except 3 for myself. But once I found that sweet spot it has been the best.


Anyone using 2 threads already may want to attempt to use xintensity to adjust by smaller increments. Once you start using xintensity in your config file it can then be adjusted within cgminer. Press G to go to gpu management then press x. You now can type in your chosen xintensity. I recommend if using 1 thread getting close to the same xintensity as you would for normal intensity (remember shaders*xintensity=threadcount compare above) then going up or down one by one watching this number:


You will see every 3 or 4 intensity steps the number will go up. then for 3 more be low, etc. For example i had really good results at 1 gpu thread xintensity=111. but at 110,109,108 it was all bad, then 107 had very similar results to 111 but seemed to have a worst wu/kh ratio. but likewise the other direction aswell at 112,113,114,115 all bad and 116 seemed to do ok. This will take some serious time to figure out and pinpoint but you can squeeze more juice out of any gpu! But I still highly recommend attempting to get 2 gpu threads to work as its generally more productive.


The reason we are looking at this k number and not kh/s is it shows results from changes faster. kh/s seems to be some sort of average while k seems to be right now speed. So its easier to see in real-time the changes from one xi to the next. Make sure you let it run for at least a few seconds on each increase or decrease to be sure of the speed change.


For even more tweaking there is now a feature in the kalroth release called rawintensity. This is quite literally just the intensity threadcount. This is a much more fine tune and will take a ton of time to tweak. but if you want to spend some more time getting every little bit you can then use rawintensity to take it another step!


The last thing I usually mess with is thread-concurrency. Assuming the setting from wiki worked ok (they generally do). You should attempt multiples of your shaders aswell as multiples of 1024. Go up and down from your original wiki setting and see what works best for your gpu. Theres likely going to be a large range that performs similar. You will want to end up somewhere in the middle of too high tc (generally choppy) and too low tc (hw errors). If the wiki setting falls in the middle its probably where you should keep it.


Many people have reported that thread concurrency is best found by shaders*n+1. So Take your shaders multiply by a number usually 3-10 add 1 and test. I ended up on 8193 personally with my 270x and 7870 and it seems to run best on MANY different gpu.


Theres no one specific setting for any of these, some just perform better at different settings then others. Even the exact same 2 gpu from the same company same model may have 2 completely different optimal settings.


Just dont forget to keep an eye on HW: This will tell you if you have any hw errors. Also wu/m again is the most important of all as it represents the actual work submitted (what your pool pays you for). Also dont forget wu/m takes a LONG time to even out even 24 hours before its steady sometimes (you will get used to watching it and understand kinda how it works). Wu/m is about luck (Difficulty of each submitted work) but luck over time will always even out.


Lastly you may want to do some clean-up in your cgminer folder before starting overclocking. Everytime you changed thread-concurrency, worksize OR gpu threads it created another bin file. This bin file is used everytime you start cgminer and keeps your settings stored. Once your at your optimal settings you can just delete all of the bins. It will create a new one with the same previous settings and you wont have 20 bin files anymore. Also I am sure you noticed everytime you start cgminer with one of those settings changed it takes a much longer time to start because it creates the bin file. Once you have your settings locked in and a bin file made cgminer will start much quicker.


OVERCLOCKING


Overclocking can be very frustrating. Many cards can respond differently. You will need to tinker with both core and memory clocks at the same time in order to optimize your settings. You can even end up at different clocks for different cgminer settings.


Use a program like MSI afterburner or Sapphire trixx or something. You need on the fly controls to really optimize each gpu.


Sometimes you will see the same results from 1340 mem as you will from 1500. Sometimes not. Depends on memory, brand and card. Core clock can also be the same way. My 7870 likes a much lower clock between 975-1010 is optimal but it still runs almost the exact same kh/s at 1300-1340. So when you think your going up sometimes its better to go down! Try everything!


My current clock settings:

7870: core clock 980, mem-clock 1358 runs at 425kh/s. Can push around 435 at 1010,1360

270x: core clock 1160, mem-clock 1498 runs at 500kh/s. Can push up to 505ish with minor tweaking (reports show these settings work on multiple 270x)


This can be HEAVILY effected by the bin file created by the miner from different driver versions. I do NOT suggest using the new 14.1 drivers for pitcairn cards. For both my 7870 and 270x there was a MAJOR loss in kh/s. Have also seen alot of bad reports from others aswell. 13.11 or 13.12 are recommended.


Your overall goal is to attempt to undervolt aswell as increase kh/s by possibly underclocking. You will want to start as low as possible and hope that your core responds well to low clocks. For example if you get 420kh/s at 980 clock but you get 425 at 1250 clock then its likely better to go with the 980 as your power bill will show it. Memory clocks are likely to end up higher but do not draw as much power.


Do your best to find your optimal core and memory clocks. adjusting each by 20mhz at a time at first then when you get to the “sweet spots” adjust up and down slightly until you find the magic numbers. You will see the results in cgminer. You can adjust while running cgminer it will take a few moments to regain speed (unless you hit a bad spot tongue.gif). Once you find the highest possible generally best to back off just a tad.


Lastly after finding those optimal settings you will want to try to undervolt your gpu. This is done by lowering the vcore which on some gpu can be locked. In MSI afterburner you can try going into settings and selecting unlock voltage aswell as extend overclock limits (you may not even have these options). If it works you may get voltage unlocked. Otherwise there is other methods like flashing the bios if you really want to undervolt. The goal is to turn down the voltage as far as you can to save power. if you lose some serious wu/m after undervolting you may have to go back up a bit. I did myself it seemed to work fine but then i realized it was not submitting nearly as much work. So keep an eye on it before and after undervolting to assure its working properly.


Once all is said and done you can use a program like VBE7 to edit, save and flash your bios to permanently have these clocked miner settings. Its better to do this if you plan on using for mining only as using msi ab or another program everytime can be a pain and can cause conflicts with some other programs like cgmonitor. Even though afterburner runs everytime your start your pc its better to always be clocked properly. Flashing bios is the optimal way to do this but in most cases IT DOES VIOLATE THE WARRANTY! FLASH AT YOUR OWN RISK!



source: http://www.overclock.net/t/1461916/tutorial-ultimate-guide-to-tweaking-amd-cgminer-3-7-2-kalroth-edition-sgminer-instructions-included-aswell-get-the-most-hash-out-of-your-gpu



Ultimate guide to CGMiner

No comments:

Post a Comment