Saturday, February 15, 2014

Getting the Most Hash Power Mining with the Radeon R9 290X - Optimal Settings, Drivers, and Tips

The information in this guide is current as of February 15, 2013.  I will continue to update this post if I find any software versions that work better with the R9 290X.


What's new in this guide compared to the last guide from December 2013?
-Catalyst Control Center now allows power tune 50, up from previous 20
-Removed MSI Afterburner
-Optimized fan settings in CGMiner with the absence of MSI Afterburner
-Changed GPU RAM setting to 1450, down from 1500 for stability
-Added a step to check your GPU bios, to be sure it's in UBER MODE

This guide will focus on how to fine tune the settings on your Radeon R9 290X to achieve 900-930 Kh/s.This guide contains everything I've learned while testing get the most of my R9 290X. I'm seeing power consumption of about 300w per card.  I have 5 GPUs in my rig, but these settings worked for a single GPU and also all 5.  For proper cooling you will need an open air rig or at least remove the side of your computer case.  Here are the system specs I used during my testing:

1x XFX R9 290X
1x HIS R9 290X
3x Sapphire R9 290X
5 Powered Risers (I cut the risers for 2 of my 3 power supplies, see bottom for more info)
8GB System Ram
Windows 8.1 on SSD
AMD Sempron 145 Single Core Processor (I would recommend a dual core for $5 more)
ASUS M5A99X EVO R2.0 Motherboard
3 Seasonic Power Supplies - 1000w, 750w, 450w (because the 1250w was sold out everywhere or else I would only have 1000w and 1250w)  You want to have 360w per card available from your power supply.  Not that you will need all of it, but you want some headroom.



Programs You Will Need

CGMiner 3.7.2 - http://ck.kolivas.org/apps/cgminer/3.7/  (be sure to get 3.7.2)
CGWatcher 1.3.5.3 - http://manotechnology.blogspot.com/p/cgwatcher.html (bottom of page)
AMD Catalyst Control Center 13.12 - http://support.amd.com/en-us/download

-In order to achieve best results with this guide, you'll need to download the exact versions listed above.


I have removed MSI Afterburner from my mining rig.  It does not play nice lately, and I get better results using AMD Catalyst Control Center + CGMiner Settings.  If you have followed a previous version of this guide, in MSI Afterburner, go to Settings and disable "start with windows" or uninstall it.

Use the correct 290X bios switch setting, Uber mode

Looking at the back of your 290X where the monitor connects, look around the side of the card for a tiny switch.  By default, this switch is closest to the monitor plug.  If it is, move the switch furthest away from the monitor plug.  This puts your 290X into uber mode allowing higher fans speeds and better performance.

Installing Your Drivers/Catalyst Control Center

I won't go into detail here.  This should be done as soon as you installed your R9 290X graphics card.  If you do not have Catalyst 13.12, use the link above to download that version.

Configure Catalyst Control Center

Once you have installed CCC and restarted your computer, press 'ctrl+alt+del' and enter Task Manager.  Click "More Details" if you only see a little box popup.  We need to see tabs at the top of the window such as Processes, Performance, App history, etc.  Go to the tab "Startup".  Find "Catalyst Control Center", right click on it, and Disable it from automatically starting up.  This is for diagnostic purposes.  If your computer crashes while overclocking, CCC will auto start when you reboot and try to apply the same settings which will crash your computer again and again.  This way, we can choose when to start CCC.  Once you're happy with your overclock settings and system stability, you can come back here and Enable CCC to start with Windows.

Next, open Catalyst Control Center, or if it's already open, right click the task bar icon for CCC and select "Catalyst Control Center".

Next, in CCC, on the left hand side of the window click "Performance" and "AMD Crossfire X".  Disable crossfire if it is not already disabled.  If you reinstall your driver or CCC at any point and you have more than 1 GPU, you will probably have to disable this again afterwards.
Sorry about the crappy picture quality on some of these.  I didn't want to stop my miner to take the screenshots so these are cell phone photos.  I'll try to update later if I have time.

