Litecoin Mining on Mac OS X – GPU Mining

Litecoin Logo

My previous article on Litecoin mining I discussed how you can get started mining Litecoins, an alternative to the Bitcoin crypto-currency, using your spare CPU cycles. If you’re GPU is already mining Bitcoins, using your CPU to mine Litecoins may be an obvious choice. However, if you are “all in” on Litecoin then you can get a sizable performance increase by using your GPU to mine Litecoins. Whether that trade-off is worth-while is a decision you would need to make. Litecoin is not as mature as Bitcoin and is just as volatile. Some see it as a doomed clone, others as the next Bitcoin, poised to take off.

GPU Mining

In order to start using your GPU to mine Litecoins on OS X, you’ll need to first install cgminer or bfgminer. Please read my previous article on Bitcoin mining for step-by-step instructions and installation packages for cgminer and bfgminer. The Homebrew formulas I shared in my previous article include the configuration settings necessary to mine both Bitcoins and Litecoins. If you are compiling the applications yourself, make sure to use the –enable-scrypt parameter when running ./configure.

Armed with a copy of cgminer or bfgminer with scrypt enabled, you can now start mining Litecoins with your GPU. Now a fair warning: finding a nice set of parameters for mining Litecoins with cgminer or bfgminer is far more finicky and time consuming. With Bitcoins you can basically run either miner and just specify your pool. The miner will then tune itself and eventually reach a nice hash-rate.

This isn’t really the case with using either miner to mine Litecoins. For instance, if I use the following command line to mine Litecoins using my ATI 5770. Note that I am using the -d parameter to specify which GPU to use to simplify these examples.

cgminer --scrypt -o host:port -u username -p password -d 0

cgminer No Params

With no additional tuning my 5770 gets about 5Kh/s. My CPU alone gets around 29Kh/s. Using bfgminer with the basic command-line parameters yields similar results. As indicated in my previous article I use the –no-opencl-binaries to work around a crash in bfgminer with multiple GPU’s on OS X.

bfgminer --scrypt -o host:port -u username -p password -d 0 --no-opencl-binaries

bfgminer No Params

So how can we get better performance mining Litecoins on the GPU? The first parameter to focus on is the -I parameter, or the intensity. With Bitcoin this parameter does help, but honestly not a ton. If you aren’t using the PC, and you leave the intensity at “Desktop” (-I d), both cgminer and bfgminer will eventually reach around the same performance you’d get by specifying something like -I 9.

This is not the case with Litecoin mining. With scrypt (Litecoin’s hashing algorithm) you need to specify a high intensity, in fact higher than is suggested for Bitcoin. I’d start at around 10 and go up from there. On my system, 15-16 is about the best I can do.

So lets try cgminer with -I 13 to see what that does:

cgminer --scrypt -o host:port -u username -p password -d 0 -I 13

cgminer with I

That change alone triples the Kh/s, but from 5Kh/s to 15Kh/s honestly isn’t much to brag about. Let’s try with bfgminer:

bfgminer --scrypt -o host:port -u username -p password -d 0 --no-opencl-binaries -I 13

bfgminer with I

Similarly I get around 14Kh/s using the -I 13 parameter with bfgminer.

The next parameter to focus on is the -w parameter, which specifies a worksize in multiples of 64 up to 256. This parameter is what really makes a difference on my OS X rig:

cgminer --scrypt -o host:port -u username -p password -d 0 -I 13 -w 64

cgminer with I w

Now we’re cooking with Crisco! Using -I 13 -w 64 on my 5770 gets me from the original 5Kh/s up to 83Kh/s with cgminer. And with bfgminer?

bfgminer --scrypt -o host:port -u username -p password -d 0 --no-opencl-binaries -I 13 -w 64

bfgminer with I w

This gets us up to around 80 Kh/s with bfgminer as well. By removing the -d parameter so that both GPU’s are used and cranking up the -I parameter to 16 I can get my GPU’s up to around 230 Kh/s:

cgminer --scrypt -o host:port -u username -p password -I 16 -w 64

cgminer Two GPUs

The last parameter I want to note is –thread-concurrency. If cgminer or bfgminer are reporting hardware errors (the HW number in the output) this indicates that you need to make use of the –thread-concurrency parameter. These are not hardware failures. You can find guidelines for the value to use here:

57xx cards: 2368-4096 (3200 is common)
58xx cards: 4096-8192 (5600, 7168, and 8000 are common)
5970 cards: 4096-8192 (5632 or 8000 are common)

67xx cards: 2368-4096 (3200 is common)
68xx cards: 3008-6720 (4800 is common)
69xx cards: 4096-8192 (5600, 7168, and 8000 are common)
6990 cards: 4096-8192 (5632 or 8000 are common)

7xxx cards: 64 * bus-width-of-card-in-bits. So, for a 7950, that would be 64 * 384 = 24576. Ideal values are 21712 or 24000. Find your bus width here.

I verified that 3200 works well with a 5770 and 4800 works well with a 6870.

Conclusion

And that about covers it for my series of articles on mining Bitcoins and Litecoins using Mac OS X and Apple hardware. The growing landscape of crypto-currency is fascinating from many perspectives. If your interest is piqued and you are running OS X, hopefully you now have the information you need in order to get started mining this new form of currency.

Advertisements

