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

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

Tuesday, December 3, 2013

Litecoin Mining Rig, 4x R9 290 Edition

After the last post, quite a few people have wondered exactly how I would go about building a new Litecoin mining rig. Well, I did the plastic crate thing last time, and I decided that was a bit too ghetto. Yes, the case was cheap, but it's a pain to work with if anything goes wrong. A nice, solid metal frame would be way better, so that's what I'm going to use here. My goal was to get four GPUs into the build, which means this is going to be pretty expensive, but it's also going to crank out some serious hashing power. Here's what I put together for my price list:

Litecoin Mining Rig, 4x R9 290 Edition
Component Description Cost
Processor AMD A4-4000 $45
Motherboard MSI FM2-A85XA-G43 $85
Memory 2x4GB DDR3-1600 $60
GPUs 4x Radeon R9 290 4GB $1808
Storage 60GB 2.5” SSD $57
WiFi USB 802.11n N600 $20
PSU 1300W 80 Plus Gold $303
PCIe Extension 2x x16 to x16 Riser Cable $13
PCIe Extension 2x x1 to x16 Riser Cable $10
Case Parts 6x 12” Aluminum Tubing $29
Case Parts 2x 24” Aluminum Tubing $24
Case Parts 12” x 24” Aluminum Sheet $12
Case Parts 8x 3-way Corner Connector $35
Total $2501
Alternative Case Parts 4 x 48” Series 13 Tubing (You'll need to cut this to the appropriate lengths) $64
Alternative Case Parts 8x 3-way Series 13 Corner Connector $35

Now, obviously that's a lot of money, but let me run through the basic idea. First, we're going to go relatively low-cost on the CPU and motherboard, with enough RAM to keep the system happy. I'm using a 60GB SSD just so it boots quickly and because you need some form of storage, but any HDD would work. Add in a WiFi adapter and we've got the core of the system.

The real meat of the build is in the GPUs of course, and I've used four R9 290 cards from Amazon.com. Unfortunately, Amazon is currently price gouging (thanks to all the Litecoin miners I'd wager), so feel free to shop around. Stock is limited right now but I hope it picks up in the coming weeks. You'll need four riser cables, two x16 to x16 and two x1 to x16 (powered preferably). I couldn't find any of the latter in stock on Amazon, so you might need to resort to eBay or try unpowered connectors. I also went with a single large 1300W 80 Plus Gold PSU to power the whole shebang.

For the case, after using plastic crates, I found that the build just didn't feel very stable and I'm a bit concerned about how well it's cooling. Switching to a metal frame should be relatively easy, as long as you have a drill to work with and some stands for your mobo from a previous build. Assemble the whole thing and you end up with a metal frame with the four GPUs screwed into the frame. I'd suggest orienting the cards so that the exhaust points up to improve cooling.

The total cost for this build as listed above is around $2500, but if you find R9 290 GPUs for the $400 MSRP it would be $2300. Properly configured, we should get around 3400-3600 KHash/sec with a power draw from the wall of around 1100W. With the current difficulty having jumped up quite a bit in just the past week, estimated income is $2100 for the next month, meaning you'll pay off the hardware at current prices in just over a month, maybe two.

Of course, the price could crash and that would leave you with an expensive system that may not be paying itself off very fast. Worst-case, I would guess Litecoin could crash down to single digits again, but I suspect it will stay above $5. At the current difficulty, paying $0.10 per KWh, the break even point for mining is around $1.50 per LTC. My past experience is that even if the price drops into the single digits, difficulty will likewise scale back and so I suspect until (if?) we get Litecoin ASICs this system should remain profitable.

Here's the real trick: if you can stay in this for the long haul, LTC has hit nearly $50 once and stayed above $20 for more than a week. Right now, it doesn't look like we'll drop below $20 any time soon, though it could still happen. I bet that far more likely is LTC will eventually hit prices 10x and even 100x what we've seen right now, so if you can stash away your coins for the future, they could one day be worth hundreds or even thousands of dollars.

The power cost for running this setup is going to be $80 per month, and my advice is to never sell more than half of the coins you mine, unless you reach the point where you're ready to cash out and call it quits. (Or in other words, when you've gotten enough value and you don't want to be greedy.) Within the next two years, we should see prices reach the point where you could sell off all your LTC at more than $200 per coin. Stay the course and you could be the next cryptocoin millionaire.

