As an Amazon Associate I earn money from qualifying purchases.
Showing posts with label tuning. Show all posts
Showing posts with label tuning. Show all posts

Tuesday, July 1, 2014

Mining CryptoNote Coins with NVIDIA - Settings and Performance

[Update: You can also just use Nicehash, with there auto-switching NiceHashMiner. That's what I'm doing these days, and it pays out in BTC.]

I'm going to assume most people are already aware of the AMD GPU miner for CryptoNote coins, so I'm not going to discuss that for now -- though it's probably worth its own post in the near future. Instead, I want to look at mining CryptoNote coins with NVIDIA hardware, since we now have an open source (thanks TSIV!) version of ccMiner for just that purpose. First things first, grab the Windows binaries (or if you're doing Linux, use the source code and compile it). But now that you have the executable, how do you get it running?

The good news is that all of the CryptoNote coins that I've looked at where you can use a pool just rely on your wallet's address. As Monero is currently the most profitable of the coins (AFAICT), I'm going to use that as my example, but other CryptoNote coins should be similar in practice. Before you can get mining, you'll need the wallet, and you'll want to download and sync with the blockchain. For Monero, that means grabbing the latest files and then running them. Assuming this is your first time running, do the following:

  1. Download the wallet and daemon files and extract them to an appropriate folder (e.g. C:\Mining\Monero).
  2. You'll save yourself a lot of time by downloading the partial blockchain that's available on the main thread -- get the appropriate chain for Windows, OS X, or Linux (64-bit only), or else you'll just need to run the daemon and wait for it to finish syncing (which can take hours the first time). For Windows, put the blockchain.bin file in %AppData%/bitmonero; on Linux/OS X put the blockchain.bin in ~/.bitmonero.
  3. Now start up the bitmonerod.exe daemon and wallet; I use the batch file below to accomplish this. If you want this to auto-start when you boot up the PC, create a shortcut to the batch file and put it in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
@echo off
tasklist /FI "IMAGENAME eq bitmonerod.exe" 2>NUL | find /I /N "bitmonerod.exe">NUL
if not %ERRORLEVEL% == 0 (
  echo Starting node...
  start /MIN /LOW bitmonerod.exe
) else (
  echo Node already started.
)

tasklist /FI "IMAGENAME eq simplewallet.exe" 2>NUL | find /I /N "simplewallet.exe">NUL
if not %ERRORLEVEL% == 0 (
  if exist wallet.bin.keys (
    echo Starting previous wallet...
    start simplewallet.exe --wallet wallet.bin
  ) else (
    echo Starting new wallet...
    start simplewallet.exe --generate-new-wallet wallet.bin
  )
) else (
  echo Wallet already started.
)
At this point, you should have a wallet, which really is just an EXE that talks to the daemon and can send certain commands. The daemon is in charge of downloading the blockchain and staying in sync with the network, while the wallet holds your coins and had a key (which is password protected, so you need to input the password each time you start the wallet).

To get mining, you need to know your Monero address, so go to the wallet window and type in "address" (without the quotes). Other commands you can use are available by typing "help", and thankfully there are only a few commands you need to know. Now take that address and go to one of the Monero pools -- I'd suggest monero.crypto-pool.fr as the best candidate, though you're free to use others. With that address in hand, and a pool (or two or three) selected, it's time to start mining.

For mining, you now have three options: CPU, AMD GPU, or NVIDIA GPU. The basic settings are similar for each -- you use the miner with the pool address and your wallet address. For CPUs, use the number of CPU cores you have (real cores without Hyper-Threading is usually best on Intel, while for AMD you can use all available cores). For AMD, there's no real configuration to speak of right now -- fire and forget, with the knowledge that you're donating 5% of coins to the developer (Claymore), at least until an open source version becomes available. For NVIDIA, you can just run with the defaults as well, but my whole reason for this post is to tell you not to do that! The default syntax is as follows:
ccminer.exe -l 8x64 -o stratum+tcp://mine.moneropool.org:80 -u 48JM22E3ZfPSoFCukcizpSR2hCsBnAExT4ACvrpYx5czFgEyR12LWwK9JpgYRZKjsRHp8ynDcQegbhCspvjHd7gaL8qbzYy -p x
Okay, the addresses are really long, but the real item you want to pay attention to is the "-l [threads]x[blocks]" setting. Here's what I know: the default setting is 8x40, and on most NVIDIA GPUs that I've tried it absolutely sucks. That may be a bit harsh, but basically it's not doing any sort of tuning so you're going to get anywhere from decent to mediocre to terrible performance, but very likely not optimal performance. On one GPU (GTX 860M), the defaults gave me 50 H/s, but with fine tuning I got up to nearly four times that hash rate. So how do you tune the settings?

