Build your own Litecoin Mining Rig, part 2: Linux Setup

Linux Litecoin Mining Setup Guide
In the second installment of our DIY litecoin mining guide, we’ll look at how to install and configure Linux to properly mine with your GPUs at optimal settings. Don’t be dissuaded if you’ve never used Linux before—our step-by-step guide makes it easy.

Linux has a few advantages over Windows, including the ability to install to a USB stick (which means you don’t need a harddrive), lesser hardware requirements (you can get by just fine with less than 4GB of RAM), and simpler remote administration capabilities. Best of all, Linux is free! However, be aware that if you’d like to undervolt your GPUs to save power, Windows might be a better choice for you (update 10/2013: no longer true!).

If you missed the hardware portion of our guide, make sure to check it out first. Otherwise, read on.

Build a Litecoin Mining Rig, part 2:  Linux Setup

So you’ve decided to use Linux to run your mining rig—a fine choice! If you’re still a bit nervous because you’ve a complete Linux newbie, don’t be. Simply follow the step-by-step instructions exactly as they’re written, and you’ll be fine. Even if you’ve never done anything like this before, you should be up and running in about an hour.

Step 1: Configure BIOS settings

Before we even get to Linux, make sure your mining computer’s BIOS settings are in order. Power on your computer, and press the “delete” key a few times immediately after power on. You should end up in the BIOS configuration area. Do the following, then save & exit:

  • Change power options so that the computer automatically turns itself on whenever power is restored. The reason for this is two-fold: first, it’ll make sure that your miner automatically starts up after a power outage. Second, it makes powering the computer on much easier if you don’t happen to have a power switch connected to the motherboard.
  • Make sure that your USB stick is first in the boot-up order (you may need to have a USB stick attached).
  • Disable all components that you don’t plan to use. This will save a little bit of power, and since your miner will likely be running 24/7, it’ll add up. For me, that meant disabling onboard audio, the SATA controller, the USB 3.0 ports (I only had a 2.0 USB stick), the Firewire port, and the serial port.

Step 2: Install Xubuntu Desktop to your USB stick

Xubuntu is a lightweight version of Ubuntu, a popular Linux distribution. Most other distros should work just fine, but be aware that the GPU drivers require the presence of Xorg, which means server distros that don’t have a GUI will not work properly.

  • Download the Xubuntu Desktop x64 v12.10 installation image.
  • You’ll need to either burn the installation image onto a CD, or write the image to a second USB stick. If you use a CD, you’ll need to temporarily hook up a CD-ROM drive to your mining rig for the installation (make sure you temporarily enable your SATA controller if you disabled it in step 1!).
  • Once you have the installation media prepared, you’re ready to install Xubuntu to the blank USB stick on your miner. Make sure your blank USB stick is inserted into a USB port on your mining, and then boot into your installation media. The Xubuntu installer should appear.
  • Make sure to click the “auto-login” box towards the end of the installer; otherwise take all of the default installation options.
  • If you’re using a USB stick that is exactly 8GB, the installer may complain about the default partition sizes being too small. Create a new partition table with these settings: 5500mb for root (/), 315mb for swap, and the remaining amount for home (/home). If you’re using a USB stick larger than 8GB, you will not have to do this.
  • When the installation is complete, you should automatically boot into the Xubuntu desktop. Make sure to remove your installation media.

Step 3: Install AMD Catalyst drivers

Open a terminal session by mousing over the bottom center of the screen so that a list of icons appears. Click on “terminal” (it looks like a black box).

  • Type the following commands (press “enter” at the end of each line and wait for Linux to finish doing it’s thing):
    sudo apt-get install fglrx-updates fglrx-amdcccle-updates fglrx-updates-dev
    sudo aticonfig --lsa
    sudo aticonfig --adapter=all --initial
    sudo reboot
  • After your computer reboots, you can verify that everything worked by typing:
    sudo aticonfig --adapter=all --odgt
  • If you see all of your GPUs listed, with “hardware monitoring enabled” next to each, you’re good to go.

Important: you may need to have something plugged into each GPU to prevent the OS from idling it. You can plug 3 monitors into your 3 GPUs, but that isn’t very practical. The easiest option is to create 3 dummy plugs, and leave them attached to your GPUs. They’ll “trick” the OS into believing that a monitor is attached, which will prevent the hardware from being idled. Check out how to create your own dummy plugs.