Some of you are probably shaking your heads saying, "This guy is crazy. There's no way this LTC fad is ever going to be worth $100 again, let along $1000 coins!" I thought the exact same thing about Bitcoin/BTC back in 2011. I was mining and making money, but I sold off most of what I mined on the way down to $2. Then I played around and sold over 200 coins at less than $4. Now, I'm looking at $1000 BTC and realizing that some of the dreamers were right, and we're probably not done yet. Will we see $10,000 BTC in the future? Probably. It might take five years to get there, and you might need to weather some <$100 prices, but we've seen these bubbles three times now and the latest has surpassed my wildest speculation. I'm being far more bullish now and betting LTC will do the same -- maybe only 1/10 what BTC is worth, but even then that's going to be enough to pay off all my debts and then some.

Dare to dream.

Find this useful? Please donate some LTC to help me support my blogging efforts or shop via my affiliate links. Either one is greatly appreciated! Or if you have no LTC, go win some for free!

LTC: LXpEZcNJtikd263z7Ha3vrdYDcLU7hiKWv

Update: Need help? See my Toubeshooting Guide.

Thursday, April 11, 2013

TopPower Nano: When Is Gold Not Gold?

Okay, I admit it: I got duped! I was in the market for a good power supply to run my new Litecoin mining PC, so naturally I went to Newegg and searched for "80 Plus Gold" efficiency power supplies. As the PC currently has two high-end Radeon 7950 GPUs running full tilt (and I might add a third), I also wanted at least a 1000W power supply. A quick search at Newegg gets you these results. The TopPower 1000W is currently out of stock, most likely thanks to other unwitting purchasers like myself.

What really amazes me isn't that someone tried this -- it's that they so far have gotten away with it! Well, that or they changed the packaging? Anyway, check this out: TweakTown calls it an 80 Plus Gold, and so does HardOCP. It looks like the front of the box had an "80 Plus Gold" sticker for both reviews, but look at the back of the box (these are my photos, but the above reviews have the same image, more or less):
Okay, so now it gets interesting, right? The box says 80 Plus Bronze, but that's because the box is sort of made for all of the six PSUs in the same family. The front of the box is clearly different (it says 1000W), but that's just a sticker over the original label (most likely 700W). So the question is: is this an 80 Plus Gold or an 80 Plus Bronze?

To answer that, let's turn to the HardOCP review. Oh, what's that? It fails to reach 80 Plus Gold certification levels? Color me not surprised. They pretty much skewer the TopPower, and rightfully so (good job, [H]. It did better over at TweakTown, where it appears to actually meet the requirements. They gave it an award as well, based on the value proposition. So which is it, Bronze or Gold?

Unfortunately, in my book it's neither -- at least in terms of awards. I've read a few other reviews, and I've come to the conclusion that there's a good reason this is the least expensive 1000W "gold" power supply around: it's also one of the worst. Thankfully, even a bad "80 Plus Gold" is usually good enough, but hopefully I don't end up eating my words. You see, a PSU may not seem like a big deal -- it just supplies power, right? -- but if you end up with a PSU failing at some point, it can take out most of the rest of your PC as well.

If I had it to do over, I'd spend more to get a power supply with better reviews and a real 80 Plus Gold efficiency, like this KingWin. In fact, all things considered at that price I would just go whole hog and upgrade to 80 Plus Platinum, which once again lands me with KingWin, this time with the LZP-1000. The Platinum model even gets a JohnnyGuru Recommended award, which is about as good as you'll find.

In the meantime, my Liteminer PC is chugging along merrily at around 1100kHash/s from the combined GPUs. That should get me around 4-5 LTC per day, which works out to a mere $6.75-$8.50. You see, Litecoin (and Bitcoin) just took a tumble on pricing, to about half their former value. Still, with a power use of around 600W for Liteminer, that's about $1.50 per day in electricity, so $5-$7 in profit isn't terrible. It does mean that it might take a few more months to pay off the hardware in Liteminer, at least if I were selling my LTC.

You see, I did that before with BTC; I could have stocked up on roughly 1000BTC if I had just been patient, and that would have been worth more than my house just last week! It might take a while, but we've been here before and I expect BTC and LTC are both here to stay; now, it's only a matter of waiting for the pricing to get high enough! My current MtGox has a standing sell order in for the crazy eights: $888.88. I wonder how long it will take us to get there? I'm hoping before the end of 2014, as that will take care of all my debts and then some. :-)

BTC: 1JSrAuxPUhD2rS6yYLiPPT6X8fvz7c7k1W
LTC: LXpEZcNJtikd263z7Ha3vrdYDcLU7hiKWv