One of my optimized rigs, using the hardware from part 1 of this guide, getting over 1.9 Mh/sec in cgminer while using about 680 watts of power.
This fourth installment of our litecoin mining guide will focus on getting the most out of your hardware—finding the sweet spot between maximum performance and acceptable power usage (and noise/heat generation!).
The tweaks that I outline in this article are applicable whether you’re using Linux or Windows. If you’re using the hardware that was recommended in the first part of this guide (or very similar hardware), you should expect to see a performance increase of 10% or more in your litecoin mining hashrate, compared to the baseline cgminer settings that were given in our Linux and Windows setup guides.
In addition to increasing your mining speed, I’ll also show you how to set up a backup mining pool to automatically failover to in case your primary pool becomes unavailable. There is nothing worse than having your mining rig(s) sit idle because your pool went down!
Click “read more” for our mining performance optimization guide!
Build a Litecoin Mining Rig, part 4: Optimization
I want to preface this guide with a strong recommendation that anyone following it have access to a Kill-A-Watt (or similar device). Many of the tweaks outlined in this article will change the amount of power that your mining computer uses, and without the ability to measure power consumption, you have no way of making an informed decision about whether or not each change actually helps your bottom line. Electricity isn’t free (for most of us, anyway), and a small increase in hashing performance that costs an extra 150 watts may actually ending up costing you in the long run. Amazon sells kill-a-watts for ~$17, which is cheaper than I’ve seen them anywhere else, and the device will likely pay for itself many times over.
With that said, if you don’t have a kill-a-watt, but you do have the same hardware that I recommend in the first part of this mining guide, then you can be relatively confident that all of the tweaks below will result in positive monetary gains for you (at current litecoin prices and mining difficulty, anyway).
Overclock your GPU(s)
Overclocking your video cards will likely result in the largest overall mining gains, and it can be done right from within cgminer in most cases. Some cards are more overclockable than others (the MSI 7950 that I recommend is one of the best), but most should yield at least some gain by tweaking clock speeds upward.
Disclaimer: overclocking beyond factory default settings may cause system instability, harm your hardware, and/or invalidate your warranty. The author assumes no responsibility if you fry your computer.
The best way to find your ideal clock speeds is to start cgminer, and press “G” while it is running to open the (G)PU menu. From there, press “C” to (C)hange settings (and then press “0” to select your first GPU if you have more than one).
cgminer GPU settings: use the (E)ngine and (M)emory options to change your video card’s core and memory clock speeds, respectively.
You should be looking at a screen similar to the one shown above. From here, use the “E” and “M” keys to slowly push your GPU core and memory clock speeds upwards. I recommend increments of about 25Mhz at a time, with a 1-2 minute pause after each change to observe the effect on hashrate performance and stability. Don’t forget to check your kill-a-watt for changes in power consumption, too. For best results, keep your memory clocked about a third higher than your core speed.
You’ll know you’ve gone too high when one of the following occurs:
- Your GPU (or computer) simply crashes or hangs. You may require a system reboot at this point (a cold boot is best).
- You start to see hardware errors (watch the “HW” column next to the GPU that you’re overclocking—if it’s higher than zero, you’re probably too high).
- Your last clock speed increment brought only very small (or no) hashrate gains compared to the previous increases.
When any of these things happens, drop the clock speeds back down a bit and try to find the sweet spot where your system is stable and hashrates are highest. When you’ve found settings that you’re happy with, add them to your cgminer startup script (mine_litecoins.sh in Linux, or mine_litecoins.bat in Windows) with these switches:
--gpu-engine [YOUR CORE CLOCK SPEED] --gpu-memclock [YOUR MEMORY CLOCK SPEED]
If you’re using the recommended hardware, then 1050 core / 1250 memory should give you excellent results while still allowing you to undervolt significantly. If you’re using Windows and MSI Afterburner, you should set your Afterburner clock and memory speeds to match your new cgminer settings.
Tweak cgminer settings for performance and noise management
Another easy way to increase hashrates is to modify your cgminer settings. The easiest and most obvious setting to change is the intensity, which controls how aggressively your GPUs are scanned by cgminer. If you’re using 7950 GPUs, go ahead and increase this to the maximum of 20 (on other GPUs, 20 may result in lower hashrates, or errors). You can do that by simply changing the
-- I 19 in your cgminer startup script to
-- I 20. Again, monitor cgminer’s output for awhile with the new setting in place to make sure that your hashrate moved in the right direction, and everything is stable.
If you don’t have the luxury of being able to tuck your mining rig someplace where it is out of earshot, you may have noticed that the fans are quite loud at default settings. To help control the noise, add these settings to your startup script:
--temp-target 80 --auto-fan
This tells cgminer to automatically control all of your GPU fans, and that 80C is the target temperature. The fans should work at about half speed or less whenever your GPUs are below your target, which should make them quite a bit less noisy. Using these settings, the recommended hardware, and the plastic crate build I described in part 1 of this guide, my GPUs hover around 78C at fans speeds of 30-40% (the ambient room temperature is kept at 72F). The rig is certainly audible, but it’s a far cry from the jet engine that it sounds like if the GPU driver is allowed to manage the fans.
Set up a failover / backup mining pool
Nothing will kill your mining performance faster than an unavailable pool. It doesn’t matter what your potential hashrate is if your miner isn’t constantly being fed work to do!
I highly recommend signing up at a second mining pool so that you can use it as an automatic failover whenever your primary pool isn’t reachable. I’m currently using give-me-ltc as my primary pool, and Coinotron as my backup, and that combination has resulted in no gaps in my mining time in over two weeks. Whatever you do, just stay away from notroll.in and do your research on the pool(s) that you choose!
To tell cgminer about your backup pool, simply add this to your startup script, at the end (substitute the pool URL/port and your credentials!):
--failover-only -o stratum+tcp://backup-pool.com:3333 -u user -p password
Now you’re covered if your primary pool goes down for whatever reason. Whenever it does come back up, cgminer will switch back to it automatically.
You can actually add as many backup pools as you want by simply listing more pools after the “–failover-only” switch; cgminer will use them in the order that they’re listed.
My cgminer startup settings
If you’re using the same hardware as me, and just want to copy & paste my cgminer settings (remember to substitute your pools & login credentials, though!), here they are:
cgminer --scrypt -I 20 -g 1 -w 256 --thread-concurrency 24000 --gpu-engine 1050 --gpu-memclock 1250 --gpu-vddc 1.087 --temp-target 80 --auto-fan -o stratum+tcp://stratum.give-me-ltc.com:3333 -u [YOUR USERNAME] -p [YOUR PASSWORD] --failover-only -o stratum+tcp://coinotron.com:3334 -u [YOUR USERNAME] -p [YOUR PASSWORD]
The “–gpu-vddc 1.087” switch tells cgminer to attempt to undervolt all GPUs to 1087 mV, but whether or not it actually works depends on your card’s BIOS and driver. In Windows, using MSI Afterburner gives you a much better chance of successfully controlling GPU voltage, but unfortunately in Linux you’re probably out of luck if cgminer can’t do it (update 10/2013: undervolting is now possible in linux as well).
With these settings and the hardware I recommended, you should get at least 1940 kH/sec in cgminer. Power consumption should be around 720 watts in Windows (after undervolting), and slightly over 800 watts in Linux. Individual results will vary a little bit, but those are realistic expectations.
Some cards (including the MSI that I recommend) can definitely be pushed more than these clock settings, especially at stock voltage settings (you may also want to check my FAQ for settings for some other popular mining cards). Whether or not the extra heat/noise/power consumption makes the corresponding hashrate increase worthwhile is up to you to determine. Which brings us to:
Analyzing the cost/benefit of different setups
Perhaps you’ve found that you can push your particular 7950 to 1150Mhz core / 1575Mhz memory clock speeds, provided you leave the voltage at stock settings. This nets you an additional 30 kH/sec of hashing speed at a cost of ~50 additional watts. How can you decide whether or not that is a good trade-off?
There are a few handy online calculators that are built to answer exactly these kinds of questions. Here is the best one that I’ve come across. Simply plug in your information, and the calculator will tell you how much daily (or weekly, or monthly, etc) profit you can expect. Change the values to other configurations that you’re considering and watch the profit number go up or down.
In the next and final installment of the litecoin mining guide, I’ll post a mining FAQ and some other tidbits that didn’t fit anywhere else. Until then, thanks for reading, and feel free to leave questions or comments!