If you ever add or remove GPUs to your rig later, you’ll need to re-run this command:   sudo aticonfig --adapter=all --initial

Step 4: Install SSH, Curl, and package updates

  • Install SSH by typing:
    sudo apt-get install openssh-server byobu

With SSH installed, you can unplug the keyboard/mouse/monitor (put dummy plugs into all GPUs, though) from your miner, and complete the rest of the installation from your desktop computer. Simply download Putty onto your desktop, run it, and enter the IP address of your mining rig. That should bring up a remote terminal session to your miner, which is more or less just like sitting at the keyboard in front of it.

If you plan to manage your mining rig remotely over the internet, you’ll need to forward port 22 on your router to your miner. Make sure that you use a strong Xubuntu password!

Setup should be quicker from this point, as now you can simply copy text from this webpage (highlight it and press control-C) and then paste it into your Putty session by simply right-clicking anywhere inside the Putty window. Neat, eh?

  • Install Curl and package updates by typing (or copying & pasting into Putty) the following commands:

    sudo apt-get install curl
    sudo apt-get update
    sudo apt-get upgrade

Step 5: Install cgminer

Cgminer is the mining software we’ll be using. If the first command doesn’t work, you’ll need to check out the cgminer website and make a note of the current release version. Substitute that in the commands below.

Update: Cgminer 3.7.2 is the last version to support scrypt—do not use any version after that! In addition, depending on which version you choose to use, you may receive an error complaining about libudev.so.1 when you try to run cgminer—you can find the fix for that here.

  • Type the following:

    wget http://ck.kolivas.org/apps/cgminer/2.11/cgminer-2.11.4-x86_64-built.tar.bz2
    tar jxvf cgminer-2.11.4-x86_64-built.tar.bz2
  • If everything was uncompressed successfully, we can delete the downloaded archive; we don’t need it anymore:
    rm *.bz2
  • Now check if cgminer detects all of your GPUs properly:
    cd cgminer-2.11.4-x86_64-built
    export DISPLAY=:0
    export GPU_USE_SYNC_OBJECTS=1
    ./cgminer -n

Step 6: Create cgminer startup script

We’re almost done—now we just need to create a few simple scripts to control cgminer.

  • If you’re still in the cgminer directory from the previous step, first return to your home directory:
    cd ..
  • Type the following to create a new file with nano, a Linux text editor:
    sudo nano mine_litecoins.sh
  • Type the following into nano (note where the places you need to substitute your own usernames!) :
    #!/bin/sh
    export DISPLAY=:0
    export GPU_MAX_ALLOC_PERCENT=100
    export GPU_USE_SYNC_OBJECTS=1
    cd /home/YOUR_XUBUNTU_USERNAME/cgminer-2.11.4-x86_64-built
    ./cgminer --scrypt -I 19 --thread-concurrency 21712 -o stratum+tcp://coinotron.com:3334 -u USERNAME -p PASSWORD
  • Save the file and quit nano, then enter the following:
    sudo chmod +x mine_litecoins.sh

Note that the cgminer settings we’re using in our mine_litecoins.sh script correspond to a good starting point for Radeon 7950 series GPUs. If you followed our hardware guide, these settings will give you good hashrates. If you’re using another type of GPU, you’ll want to use Google to find optimal cgminer settings for it.

Also note that you’ll need to create an account at one of the litecoin mining pools, and plug your username and password into the script (the -u and -p parameters). I have Coinotron in there as an example, but there are quite a few to choose from.

Step 7: Create auto-start scripts

We want cgminer to automatically start mining whenever the rig is powered on. That way, we keep mining losses to a minimum whenever a power outage occurs, and we don’t have to worry about manually starting it back up in other situations.

  • Type the following to create a new script and open it in nano:
    sudo nano miner_launcher.sh
  • Enter the following text into the editor (substitute your Xubuntu username where shown!):
    #!/bin/bash
    DEFAULT_DELAY=0
    if [ "x$1" = "x" -o "x$1" = "xnone" ]; then
       DELAY=$DEFAULT_DELAY
    else
       DELAY=$1
    fi
    sleep $DELAY
    su YOUR_XUBUNTU_USERNAME -c "screen -dmS cgm /home/YOUR_XUBUNTU_USERNAME/mine_litecoins.sh"
  • Save and quit nano, and then type:
    sudo chmod +x miner_launcher.sh
  • Now we need to call our new script during startup; we do that by adding it to /etc/rc.local. Type the following to open /etc/rc.local in nano:
    sudo nano /etc/rc.local
  • Add the following text, right above the line that reads “exit 0” (substitute your own username!):
    /home/YOUR_XUBUNTU_USERNAME/miner_launcher.sh 30 &