22 thoughts on “Litecoin Mining on Mac OS X – GPU Mining

  1. Pingback: Litecoin Mining on Mac OS X – CPU Mining | blog.nwoolls.com

  2. davcamer

    Thanks for the excellent guides on starting mining on a Mac. I have been trying it out over the weekend on a couple of different laptops, one Air and one Pro. Obviously, neither of them are heavy hitters but the experimentation is quite fun.

    I found MacMiner to be better than doing homebrew installs, surprisingly. Also, I haven’t been able to get Litecoin mining working on the Pro’s GPU. It gives a cryptic OpenCL initialization error:
    Error -54: Enqueueing kernel onto command queue. (clEnqueueNDRangeKernel)

    Reply
  3. Bill Doody

    Error -54 can be fixed by playing with the Intensity. Start with [ -I d ] and see if it works.

    Reply
  4. Deviant Kade

    Finally was able to get Cgminer to compile and install correctly for Lion..any thought to why I get about 40 Kh/s on a Radeon 5770 using the following via terminal –

    $cgminer –scrypt –worksize 128 –lookup-gap 2 –thread-concurrency 3200 –intensity 11 -o http://mining.usa.la.hypernova.pw:9332 -u worker.1 -p xxxxxx

    If i go above intensity 11 my monitor will freeze up :/

    Reply
    1. nwoolls Post author

      Try a worksize of 64 instead of 128. Also, try removing the lookup-gap. If things are stable then start upping the intensity.

      Reply
      1. Deviant Kade

        Thanks for the reply! Brought the work down to 64 and it sped up a few Kh/s to about 46 at the moment on a 5770 and removing the lookup gap brings me to about 50 Kh/s. If i take the intensity past 12 the computer freezes up :/ Any other ideas why it could be going so slow? I read to add these lines in the terminal before the scrypt :
        export GPU_MAX_ALLOC_PERCENT=100
        export GPU_USE_SYNC_OBJECTS=1

        Doesn’t seem to make much of a difference sadly but hey..50 is better then my original 10.

  5. Victor Sander

    Hey, I need some help.
    after launching terminal, trying to start cgminer up, i get this error when trying to use the command line you are suggesting:
    Started cgminer 3.1.0
    Started cgminer 3.1.0
    Probing for an alive pool
    Pool 0 slow/down or URL or credentials invalid

    What am I doing wrong?

    Reply
  6. Pingback: Bitcoin & Litcoin Proxy Mining on Mac OS X | blog.nwoolls.com

  7. Jon Stern

    Hi,

    Can I use this setup for Feathercoin?
    I have everything setup for Litecoin but it’s not mining properly. How do I indicate it to mine feathercoin and not litecoin.

    cgminer -k diablo –scrypt -o stratum+tcp://pool.fcpool.com:3334 -u worker.1 -p xxxxxx -I 13 -w 64

    Thank you!

    Reply
    1. nwoolls Post author

      It should work as long as your arguments are valid for Scrypt mining. Litecoin and Feathercoin should work the same. What sort of problems are you having?

      Reply
  8. Jon Stern

    I am getting errors like this from my clean command line:

    cgminer –scrypt -o stratum+tcp://pool.fcpool.com:3334 -u XXXXXX -p XXXXXX

    I have tried to connect not using stratum and it works.

    [2013-09-17 17:00:05] Press any key to exit, or cgminer will try again in 15s.
    [2013-09-17 17:00:21] Failed to connect to stratum on pool.fcpool.com:3334
    [2013-09-17 17:01:20] No servers were found that could be used to get work from
    .
    [2013-09-17 17:01:20] Please check the details from the list below of the serve
    rs you have input
    [2013-09-17 17:01:20] Most likely you have input the wrong URL, forgotten to ad
    d a port, or have not set up workers

    Reply
  9. Milen

    very good series, thank you.

    I have one problem proceeding with cgminer (3.6.1.), says:
    `cgminer already installed, it`s just not linked`

    I tried to find some info on goodle but wasn`t succesful. Do you have any hint? thank you

    Reply
  10. Nis Sarup

    This had me stumped for a couple of hours today. As can be seen here: https://github.com/ckolivas/cgminer/blob/master/NEWS cgminer has no support for scrypt since version 3.8.0.

    You can “brew edit cgminer” and change the version numbers in the link to the file on github.
    When you try to install it you will get a SHA-hash error. Just copy the “actual” hash to the hash just below the URL you just changed and try the install again. This worked for me.

    Reply
  11. Kinkle (@djkinkle)

    3.8.4 cgminer not responding to LTC mining
    Having trouble trying to install previous version. This has been a very helpful forum and I feel like I was so close. Now I”m stuck. Any advice/help be greatly appreciated.

    Reply
  12. Jon Stern

    I am using a Sapphire 7950 on my Mac Pro tower and the best hashing rate I can get is 360 Kh/s mining Litecoins. I have seen that people have gotten up to 600 Kh/s with a 7950. What can I do on my computer to speed it up?

    CGMiner (3.4.3) command line:

    cgminer –scrypt -w 256 –intensity 19 -v 1 -g 1 –lookup-gap 2 –thread-concurrency 21712 -o –url=stratum+tcp://us.XXXXXpool.org:8080 –userpass=XXXXXX.1:XXXXXX

    Is it the stock power supply? Is it the mac versions of the 7950 that is slow? It seems I should be able to get 600 Kh/s. Thank you for your help.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s