Next, under "Performance", click "Overclock Settings".  We're only going to change 3 settings here.  Check the box "Enable Graphics OverDrive" just above the heat map.  Set power limit to +50, and max fan speed to 100.  This effectively raises the heat and power maximum values before CCC auto-downclocks your GPU which can lead to inconsistent results when trying new mining settings.  Your card won't consume +50% power unless it needs to.  We're simply raising the maximum values on this screen and the actual overlock settings will be applied in CGMiner later on.  Click the 'x' to close the CCC window.  It will remain running in your taskbar.



Setting up CGMiner

This step is straight forward.  Download CGMiner 3.7.2 from the link at the top of this post and unzip to any location on your hard drive. Remember where you put this folder.  You will need to tell CGWatcher where to find it.  If you add any new GPUs to your rig after you have first started CGMiner, you need to delete the CGMiner folder and replace it with a fresh copy.  This allows CGMiner to re-scan your hardware.  If you add new GPUs and skip this step you may get poor results, as bad as 1/2 normal hash rates.

Setting up CGWatcher

Here we'll tweak the final settings and begin mining.  Download CGWatcher from the link at the top of this post.  The download link is near the bottom of CGWatcher's page. Extract CGWatcher to any location on your hard drive similar to how you extracted CGMiner.  Create a shortcut on your desktop to CGWatcher.exe. Now go ahead and start CGWatcher.  If you get any API connection errors you will need to run CGWatcher as administrator(Right click the CGWatcher icon->select "properties"->go to compatibility tab->check "Run this program as an administrator"->select "OK")

CGWatcher Settings

Click on the "Settings" tab in CGWatcher.  Click on "Manage Profiles".


Once in the Profile Manager, click "New".  Make a name for your profile.  For example, "Solo", or "LTC Pool 1".  For the "Miner Path" field, click the 3 dots "..." and select the file cgminer.exe where you extracted your CGMiner files.  

Next, copy and paste the following text into "Miner Arguments".  Replace all characters in red with your solo or mining pool information.  If you prefer to use a .conf file, use the values below while creating it.

--scrypt -o <SOLO ADDRESS OR POOL ADDRESS> -O <YOUR USERNAME>:<YOUR PASSWORD> --gpu-platform 0 --worksize 256 --vectors 1 --intensity 20 --gpu-threads 1 --log 3 --thread-concurrency 33792 --lookup-gap 2 --api-port 4028 --expiry 120 --queue 1 --scan-time 60 --auto-fan --temp-target 79 --gpu-powertune 50 --gpu-memclock 1450 --gpu-engine 1000




A note about GPU RAM and System RAM settings:  

I achieved higher hash rates using memclock 1500 but my system was not stable.  It would crash about once per day and I would rather not have any downtime so I use 1450.  I also noticed my hashrate reduced on different system ram clock settings.  I found my system ram to work best clocked at or above 1600 mhz.  You will need to lookup how to adjust your bios settings for your particular motherboard if you want to check your system ram settings.)

A Note About Expiry, Queue, and Scan Time Settings

The default settings for expiry, queue, and scan time provided above are fine for pool mining or solo mining up to about 1.5 difficulty level.

If you're solo mining, depending on the difficulty level, you may want to adjust Expiry, Queue, and Scan Time settings.  For example, if I'm solo mining at difficulty 0.25 for a coin that generates a target 1 block per 20 seconds, I would set my scan time to 1, queue to 0, and expiry to 23.  This means CGMiner will scan data every 1 second, I would have no new work queued up so my system would have to grab fresh data as soon as it's needed, and all work would expire after 23 seconds (since there should be a new block every 20 seconds in theory).  The end result of this tweaking would reduce the number of rejected blocks found while solo mining.  In my experience, it reduced my solo rejects from ~20% down to ~14% on low difficulty coins.

Final Steps

Once you have entered all the miner arguments, click "Save", then "Close".

Back on the Settings tab once you've saved your new profile, select your new profile from the drop-down box and click "Save Settings".  Your profile is not active until you have selected it and clicked on "Save Settings".

Now, open a command prompt.  For up to Windows 7, Start-> Run->Cmd.  For Windows 8, right click in the lower left of your screen (where the start button used to be), click run, and type "cmd" and ok.  Next, type the following commands, one at a time, and press enter after each.  You should see a success message after each one:

setx GPU_USE_SYNC_OBJECTS 1
setx GPU_MAX_ALLOC_PERCENT 100

Your settings are now complete.  Open up your wallet in server mode if you're solo mining and click the "Start Mining" button or if you're pool mining just click the "Start Mining" button.

Tips and Troublshooting

If you have strangely low hash rates or crashing problems, try some of these tips.

- Troubleshooting - in CGMiner while mining, type "g" to get information about the GPUs.  Check that the memclock and engine settings show the same values you set.  Sometimes engine will vary by a couple Mhz under load, not a big deal.  If any settings are off by a lot, you may have power problems or CCC setting problems.  Double check your CCC settings and make sure your power supply is has enough capacity to supply each 290X with 360w plus a couple hundred watts for your mobo, hdd, ram, etc.

- Extremely low hash rates - try deleting your CGMiner folder and replace it with a fresh copy.  Not a backup, a newly unzipped copy from the download link above.  CGWatcher holds all of your settings so they will be in tact.  Also, check your motherboard bios for your system RAM clock settings.  If able, try to choose 1600 mhz or something close.  I'm not sure how this affects mining, but it did affect my system under 1600 mhz.  Make sure your bios is in UBER MODE as described in the guide above.

-CGWatcher crashes upon opening - try deleting your 'profiles.dat' and 'profiles.dat.backup'.  Most likely the file is corrupt from a previous crash.  You will have to enter your mining data again upon restart including CGMiner location and miner arguments.

-After a system crash, Catalyst Control Center will crash upon opening - try opening CCC 2x and restart as needed to clear the crash.  After 2 attempts and restarts CCC should reset itself to default settings.  You will have to then reapply CCC settings as described in the guide above.  This is why I recommend disabling CCC from starting automatically with windows until your find your stable clock settings.  Then you can go ahead and set CCC to start automatically.

Cutting Powered Risers

Is it necessary to cut powered risers?  If you're using multiple power supplies, yes.  This is still up for debate on some forums, but the final word on the matter is:  You may be ok not cutting, but you might fry your board or power connections.  If you cut, you will eliminate this chance!  It's worth it, do it.  Follow this guide through step 4.  I used electrical tape to hold back and cover the cut wires.  Also, I used a crappy video card to test all of my powered risers before connecting to my 290x's.  You don't want to ruin a 290X due to a faulty or incorrectly cut powered riser.  RMAs take a lot of precious time away from your mining rig.  Always take a few extra minutes to be cautious when dealing with mining equipment.

Example:  In my case, I have 3 power supplies

PSU 1 is connected to the motherboard, ssd, and 2 GPUs.  I did NOT CUT these risers.  The power coming to the card through the motherboard is the same power flowing through the powered riser.  Just plug in the riser and GPU, connect the molex powered riser and PCIe power connectors from PSU 1.  Cutting these risers would not hurt, so feel free to cut if you would like.

PSU 2 is connected to 2 GPUS, their respective powered risers, and nothing else.  These risers ARE CUT.  Since these are cut, PSU2 does not cross with the power available from PSU1 at the PCIe slot on the motherboard.  They are safely disconnected from each other.

PSU 3  is connected to a single GPU, it's powered riser, and nothing else. These risers ARE CUT.  Since these are cut, PSU3 does not cross with the power available from PSU1 at the PCIe slot on the motherboard.  They are safely disconnected from each other.


Here is a picture of my full rig:

PSUs on very top shelf, hard to see here.


Bitcoin:  12YzcMGTULhAKLsWp85zURyEFNv1vk7S6H
Dogecoin:  DKaBTuog675uK7w8Wqme53NNEWMrHZV9ES


Saturday, February 1, 2014

Upgrading My Scrypt Mining Rig - Part 1: Shopping Time!

My current setup is just a single R9 290x in my desktop computer with an open case.  Now it is finally time to upgrade to a real mining rig.  This past friday I placed orders at New Egg, Tiger Direct, Amazon and Home Depot.  I will have a total of 3 R9 290X GPUs, but I'm leaving space to grow into a total of 5 GPUs by adding larger PSUs and having riser cables on hand.  Here's what the shopping list looks like:

New Egg, Tiger Direct, and Amazon


Motherboard:  ASUS M5A99X EVO R2.0 AM3+ AMD - $135
*5 PCI-e slots (the current windows 8.1 maximum)

Power Button:  Replacement Power Reset LED Wire Kit for ATX Case Front Bezel - $5
*Because you need to turn it on...

Mobo Speaker:  APEVIA CVTCSPK 2" Case Speaker - $5
*To hear any error beeps such as bios.

Processor:  AMD Sempron 145 Processor - $35
*Single core, only 45 watts, fits in an AM3+ slot, perfect for a mining rig.

*Most recommend 4GB but I want to overbuild a little.  Better safe than sorry, and I can re-use these later.

*Highly rated, fast, and it was on sale.  I would like decent usable parts once I dismantle this rig to upgrade further or sell off the parts.

*Two different brands because I could only find one in stock at the time.  This should present a challenge as I now own an XFX, Sapphire, and HIS 290x.  Hopefully setup goes smoother than I expect.

Powered Riser Cables:  3x Powered 16x PCI-e Riser Cable - $25 ea  2x Powered 1x PCI-e Riser Cable - $25
*Because the 290x consumes so much power, I'm playing it safe and hooking up powered risers to reduce the load on my motherboard.  I don't want to melt any connections.  I just noticed the prices have skyrocketed over the past couple days since I bought mine.  They are now up to $40 each.

*Gold and Platinum certified for a lower electricity bill.  A grand total of 2250 Watts.  I'm allotting 200 watts for the mobo and components, and 360 watts peak usage for each 290X (with enough power for 5 once fully expanded).  Thinking ahead and overbuilding again.  1000W will power mobo and 2 GPUs, 1250W will power another 3 GPUs.

Dual PSU Adapter Cable:  APEVIA CVT24Y 12" 1 x 24PIN TO 2 x 24PIN Cable - $5
*One PSU directly powers the mobo and GPUs while the second PSU starts when the mobo starts but powers just GPUs.

PSU Cable Extensions:  2x Athena Power CABLE-M204M204F 10 " Extension - $7 ea
*Making sure I have enough length to place the PSUs away from the mobo for ventilation.

*You can get a single outlet 15A Kill a Watt for around $25.  I went with this model for more versatility and it can handle 1980 watts (nearly what I'll be pulling at 125V with 5 290Xs).  This also acts as a surge protector.

*I want to be able to use MSI Afterburner which is not available in Linux.  Windows 8.1 supports up to 5 GPUs.

*Highly rated and cheap.  50ft to reach my router through the basement floor.

*Cheap.

*Cheap.

Home Depot

These electrical components fit my circuit breaker box and may not fit yours.  I would advise you to consult a licensed electrician for any type of breaker box work.

20A Circuit Breaker:  Eaton 20 Amp Single Pole CH Type Breaker - $8
*This single mining unit, filled with 5 290x's will pull just under 20A.  Closer to 15 - 18.  Even a rig of 5 290x's should have it's own dedicated breaker.  I would love to get a generator at some point in case of power outages during snow storms.

NM Wire from Breaker to Outlet:  Cerrowire 15 ft. 10/3 NM-B Indoor Residential Electrical Wire - $27
*Luckily my rig will be just a few feet from the breaker box because this thick wire is expensive!  Again, I'm overbuilding here.  I would rather be safe and use a larger gauge wire than required for 20A continuous usage.  

*I also picked up and outlet box but I won't bore you with that.  I'm already going into more detail than necessary.

Smoke Detector:  Kidde Battery Operated Smoke Alarm - $5
*To be place directly above the rig.  This will be in my basement so I want to be safe about it.  A lot of heat and power being played with here.

*This is my computer case.  The PSUs on the top shelf, the mobo on the 2nd from the top, and monitor/keyboard/mouse on the middle shelf.  Two box fans mounted near the top for cooling.  You can use wire to hang your GPUs from the shelf above them due to the ventilation holes.

Box Fans:  2x Lasko 20 in. 3-Speed Box Fan - $17 ea


Grand Total:  $2,789 excluding tax and shipping.


I hope to share with you more about how I assemble and configure this rig once all the parts have reached my door.