I suggest starting by trying to find a good thread setting; anything between 6 and 12 is potentially good, so start with 6x64 and then try 7x64, 8x64, etc. up to 12x64. Find whichever setting gives the best starting performance. Then start trying different values for the blocks setting. I started at 32 and then tried 48, 64, 80, 96, 112, and 128 -- so basically increments of 16. You'll likely find that many of these result in similar performance, but somewhere in that range you should see better results. Choose the two highest results and then try a thread settings half-way between those, and continue narrowing things down until you find what appears to be an optimal setting. It doesn't need to be an even number either, so just give it a whirl. Note that the first score you get will probably be a bit lower than your average hash rate, but it's consistent so if you get 150 H/s and then things level off at 180 H/s, a starting score of 180 H/s will likely reach an average speed of 210 H/s (give or take).

So far everything is simple enough, but there are a few final items to note. First, on most systems running the ccMiner for CryptoNote makes the system useless for doing much else -- it becomes extremely laggy. The exception is if you have a laptop with NVIDIA Optimus, as the Intel iGPU can still happily run the Windows code and stay responsive while your GPU gets pounded. But laptop GPUs are slower, so I don't really recommend that route -- I suppose a desktop with the display connected to the Intel port would also work similarly.

The second item to note is that on most systems I've tried, the NVIDIA drivers will "time out" and give you a crash message. This is Windows basically detecting that the drivers haven't responded properly for a while, and so it stops them and of course your mining quits as well. You can usually get around this via a registry edit, but in some cases even that may not work all the time so be prepared to fiddle around a bit. The registry hack is easy enough:

  1. Run "regedit.exe" from the Start Menu.
  2. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers"
  3. Right-click on the right panel and create a new 32-bit DWORD value.
  4. Name the key "TdrDelay" and assign it a value of anywhere from 10 to 30 (decimal -- 0A to 1E hex).
  5. Reboot and you should be set.
I've found that not all systems give the same hash rates, even with the same clocks, and there's certainly more investigating to be done. Here's what I'm running so far along with the approximate hashing rate, if you're interested. This is listed in order of increasing performance.
  1. GT 750M: -l 8x64 = ~56 H/s
  2. GTX 860M: -l 8x32 = ~200 H/s
  3. GTX 870M: -l 8x63 = ~205 H/s
  4. GTX 780M: -l 7x71 = ~210 H/s
  5. GTX 780M #2: -l 8x72 = ~225 H/s
  6. GTX 880M: -l 8x64 = ~245 H/s
  7. GTX 770: -l 8x72 = ~280 H/s (probably can do better with more tuning)
  8. GTX 780: -l 8x96 = ~380 H/s
As you can see, there's no clear rhyme or reason to what settings will work best, so you'll need to use some trial and error to figure it out. There are also some real oddities, for example the GTX 780 is rocking along at 380 H/s but I can't get anywhere close to that with the GTX 770 -- in theory, the 780 is only about 25% faster, but here I'm seeing a 35% increase. Maxwell also does reasonably well on the laptop side of things, bringing in 200 H/s despite being in theory quite a bit slower than GTX 870M and 780M.

What's interesting is that for desktop GPUs, most people are talking about getting around 260-280 H/s with the GTX 750 Ti, a Maxwell GPU with 640 cores running at 1020 MHz. The GTX 760M by comparison is the same 640 cores at a similar clock speed, but I can't get the same level of performance. The faster desktop VRAM (5.4GHz vs. 5GHz) might help some, but unless people are doing some decent overclocking to hit 260+ H/s I don't know why there's such a gap.

Obviously, TSIV and others are going to continue to improve performance over time, so I don't expect things to end at the above results, and I also suspect we'll see some auto-tuning implemented at some point. In the meantime, just know that for many of the GPUs I've played around with, specifying a launch configuration isn't just helpful, it's absolutely necessary.