Step 8: Create an alias to easily check on cgminer

We’re essentially done at this point, but you’ll probably want to manually SSH into your miner from time to time to manually check on your GPU temperatures & hashrates, etc. Creating an alias will make that easy.

  • Type:

    sudo nano .bashrc
  • Scroll to the end of the file, and then add this text above the line that reads “# enable programmable completion…”
    alias cgm='screen -x cgm'
  • Save and quit out of nano.

That’s it—you’re done! You’ll probably want to test everything now. The easiest way to do that is to close your Putty session and power down your miner. Turn it back on and the following should happen:

  1. Your miner should boot into Xubuntu. This may take about a minute, depending on the speed of your USB stick.
  2. 30 seconds after Xubuntu has loaded, cgminer will automatically start and begin mining. You’ll probably notice the fans on your GPUs spin up when this happens.
  3. You should be able to SSH into your miner at any time and type cgm to bring up the cgminer screen. To close the screen (and leave cgminer running), type control-A, then control-D.
  4. If you ever need to start cgminer manually (because you quit out of it, or kill it, etc), simply type ./miner_launcher.sh
cgminer running

If all went well, you should see something like this when checking cgminer via your “cgm” alias.

Congratulations—you have your own headless linux litecoin miner!

The next section of our guide covers setup under Windows, and then we take a look at optimizing cgminer settings for better performance.

You can leave a response, or trackback from your own site.