Donations are welcome:
XMR: 48JM22E3ZfPSoFCukcizpSR2hCsBnAExT4ACvrpYx5czFgEyR12LWwK9JpgYRZKjsRHp8ynDcQegbhCspvjHd7gaL8qbzYy
BTC: 153qS9Ze32hnV3fwirZLWNka4wBAowc21E


If you like reading these blog posts but don't want to subscribe to my thrice-weekly newsletter, please consider making purchases through my Amazon Affiliate links!

Tuesday, February 4, 2014

Vertcoin Settings, Optimal Thread Concurrency, and HW Errors

Not surprisingly, given the current prices [which I predicted about ten days ago!] people are starting to pull their hair out when trying to tune their configuration files to work with Vertcoin (VTC). In fact, I have been one of those people, so naturally I decided it would be best to adapt my previous work to get things running with the new version of cgminer.exe. This round, I have two different versions of the batch file to run, one for Radeon R9 290 and R9 290X, and one for earlier GPUs.

You can download my test scripts from Dropbox.

The key items to change before running are all in the two following files. Note that I'm using the custom version of cgminer found here, as opposed to the slightly different version of cgminer named vertminer found here. I don't know if there's really much of a difference, but I started tuning on the first version (linked from Vertcoin.com) before hearing about Vertminer (linked from Vertcoin.org -- go figure). It sounds like some people are getting fewer HW errors with Vertminer, but at least initially I lost about 50 KHash on my 3x7950 rig so I'm staying with the first miner for now. Anyway, the main files to look at are:
thread-concurrency-test.bat
thread-concurrency-test-r9version.bat
As you can hopefully guess, the r9version is for R9 290/290X (it's not necessary on R9 270/280X as those are basically just rebranded 7000-series hardware); technically this version should work for any GPU, but I've found it can be a bit... flaky. Basically every few restarts of cgminer.exe, one or more GPUs will stop working properly and you'll need to reboot the PC. So hopefully we can get a fixed EXE for R9 systems sooner rather than later (and if you have such an EXE, please email me).

Here's the short list of settings to change, and below I'll have some recommendations based on running these scripts on my own hardware. All of the settings below are for both versions, except "roundtime" which comes from the non-R9 version, and "shares" which comes from the non-R9 batch file:
Starting thread concurrency. Note that if file "CURRENTTC.TXT" exists, that will override this value!
set threadconcurrency=6000

GPU engine and core clock(s). If you want to set different clocks, use commas with quotation marks around the set (e.g. gpuclock="1000,975,950" for three GPUs)
set gpuclock=900
set memclock=1450


GPU fan speed range (can use multiple sets with quotes as above if needed)
set gpufan=50-95

GPU voltage tends to only work on older GPUs (5000 and 6000 series, and some 7000)
set gpuvolt=1.071

PowerTune setting can specify for multiple GPUs with quotes; only supported on 6000 and newer GPUs.
set gpupowertune=10

Intensity setting for mining
set intensity=18

Number of GPU threads
set gputhreads=1

Number of shares to mine on each TC setting before moving on. If you have a high share difficulty, lower values may be useful.
set shares=60

How much to increment thread concurrency each round -- for Vertcoin mining, I've found steps of as small as 1 to be potentially useful!
set threadincrement=4

Number of seconds to mine on each round.
set roundtime=300

Number of GPUs being used -- the output includes performance from each GPU on a separate line, hence the need for this setting.
set numgpus=3
The instructions for using the batch files are pretty simple: extract the above files into your cgminer-vertcoin folder, then edit the appropriate batch file and change the above settings as appropriate. In general, that means you should tweaks the GPU clocks, the starting thread concurrency, and potentially the intensity and gputhreads settings. The number of shares and/or roundtime can be adjusted; I'd generally recommend increasing these values rather than going any lower, as the more time you spend hashing at each TC the better the overall estimate will be.

There are just a few disclaimers before I wrap up. First, I take no responsibility if any of these files mess up your PC or kill your GPU. They should be safe, but you never know. Second, the R9 version seems to be a bit less stable, and it seems to cause the GPU drivers to crash, especially in multi-GPU systems. You might have better luck than I did, of course. Finally, every system is different, so what works really well on one PC may not work well at all on another -- and I've found in general that it's very difficult to find a setting where you get optimal hash rates without getting any HW errors; mostly, I just try to keep HW errors below 1%.

Donations as always are (very!) welcome. I'd appreciate just an hour or so of your mining time if you don't mine, or you can donate to any of the following addresses:

VTC:  VaNuRCj73JVAwR1YMnt8CXaqoiPgykiMTk
BTC:  153qS9Ze32hnV3fwirZLWNka4wBAowc21E
LTC:  LfCLyykrNFftzpdWejR73hf478ZtBzQ9jE
DOGE: DD9iTWf8diPkvKdB8roPJepTyp6BGVQtct

Here are settings that I have found to be stable with the noted hash rates. I'm still trying to nail down optimal settings on many of the systems, as well as finding something that works well for R9 290/290X. I'll update my list as appropriate.

Radeon HD 7970 (R9 280X) (using vertminer.exe):
GPU clock: 1050-1140
RAM clock: 1500-1800
Thread Concurrency: 8192
GPU Threads: 1
Intensity: 13
Hash Rate: 290-320 KHash/sec

Radeon HD 7950:
GPU clock: 950-1000
RAM clock: 1425-1500
Thread Concurrency: 16040
GPU Threads: 1
Intensity: 19
Hash Rate: 270-290 KHash/sec

Radeon HD 6970:
GPU clock: 925
RAM clock: 1400
Thread Concurrency: 8000
GPU Threads: 1
Intensity: 18
Hash Rate: 230-250 KHash/sec

Radeon HD 6950:
GPU clock: 875
RAM clock: 1250
Thread Concurrency: 6000
GPU Threads: 1
Intensity: 18
Hash Rate: 210-230 KHash/sec

Radeon HD 5870:
GPU clock: 925
RAM clock: 1150
Thread Concurrency: 5688
GPU Threads: 1
Intensity: 18
Hash Rate: 200-220 KHash/sec

Radeon HD 5850:
GPU clock: 850-900
RAM clock: 1050-1100
Thread Concurrency: 5120
GPU Threads: 1
Intensity: 18
Hash Rate: 170-190 KHash/sec

Again, donations are very much appreciated. And if you have some other coin you'd prefer to send, let me know!

VTC:  VaNuRCj73JVAwR1YMnt8CXaqoiPgykiMTk
BTC:  153qS9Ze32hnV3fwirZLWNka4wBAowc21E
LTC:  LfCLyykrNFftzpdWejR73hf478ZtBzQ9jE
DOGE: DD9iTWf8diPkvKdB8roPJepTyp6BGVQtct

Tuesday, December 10, 2013

Finding Optimal Clock Speed for CGMiner and R9 290/R9 290X

Update, 12/12/2013: There were some bugs in the batch files (an errant "--" in one, for example), so I've updated them with new versions that should run properly now.

Going along with the previous post on finding the best Thread Concurrency setting for your hardware, you'll probably first want to find some good clock speeds. Unlike searching for a good TC value, tuning your clock speeds could very well lead to a system crash/hang and/or BSOD. Ideally, your system will automatically reboot, but in some cases it will get stuck and you'll have to manually intervene. Once again, I've created a couple batch files (that build off the previous batch files) for helping you find optimal values for your hardware, which you can download here. The contents of the two batch files are included below for reference:

engine-clock-test-r9version.bat:
@echo off
set threadconcurrency=24000
set gpuclock=800
set memclock=1300
set gpufan=50-75
set gpuvolt=1.100
set gpupowertune=50
set gpustopclock=1100

if exist currentgpuclock.txt (
  for /F %%x in (currentgpuclock.txt) do set gpuclock=%%x
)

setlocal EnableExtensions

:startloop
echo Current GPU Clock is %gpuclock%
echo %gpuclock%> currentgpuclock.txt
start "MinerThread" miner-tc-r9version.bat %threadconcurrency% %gpuclock% %memclock% %gpufan% %gpuvolt% %gpupowertune%
sleep 300
taskkill /im cgminer.exe /f
<nul set /p =GPU Clock %gpuclock%: >> AvgHashrateGPU.txt
grep -i "(avg)" %threadconcurrency%.txt | tail -1 >> AvgHashrateGPU.txt
set /a gpuclock=gpuclock+5
if "%gpuclock%" GTR "%gpustopclock%" goto :EOF

goto :startloop
memory-clock-test-r9version.bat:
@echo off
set threadconcurrency=24000
set gpuclock=800
set memclock=1200
set gpufan=50-75
set gpuvolt=1.100
set gpupowertune=50
set memstopclock=1700

if exist currentmemclock.txt (
  for /F %%x in (currentmemclock.txt) do set memclock=%%x
)

setlocal EnableExtensions

:startloop
echo Current RAM Clock is %memclock%
echo %memclock%> currentmemclock.txt
start "MinerThread" miner-tc-r9version.bat %threadconcurrency% %gpuclock% %memclock% %gpufan% %gpuvolt% %gpupowertune%
sleep 300
taskkill /im cgminer.exe /f
<nul set /p =RAM Clock %memclock%: >> AvgHashrateRAM.txt
grep -i "(avg)" %threadconcurrency%.txt | tail -1 >> AvgHashrateRAM.txt
set /a memclock=memclock+10
if "%memclock%" GTR "%memstopclock%" goto :EOF

goto :startloop
Other than modifying the GPU Engine or GPU Memory clock each iteration, the two files are the same. They also use the same miner-tc-r9version.bat file as before (which I didn't rename because why bother). If you create a link to the batch file you're testing and put that in your Startup folder, the batch files will also continue from where they left off in the case of a system reboot...which means if your system is unstable before the stopping clock you specify, it will be stuck in a reboot loop, so keep an eye on things or don't put the files in the Startup folder and instead save that for a stable cgminer configuration -- and be sure to set the gpustopclock and memstopclock to appropriate values.

My recommendation would be to choose a reasonable starting memory clock (around 1300 is usually safe on all R9 290/290X GPUs) and run the engine-clock-test-r9version batch file. When that finishes (or reaches a point where it cannot continue), look at the AvgHashrateGPU.txt file and you should end up with one of to things. Eiher you find out how far you can push clocks before becoming unstable and crashing (with each increase in clock speed bringing improved performance), and in that case I'd probably back off 10-25MHz from the point where the GPU crashed, but you can do as you please. The other possibility is that you'll find hash rates peak at a lower clock speed (say, 825-850MHz), and as you try going higher the AMD GPU will begin to throttle automatically. If this is happening, use the clock speed that gives you the highest hash rate.

Once you've found a good GPU clock, set the gpuclock=800 line in the second batch file, memory-clock-test-r9version, to that clock speed and then run the second script. It will do the same thing as before, except now RAM clocks go up 10MHz every five minutes until you reach the stopping clock speed (1700MHz is what I put in) or you crash -- and a crash is far more likely if you try for 1700MHz GDDR5! Check your AvgHashrateRAM.txt file for the best result and use that for your GPU, and then go run the Thread Concurrency optimization batch file and find the best TC for your system.

Here's the tricky part: you need to do the above for each and every GPU in your system(s) if you want to get optimal performance, while means you also need to tweak the miner-tc-r9version.bat file and add "--device [Number]" to the cgminer.exe command for each GPU. You might not need to do this for Thread Concurrency, but for the Engine and RAM GPU clocks it will definitely help out! Also, once you find values for each GPU that work well, you may find that running all your GPUs at once will require slightly lower clocks in order to be stable (which potentially could mean you need to check TC again, though that's probably overkill).

Now all we need is for more R9 GPUs to be available at reasonable prices -- I'm seeing prices of $700 for R9 290 and $830 for R9 290X right now! And Newegg isn't really any better last I checked (well, maybe a bit better, but still price gouging). If you've already got yourself some shiny R9 290 GPUs, happy mining while everyone else is stuck waiting!

Donations and referrals gladly accepted if this helps you out:
LTC: LXpEZcNJtikd263z7Ha3vrdYDcLU7hiKWv

CGMiner Optimal Thread Concurrency for R9 290/290X

Continuing from my previous post, I've now created a batch file to help find the optimal Thread Concurrency setting for R9 290/290X systems. The difficulty with doing this stems from the fact that normally exiting CGMiner on Windows with the new GPUs will cause a BSOD on most (all?) systems, so you can't use my other batch files. They work great on HD 7970/R9 280X and earlier systems, though, and last night I managed to increase my HD 7950 test system by 20KHash/sec per GPU. So how do we deal with R9 290/290X? We tweak things a bit and end up with some new batch files, which you can download via my Dropbox.

Instructions:

Extract the contents of that Zip file to your CGMiner folder (Windows only right now). There are five files inside, including three EXE files, but nothing dangerous; here's the quick summary of the EXE files.

Sleep.exe is a program that can be used in batch files to pause for a set amount of time (e.g. 300 seconds = "sleep 300").

Grep.exe is a common Unix program that allows you to search through files for matching strings; you can use "find" on Windows, but the output of CGMiner messes find up because it includes special characters.

Tail.exe is the last executable and it's also a port from Unix; it allows you to output the last few lines from a file (or a command); so "tail -1" gives the last line from a file or command.

I use the above three files in the batch files to help with creating a useful summary of the mining results for each thread concurrency. The two batch files are similar to before, but with some tweaks. Here's what they contain if you don't want to download:

thread-concurrency-test-r9version.bat
@echo off
set threadconcurrency=18000
set gpuclock=900
set memclock=1400
set gpufan=50-75
set gpuvolt=1.100
set gpupowertune=50

if exist currenttc.txt (
  for /F %%x in (currenttc.txt) do set threadconcurrency=%%x
)

:startloop
echo Current TC is %threadconcurrency%
echo %threadconcurrency%> currenttc.txt
start "MinerThread" miner-tc-r9version.bat %threadconcurrency% %gpuclock% %memclock% %gpufan% %gpuvolt% %gpupowertune%
sleep 300
taskkill /im cgminer.exe /f
<nul set /p =%threadconcurrency%: >> AvgHashrateTC.txt
grep -i "(avg)" %threadconcurrency%.txt | tail -1 >> AvgHashrateTC.txt
set /a threadconcurrency=threadconcurrency+64

goto :startloop
miner-tc-r9version.bat
@echo off
set threadconcurrency=%1
set gpuclock=%2
set memclock=%3
set gpufan=%4
set gpuvolt=%5
set gpupowertune=%6
cgminer --scrypt -o stratum+tcp://coinotron.com:3334 -u trogdorjw73.tester -p tester -w 256 -v 1 -I 20 -g 1 -T --gpu-engine %gpuclock% --gpu-memclock %memclock% --gpu-fan %gpufan% --gpu-vddc %gpuvolt% -- --temp-target 80 --temp-overheat 95 --temp-cutoff 99 --thread-concurrency %threadconcurrency% > %threadconcurrency%.txt
exit
The first files starts with some variables you can modify for clock speeds, starting thread concurrency, voltage, fan speed, and powertune. It the calls the second file (passing the variables along), which actually starts CGMiner running. Because we can't let CGMiner exit gracefully without a BSOD, the first file waits 300 seconds after starting the second file and then kills the CGMiner.exe process, at which point it uses the output from the mining results and grabs the last average hash rate, which ends up in a text file called AvgHashrateTC.txt.

So to use this, you first need to delete (or at least rename) your cgminer.conf file in your CGMiner folder, then extract the Zip file to the directory and just run thread-concurrency-test-r9version.bat and walk away (though you might want to tweak the clocks or other settings first). Come back in a day or so and look at your averages and you'll see something like the following:
18000: (29s):1.398M (avg):1.569Mh/s | A:640   R:0    HW:627  WU:616.8/m
18064: (29s):1.368M (avg):1.565Mh/s | A:1600  R:0    HW:710  WU:610.6/m
18128: (29s):1.264M (avg):1.585Mh/s | A:1600  R:0    HW:537  WU:608.4/m
18192: (29s):1.330M (avg):1.536Mh/s | A:1600  R:0    HW:600  WU:685.5/m
18256: (29s):1.409M (avg):1.575Mh/s | A:1920  R:320  HW:347  WU:707.8/m
18320: (29s):1.339M (avg):1.544Mh/s | A:2240  R:0    HW:467  WU:626.2/m
18384: (29s):537.3K (avg):1.357Mh/s | A:640   R:0    HW:384  WU:681.4/m
....
If all goes well, you will have a lot more lines than the above, but it's possible your system will crash during the testing. To get around that, the currently tested TC is spit out to a file which gets read when the first batch file starts. If you create a shortcut to thread-concurrency-test-r9version.bat and put that in your Startup folder, even after a crash/reboot the testing will pick up where it left off.

In the meantime, based on more experience with the GPUs, I'm recommending the Radeon R9 290 over the R9 290X for Windows users -- you can probably get closer to 1000KHash/sec on the 290X with Linux, but on Windows it can be rather difficult. Also, the default voltage used on your GPU will affect your ability to hit higher clocks and hash rates -- lower voltages being better.

Donations gladly accepted if this helps you out:
LTC: LXpEZcNJtikd263z7Ha3vrdYDcLU7hiKWv
Go win some LTC!

Finding Optimal Litecoin Mining Settings

Tuning your Litecoin mining system to get ideal performance can be a royal pain in the rear -- this I know from personal experience. Settings that work great for one person can end up being terrible for another individual. So if you've just bought a shiny new Radeon R9 290 or R9 290X (or any other GPU for that matter) and you're trying to get better hash rates, here's the general plan of attack for getting optimal mining performance from your system:
  1. Ideally you want to mine at intensity 20, as that will result in the fastest performance, but the system will not really be usable for other work.
  2. Start at reasonable settings and then start increasing GPU clocks and memory clocks until your system becomes unstable.
  3. You'll probably need to play with fan speeds and/or voltages in the process of tuning.
  4. Once you've found the clocks that your GPU will handle, start looking for the optimal thread concurrency setting.
Needless to say, dialing things in can take days if not weeks, and every crash and restart can be maddening. I'm trying to build a set of batch files to automate things under Windows. Here's what I have so far, for finding an optimal thread concurrency setting. You need to put the two batch files in your CGminer folder, without any active cgminer.conf file.

ThreadConcurrency.bat:
@echo off
set threadconcurrency=18000
:startloop
echo Current TC is %threadconcurrency%
start /wait "MinerThread" miner-tc.bat %threadconcurrency%
<nul set /p =%threadconcurrency%:  >> AvgHashrateTC.txt
type %threadconcurrency%.txt  | find /i "average hashrate" >> AvgHashrateTC.txt
set /a threadconcurrency=threadconcurrency+64
goto :startloop
miner-tc.bat:
@echo off
set threadconcurrency=%1
cgminer --scrypt -o stratum+tcp://coinotron.com:3334 --shares 5  -u trogdorjw73.tester -p tester -w 256 -v 1 -I 20 -g 1 -T --gpu-engine 965 --gpu-fan 70 --gpu-memclock 1550 --gpu-vddc 1.075 --temp-target 85 --temp-overheat 95 --temp-cutoff 99 --thread-concurrency %threadconcurrency% > %threadconcurrency%.txt
exit
Place those two files into your cgminer folder and then run ThreadConcurrency.bat (tweaking as needed for your mining pool, temps, etc.) and walk away. Your PC will run through five shares at each thread concurrency setting and spit out the result to a file called "AvgHashrateTC.txt", and you can look at that in the morning after running the batch file all night (or in the evening after running it all day if you prefer).

There's a catch, of course: I set the above to do five shares, and sometimes you'll get lucky or unlucky so hash rates can be higher/lower. Setting the shares value higher (like 20 or 30) would take longer to get through a sequence but it would be more accurate. When you're fine tuning that's worth a look, and maybe you could even change the increment from "+64" to "+32" or "+16" -- or even "+1" if you think that might help.

You can use the same approach for clock speeds as well, but you'll probably want a maximum clock (or just let it go until your PC reboots). I'll post some batch files for that tomorrow. Also note that on the R9 290/290X cards under Windows, when cgminer exits it often causes a BSOD -- no fun! I'm not sure if that's drivers or cgminer 3.7.2; I need to try poking around a bit, but it's a real irritant. Closing the window with the X in the corner avoids the problem, but that doesn't work with CGWatcher or my batch files above.

If you find this useful, go ahead and run the files as above and I'll get a few mining shares during your testing. Optionally, feel free to donate to my blogging efforts by shopping online or via LTC donations. Or win some for free and give me a commission.

LTC: LXpEZcNJtikd263z7Ha3vrdYDcLU7hiKWv