1,431 Responses to “Build your own Litecoin Mining Rig, part 2: Linux Setup”

  1. Unas says:

    Fantastic posts! Thank you.

  2. TimP says:

    This is the best linux mining guide I’ve seen. Easy enough for a complete noob like me to follow! 🙂

  3. That LTC says:

    Hello and thank you for this wonderful guide!

    This would be my first mining rig and first time ever using Linux so naturally I am absolutely terrified that I am going to mess up my $1400 investment. I was hoping you can clear some questions up for me:

    1) Do I need two USB sticks? One for the installation and one to act as Xubuntu hard drive? If so, do I leave them both plugged in during Xubuntu installation? I have two 16gb USB 2.0 sticks FWIW.

    2) When I get to the part of getting into Putty from my windows desktop..do I continue to enter only one line at a time or can I copy and paste the entire block of words you have listed?

    3) Also, at the part when I have to bring up “Nano” and enter

    •Save the file and quit nano, then enter the following: chmod +x mine_litecoins.sh

    Where do I save the nano file to? And where would I enter chmod +x mine_litecoins.sh? The terminal?

    4)This rig would be in my bedroom since space is limited, that being said, how loud is this rig? Can you estimate it for me please?

    Thanks!

    • CryptoBadger says:
      1. Yes, you’d need two USB sticks for the installation, or if you have a CD-drive laying around that you can temporarily hook up for the installation, you can use that instead. Just plug both sticks in, and when prompted during the install, select the blank stick (eg: the one that you’re not running the installation from) as the target for installation. When the installation is done, simply remove the stick with the installation media on it.
      2. You’ll have to copy one line at a time. The setup goes fairly quick once you get to that point, though.
      3. If you’ve followed the guide exactly and haven’t changed directories, you should just be able to hit enter when prompted for where you save your file, as you’re already in your home directory. You enter the chmod command when you’re back on the command line after exiting nano.
      4. Exactly how loud the rig is depends on which GPU you buy (I think the Sapphire Vapor-X cards are the quietest), but no matter which ones you get, don’t expect it to be “quiet”. =) Once you get the fans configured properly (see part 4 of this guide), the noise level should be at worst, tolerable. I have a rig in the same room as my TV, and I don’t really notice it when the TV is on. The fan noise in a bedroom is probably similar to what a white-noise generator would give you. Also remember that the rig will give off a fair amount of heat, which you may not want in your bedroom, depending where you live.
  4. Brian says:

    Hi,

    Thanks for all the info provided thus far. I’ve read all 4 parts.

    I have a few questions thus far:

    1) After I install linux and cgminer and follow all the steps (I use linuxmint at home, but am still a newbie with linux) is it super easy to enter the required info to join a pool?

    2) After I join a POOL and want to set up a FAILOVER pool to build in redundance to my systems mining efforts, is that supereasy also to setup?

    3) If will buy a 1200w powersupply, will linux (the mining system) know to use less watts via power regulation in the os or will it use 1200w? I’m considering a 1200w unit, due to wanting maybe to have 4 GPU vs. the 3 that you have in your examples.

    4) If someone is planning to use 12 GPU, should they have 3 or 4 independant systems or can it all be run via one motherboard?

    5) Is it better to be linked to my router via CAT network cable (wired cable) or is wi-fi just as good? If we use wi-fi how would one go about doing that with your current configuration? which wi-fi adapter would be ideal? or is it better not to use wifi?

    6) The linux you setup also has a gui? (since no screenshots were put up)

    Thanks in advance for answering my concerns and I really enjoy your site.

    Brian

    • CryptoBadger says:
      1. Yes, signing up at a mining pool takes about 30 seconds. I recommend http://www.give-me-ltc.com, just create an account there and then substitute your own worker name/pass in the appropriate places in my guide.
      2. Yup, setting up a failover is also easy. I actually cover that in part 4 of my guide (under “setup a failover/backup mining pool”).
      3. Yes, if you buy a larger PSU, your rig will only use as much as necessary. This may help you.
      4. With 12 GPUs, I’d probably build 3 systems with 4 GPUs each. It’s possible to build two system with 6 GPUs each, but you’d need to make sure that whichever motherboard you pick will recognize all 6 GPUs, and you’d probably need to use two power supplies per system. It starts to get complicated once you go beyond 4 GPUs in one system.
      5. If you can avoid wireless, I’d recommend it. If it’s unavoidable, then you can either add a wireless adapter to each rig (USB or PCI), or you can buy a DD-WRT capable router and set it up as a wireless bridge, and connect all of your rigs to it via CAT5 cable. I may do a guide on the latter at some point in the future. I have a couple rigs in my basement connected via a wireless bridge, and they get effective hashrates that are about 1-2% slower than the ones I have wired directly to my primary router.
      6. Yes, Xubuntu does have a GUI. I would have preferred to use a GUI-less distro such as Ubuntu server, but unfortunately the Catalyst drivers won’t work without a GUI present.
  5. michael says:

    Hi,

    I am having some trouble installing xubuntu 12.10

    i am using 2 usb..

    1 2.0 usb (with xubuntu 12.10 installer)
    and
    1 3.0 usb (blank) I am trying to install xubuntu 12.10 on this stick.

    why does it take forever to install or actually it gets stuck!

    I waited like 2hours on it and it is still in the same process/bar…

    what am I doing wrong here?

    • CryptoBadger says:

      It’s hard to say what the issue is without more information, but the installation definitely shouldn’t take more than 15 minutes. Make sure that you’re trying to install to the blank stick, and not the stick with the installer on it by mistake. Also try putting the USB 3.0 stick into a 2.0 port, just to be sure that there aren’t any hardware/driver issues at play.

      If you don’t have any luck installing from USB, and you have a CD drive that you can hook up temporarily, try installing from a CD.

      • Suleman says:

        Thanks so much for this awesome guide. Very informative. I have ordered the parts to put two rigs together.
        There is one thing Im not sure about and hope someone can assist me.
        I want to run these rigs on Linux following your setup guide. But the thing i don’t understand is how to setup the wallet and how to get the coins in my wallet. I am going to be pool mining. My rigs will be dedicated mining rigs. I have my own personal computer from where i will be monitoring my rigs from. Can i install the wallet on my PC or does each rig have its own wallet. Sorry if this sounds silly.. Im new to mining and hope someone can help. Thanks…

        • CryptoBadger says:

          Not a silly question at all! I’m planning to put a guide up on this topic in the near future.

          You can get the wallet client from litecoin.org. Install it on your desktop computer; your miners don’t need it. The client will automatically download the blockchain on your first startup, which will take awhile. When it’s done, you can generate yourself as many wallet addresses as you want.

          When you sign up for mining pools, you’ll enter one of your wallet addresses as your cashout address to receive litecoins to.

          Just be careful about keeping your wallet file secure. Encrypt it using the client, and back it up to offline storage regularly (I like to keep mine on a couple of USB sticks in different locations).

          I’ll have a full guide up on the topic in a week or two, but that should get you started. =)

          • Suleman says:

            Thanks so much for answering my question. It makes sense now. Look forward to reading your guide when you post it. Thanks again (:

      • Tom says:

        Thanks for all your effort. I’m following your hardware recipe but it’s killing me. Burning a disk now. I think my ASRock version BIOS has some curveballs. I’m not a linux newb. This is not going as easy as I thought it would. I’ve installed USB before….

        • CryptoBadger says:

          I did all of my installs from a disc (I have a spare SATA DVD drive that I keep laying around for stuff like this), so while I know some people have had success doing a USB -> USB install, I can’t comment on it myself. CD -> USB was a breeze, though. Hopefully you find it trouble-free as well.

        • Tom says:

          OK. It’s biting on the CD. Linux and I are talking again 🙂 Sorry. Should’ve waited to post. If you’re having frustrations go the CD route. Errors from the motherboard have ceased and it is loading.

  6. dom says:

    After the reboot in step 3 my monitor no longer displays anything once it gets past the bios. I have it hooked up to the mobo and have the internal graphics card set up as primary. I have also hooked it up to the radeon on the pcie16x slot and there the xubuntu start up screen shows up for 2 seconds or less than the monitor loses connection.

    Im using a gigabyte z77x-d3h mobo

    I tried using mint and had the same issue

    Any idea whats going on?

    • CryptoBadger says:

      I haven’t tried doing a build with a motherboard that has onboard graphics. Your non-onboard GPU is a 7950 (or 7xxx series)? If so, I don’t see why there should be any issue. Try going into your BIOS and disabling onboard graphics completely, and then booting up with your monitor plugged into your 7xxx series GPU.

      • dom says:

        sorry i forgot to mention the video cards are radeon 6950’s not the 7950’s. The cpu I am using is an intel chipset. (i found your site after ordering all this, and was going to use win7 initially)

        i’m going to try to reinstall with the internal gpu disabled. hopefully that will work.

  7. Tonight We Feast says:

    I am running two sapphire 7950’s using cgminer but both cards get about 260MH/s. If I only run one card, it will get about 540MH/s.

    What do I need to do to get both cards running at 540MH/s?

    Thanks,

    TWF

    • CryptoBadger says:

      Did you use the guide I posted here to set everything up? What does the rest of your hardware look like?

      It sounds like one GPU is sitting idle while the other does all of the work when you try to run both at the same time. Press “G” while cgminer is running and check the activity next to each GPU (the number next to the “A”). Both should be around 99% if everything is working properly. If one is zero, then it isn’t being utilized, and that’s your problem. Do you have something connected to both GPUs (either a dummy plug or an actual monitor)? If not, you’ll need to connect something to both, reboot, reinitialize the Catalyst drivers (type “sudo aticonfig –adapter=all –initial” without the quotes), reboot again, and hopefully your issue is fixed.

      If not, try heading over to the bitcointalk.org forums. If you post a screenshot of cgminer and your hardware configuration. Odds are somebody has a setup similar to yours that can help.

  8. michael says:

    I am on this part:

    Now check if cgminer detects all of your GPUs properly:

    cd cgminer-2.11.4-x86_64-built
    export DISPLAY=:0
    export GPU_USE_SYNC_OBJECTS=1
    ./cgminer -n

    when I do: ./cgminer -n

    I get this error:

    :~/cgminer-2.11.4-x86_64-built$ ./cgminer -n
    ./cgminer: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory

  9. DamDam says:

    Trying to test linux for Mining but i hate linux for this : problems, problems and again problems. You can’t have a “normal” installation without a problems…

    I lost 4 hours to trying to fix the ATI driver because if you don’t install package via terminal (for example via amd site) installation is not complete and you broke all your Xorg at the reboot and you’re good to reinstall all because doesn’t let you start….

    Now it’s work, but Cgminer doesn’t want to execute because once a have : “libudev.so.0 error” and once the same with libjansson.so.4. Trying to install library but it still not working. Sorry, next rig on Windows.

    It’s too bad because I like the graphical and GUI of the new Xubuntu.

  10. Fungraphic says:

    I tested this tutorial, it works great with cgminer-2.11.4-x86_64-built.
    But it does not work with cgminer-3.1.0-x86_64-built.
    Because there libjansson.so.4 found a mistake.

    • CryptoBadger says:

      Thanks for the feedback. I haven’t tested the latest version of cgminer yet as it seemed like it was mostly an update to accommodate ASICs. I’ll make a note in the guide.

  11. Fungraphic says:

    Thanks CryptoBadger 😉

  12. BTC says:

    Hello Again,

    I am having this problem:

    miner1@miner1-box1:~$ cgm
    There is no screen to be attached matching cgm.
    miner1@miner1-box1:~$

    also.. I do not think the miner_launcher.sh is working at startup…

    thus the reason no screen on cgm?

    when I tried running ./miner_launcher.sh it asks for a password…

    ===============================================================
    miner1@miner1-box1:~/cgminer-2.11.4-x86_64-built$ ls
    API.class ChangeLog miner.php
    api-example.c COPYING NEWS
    api-example.php diablo130302.cl phatk121016.cl
    API.java diakgcn121016.cl poclbm130302.cl
    API-README example.conf README
    AUTHORS FPGA-README scrypt130302Caymanglg2tc1984w256l8.bin
    bitstreams linux-usb-cgminer scrypt130302Caymanglg2tc8128w256l8.bin
    cgminer mine_litecoins.sh scrypt130302.cl
    cgminer-fpgaonly miner_launcher.sh SCRYPT-README
    miner1@miner1-box1:~/cgminer-2.11.4-x86_64-built$ ./miner_launcher.sh
    Password:
    ===============================================================

    but when I do:

    ./mine_litecoins.sh

    cgminer starts and working….

  13. BTC says:

    CTRL A and CTRL D worked at first try…
    ========================================================
    You should be able to SSH into your miner at any time and type cgm to bring up the cgminer screen. To close the screen (and leave cgminer running), type control-A, then control-D.
    ========================================================

    but now it does not work anymore… 🙁
    how do I close the putty without shutting down cgminer?

    • CryptoBadger says:

      You can just close Putty at any point without killing cgminer. The only way to stop cgminer is by pressing “q” or ctrl-x while it’s running (or by forcibly killing it’s process with the kill command).

      If you’re stuck on the cgminer screen and ctrl-A, ctrl-D isn’t working, you’re probably buried somewhere else in the screen menu. Just go ahead and close Putty; cgminer will continue running on your miner. You can verify by opening a new Putty session and checking.

      • BTC says:

        Hi again,

        can you answer my other question please? about starting cgminer on boot? it asks for a password… and i don’t think cgminer starts on os boot…

        also… I got 2 hd 6950… that is only mining avg. 225kh/s

        but I thought hd 6950 can do 300kh/s (EACH)…

        lastly…

        if I close my putty now… how do I check if cgminer is still running? I know about ps x… but i am talking about the cgminer screen? where it shows the speed/gpu/etc?

        I have this cgminer settings:

        ./cgminer –scrypt -o stratum+tcp://us.wemineltc.com:80 -u myusername -p mypassword -I 13

        I went and tried these settings:
        https://bitcointalk.org/index.php?topic=117221.0

        but cgminer won’t start or work… and I only get HW errors….

        anyway… I am almost there… when I get this working all the way… I will let this rig mine for 24hours and send the LTC to your address…

        🙂

        • CryptoBadger says:

          Check your miner_launcher.sh script and make sure that it exactly matches the one in step 7 of the guide. Note that you need to put your Xubuntu username (the same one you chose during the Xubuntu installation) on the last line of the script in two places (without the brackets, and make sure case/spelling is correct). If that looks good, check your /etc/rc.local script and make sure that your Xubuntu username is correct there as well. You shouldn’t be prompted for a password if the scripts are using the same Xubuntu user that you’re using for auto-login (which was setup during installation with the username you created there).

          You’ll only be able to check on cgminer after you have a screen session set up. That happens in miner_launcher.sh automatically on boot up, but it sounds like your script has an error (or errors) in it. You can see how it should work by running screen manually like this from your home directory (make sure cgminer is not already running first!): screen -dmS cgm mine_litecoins.sh . Cgminer will start up in a saved screen session that you can access any time by typing screen -x cgm (or simply cgm if you set the alias from step 8 up).

          I’ve never tried mining on a 6950. You’ll probably have to play around with the cgminer settings a bit to find ones that give you a good hashrate.

          • BTC says:

            I also tried you’re advice:

            and looks like it is still not working…

            login as: miner1
            [email protected]‘s password:
            Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-17-generic x86_64)

            * Documentation: https://help.ubuntu.com/

            7 packages can be updated.
            6 updates are security updates.

            New release ‘13.04’ available.
            Run ‘do-release-upgrade’ to upgrade to it.

            Last login: Mon Apr 29 21:35:05 2013 from 192.168.1.7
            miner1@miner1-box1:~$ cgm
            There is no screen to be attached matching cgm.
            miner1@miner1-box1:~$ screen -dmS cgm mine_litecoins.sh
            miner1@miner1-box1:~$ screen -x cgm
            There is no screen to be attached matching cgm.
            miner1@miner1-box1:~$

          • CryptoBadger says:

            Sorry, it should be screen -dmS cgm ./mine_litecoins.sh (assuming you’re in your home directory). Or you can use the full path to mine_litecoins.sh, as given in the guide.

            If it’s still not working, please go back through every step and make sure that everything is entered properly. If you’ve made any typos anywhere, stuff isn’t going to work.

  14. Fungraphic says:

    Hi,
    Do you have news for version 3.1.0?

  15. Fungraphic says:

    J’ai recompilé la version 3.1.0 et ça fonctionne super

  16. Tom says:

    Hi and thanks for the work. Where does one add a worker?
    I went with coinotron as the pool.

    [2013-04-30 17:29:46] Started cgminer 2.11.4

    [2013-04-30 17:29:46] Started cgminer 2.11.4
    [2013-04-30 17:29:46] Probing for an alive pool
    [2013-04-30 17:29:49] pool 0 JSON stratum auth failed: [
    25,
    “Not subscribed”
    ]

    Thanks

    • CryptoBadger says:

      You create your worker(s) on coinotron.com (or whatever pool you choose). Your worker username & password is what goes after the -u and -p in your cgminer startup script.

  17. Gus says:

    What is the best way to update the Catalyst drivers. They have 13.4 out now and 13.5c or so on the beta. I updated my Windows machine and picked up a few Kh/s. It would be nice to update the Linux box also.

    Thanks!

    • CryptoBadger says:

      You can remove the fglrx drivers by running:
      sudo apt-get –purge remove fglrx*

      To get the latest drivers at that point, just re-do step 3 in the guide.

      Make sure that cgminer isn’t running when you do this, and also make sure to do it locally from the terminal (installing video drivers via SSH can cause issues).

  18. Gus says:

    I have another question for you. Having used dd to clone the USB to another USB I would like to change the username, login, directory, etc. Say from Computer-1 to Computer-2. Is there an easy way to do that? When using SSH it is to easy to login to the wrong computer with the names and logins the same.

    • CryptoBadger says:

      You can change the computer name by running these two commands:

      sudo nano /etc/hostname
      sudo nano /etc/hosts

      In nano, just change the existing computer name to whatever new name you want in both. You’ll need to reboot for it to take effect.

      As for changing usernames, I haven’t tried that myself, but here is some info.

  19. Dan says:

    Very important you need the ADL and SDK installed for the graphics card,for cgminer to work. The order that you install these is also important.

  20. M2 mike says:

    Thanks for the awesome guide, I have a few questions if you don’t mind helping.

    1) I found this while doing research on bamt, which apparently is not supported.. I found out after I ordered all the parts for a rig. That being said I am hoping the only change to mine btc is to point cgminer at a btc pool?

    2) can I create the Linux USB installation using my Mac or PC, or is it required on the rig as it auto detects hardware for driver installation?

    3) I am hoping that 7970s are ok with this driver set?

    Thanks a ton,
    Mike

    • CryptoBadger says:
      1. Yup, pretty much – you’ll just need to remove the –scrypt option from the cgminer startup script and point it at a btc pool.
      2. Yes, you can create the linux installation media on any desktop PC.
      3. The drivers in the guide are for any 7xxx series, so a 7970 should work fine. You’ll probably have to tweak cgminer settings a bit to get the best performance, though – I show optimized settings for a 7950.
  21. M2 Mike says:

    Hi Crypto,

    I followed your guide and a couple parts from others.. couple things I am having issues with

    1) Just as an FYI CGminer the main site is down.. had to get the bits elsewhere..

    2) I am having issues with the script that miner_launch.sh its giving me an error that sleep: missing operand, then it prompts me for a password..

    I did not cut and paste your worked from putty typed it on the miner itself

    3) Lastly do you have any guides or ideas on cgminer settings for 7970 I am getting 560mh instead of closer to 700 I took this guys settings

    ./cgminer -o http://pool:port -u username -p password –api-listen –api-network -I 9 –gpu-reorder –auto-fan –gpu-powertune 20 –gpu-engine 920,920,920,1125 –gpu-memclock 795,795,795,975

    from this page http://rdmsnippets.com/2013/03/20/bitcoin-mining-with-ubuntu-12-04-tls-and-cgminer/

    Thanks a ton btw your guide has been absilutly awesome plan to karma ya soon as I can lol

    • CryptoBadger says:

      If you’re getting script errors, try going back and copying & pasting the script from the guide, exactly as posted (other than changing your username). You’ve probably made a typo somewhere.

      I don’t have any 7970s, but your hashrates are definitely lower than they should be. Do you have 4 GPUs on one computer? The script settings you’ve posted indicate that you’re trying to pass in clock settings for 4 cards. Those clock speeds seem really really low, too – you’d be underclocking the card pretty far. You’re also running at intensity 9, which is very low. You don’t need the two api switches you have unless you have another process enabled that is reading cgminer’s output. And you’re missing a –thread-concurrency switch, which can make a big difference in performance, although I’m not sure what the optimal value to pass in for a 7970 is. Check the bitcointalk.org forums; I’m sure somebody has posted their 7970 settings.

      And yes, the .bashrc file should definitely already exist. Make sure you’re looking in your home directory for it. Try this:

      sudo nano /home/[YOUR XUBUNTU USERNAME]/.bashrc

  22. M2 Mike says:

    oh and the .bashrc edit for the alias offered to create a new file for me? lol I thought I had to have that to have a shell.. a lot rusty at nix..

  23. M2 Mike says:

    Crap it cut of my last post.. sigh

    I am having issues with the Auto Starting part of the file, it tells me sleep is missing an operator.. I typed your script did not cut and paste it.. on the rig it self.. I could not tell if it was a formatting issue or something else.. I checked for spelling not sure what I did wrong..

    I ended up using some different configs from several posts, and am averaging about 1.33 ghz on 2 7970’s I has hoping for over 1.4 but I am not sure I can get it there..

    If I can’t get the auto start script working if I start it in a ssh session will it keep running if I drop the session.. I would love to move this heater off my desk and into my garage lol..

  24. M2 Mike says:

    Sigh now I see my original post show up ugh the interweb is not kind today….

  25. andy says:

    I too am having issue with creating the bashrc alias – it also creates a new file for me too… nothing to edit.

    i get all the way to the end bar the bashrc alias bit, and have no idea how to start it mining – ive tried restarting the machine and nothing happens, both 9750s show up in the diags : (

    • CryptoBadger says:

      If you’re created all of your scripts properly, cgminer will start automatically on reboot. You can also launch cgminer manually by running ./miner_launcher.sh (which will set up a screen session so that you can check on cgminer whenever you want later – this is what gets called at startup) or ./mine_litecoins.sh (which does not set up a screen session) from your home directory.

      .bashrc should be in your home directory (sudo nano /home/[YOUR XUBUNTU USERNAME]/.bashrc). Are you using Xubuntu or a different distro?

      • ACLMY says:

        Hi CryptoBadger,

        Great tutorial! Just in relation to Section 5: Install CGMiner, http://ck.kolivas.org/apps/cgminer/, when you goto his README (which as a long-time *nix user I do), there is a section on dependencies that need to be be met.

        BUILDING CGMINER

        Dependencies:

        curl dev library
        curses dev library
        pkg-config
        libtool
        AMD APP SDK
        AMD ADL SDK

        The first four are all available through the Ubuntu repositories using apt-get, the last two direct download from AMD.

        Is this a real requirement to be met before configuring CGMiner? If so, would a link in your tutorial be of value to other potential miners.

        Keep up the great work.

        • CryptoBadger says:

          Those dependencies are only if you want to compile your own build from source code. If you follow the guide, all of the dependencies that you need to actually run cgminer should be in place by the time you get around to running it.

Leave a Reply