Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

[Noob-Proof] How to Install Sgminer, AMD Drivers, and GPU Mine Darkcoin under Linux/Ubuntu 64-bit

Discussion in 'Mining Guides' started by GreenRaccoon23, Jul 16, 2014.

  1. GreenRaccoon23

    GreenRaccoon23 New Member

    Joined:
    Jul 7, 2014
    Messages:
    26
    Likes Received:
    13
    Trophy Points:
    3
    ***This guide shows how to set up sgminer (GPU miner) on 64-bit Linux when your computer has an AMD/ATI GPU or APU.*** This is targeted for Ubuntu, Xubuntu, etc. users. I can't get it to work for Linux Mint or Arch Linux. I figured out how to run sgminer on Linux Mint and Arch Linux. See the *NOTE* after step 26.

    I've spent a ridiculous amount of time trying to figure all of this out, so I've made this guide ridiculously *DETAILED* to prevent any more headaches. This guide looks daunting :eek:, but it's just because I tried to cover every single base I could think of. Even if you're a Linux noob, you should be able to do this fine. :D
    • Note: This won't work for every AMD GPU, but it should work for the most common ones used for mining (as of the time this thread was posted). Your computer probably won't turn into a nuclear bomb if something goes wrong, but BACK UP beforehand just in case. Be on the safe side so it's not the end of the world if something odd happens and you have to reinstall Ubuntu. :eek: (I had to reinstall Ubuntu 3 times trying to figure all this out, hence the reason why I'm making this guide.)
    ----------------------------------------------------------------------------------------------------
    *****UPDATE*****
    I've written some scripts for you guys. :D If you'd rather run some scripts than copy and paste every single step below, you have the option to do that now. :D
    13 Nov-14: Updated the scripts. Only a couple minor changes, but I also made a sweet ascii image. :cool:
    Here's how to copy and run them:

    1- Run this as one, single command (to download the right scripts for your distribution):
    Code:
    cd ~ &&
    wget "https://raw.githubusercontent.com/GreenRaccoon23/sgminer-install-scripts/master/INSTALL" &&
    chmod +x INSTALL &&
    ./INSTALL
    2- Run the first script:
    Code:
    ./sgminer1.in
    If you're running Arch Linux, you'll need to run './arch-sgminer1.in' instead.
    3- The script will tell you when to run the next ones.

    ----------------------------------------------------------------------------------------------------
    Second Option: Step-by-Step Instructions
    1
    - Update your computer and install dependencies. Open up Terminal with ctrl+alt+t. Then copy (ctrl+c) and paste (ctrl+SHIFT+v) this:
    Code:
    sudo aptitude update
    sudo aptitude upgrade -y
    sudo aptitude install -yr git curl unzip automake autogen yasm autoconf dh-autoreconf build-essential pkg-config openssh-server screen libtool libcurl4-openssl-dev libtool libncurses5-dev libudev-dev xserver-xorg-core xserver-xorg-video-ati gdebi gedit execstack dh-modaliases lib32gcc1 dkms
    Set Up AMD Drivers
    2- Check which driver you're using. Open up Terminal with ctrl+alt+t and type this in:
    Code:
    fglrxinfo
    3- If that command wasn't found, skip to step 6 because you're not using an fglrx driver. :) If that command did give you something, that's ok, but it means you need to do more work, sorry. :sad: You're going to need to switch drivers. Run this command.
    Code:
    sudo sh /usr/share/ati/fglrx-uninstall.sh
    4- If that worked, great. If it didn't, it should be ok too. In either case, do this next.
    Code:
    sudo aptitude purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev* xorg-driver-fglrx &&
    sudo aptitude reinstall -y libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core &&
    sudo dpkg-reconfigure xserver-xorg
    5- Reboot. (If you can't login to your computer after rebooting, post 3 of this thread might help.)
    6- Download the AMD 14.6 Catalyst driver:
    Code:
    cd ~/Downloads
    curl -o driver.zip http://www2.ati.com/drivers/linux/amd-catalyst-14-9-linux-x86-x86-64.zip --referer http://support.amd.com/en-us/kb-articles/Pages/Catalyst-Linux-Installer-
    
    7- Install the Catalyst driver. (Don't change the *'s.)
    Code:
    unzip driver.zip
    cd fglrx-14.20
    chmod a+x *.run
    sudo sh *.run
    8- The installation application will now launch. Soon, a a screen should pop up with the two options 'Install Driver 14.20...'' or 'Generate Distribution Specific Driver Package'.
    • If an error screen pops up instead, use this command to open up the log
      Code:
      sudo gedit /usr/share/ati/fglrx-install.log
    • Then install the packages it tells you that it needs:
      Code:
      sudo apt-get install ...
    • Then run:
      Code:
      sudo sh ~/Downloads/fglr*/*.run
    9- Once you can get the application open to the screen with the two options 'Install Driver 14.20...'' or 'Generate Distribution Specific Driver Package', follow these steps:
    • First, choose 'Generate Distribution Specific Driver Package' and click 'Continue'.
    • Next, choose 'I agree' (if you agree).
    • Next, scroll down and choose 'Build package for detected OS: Ubuntu/trusty', then click 'Continue'.
    • Next, it'll look like it has crashed. It actually IS running; it just takes forever. Seriously, forever--like up to 15 minutes.
    • Once it's FINALLY done, click 'Exit' to close.
    • ***IMPORTANT!*** Next, something will pop up. DO NOT CHOOSE 'YES.' CHOOSE 'NO'. (If you accidentally hit 'yes', it shouldn't be a big deal though. Just keep going.)
    10- Then, install the new packages:
    Code:
    sudo gdebi *.deb
    11- BEFORE you reboot, run these commands.
    Code:
    sudo aptitude update
    sudo aptitude upgrade -y
    sudo aticonfig --adapter=all --initial
    sudo aptitude install -yr boinc-amd-opencl opencl-headers mesa-utils libglu1-mesa libgl1-mesa-glx libgl1-mesa-dri
    12- Reboot.
    13-
    Now install the APP SDK:
    Code:
    cd /tmp
    curl -o amd-app-sdk.tgz http://blog.truepps.com/downloads/AMD/AMD-APP-SDK-v2.9-lnx64.tgz
    sudo mkdir amd-app-sdk
    sudo mv amd-app-sdk.tgz amd-app-sdk
    cd amd-app-sdk
    sudo tar -zxvf amd-app-sdk.tgz
    sudo tar -zxvf AMD-APP-SDK-v2.9-RC-lnx64.tgz
    cd AMD-APP-SDK-v2.9-RC-lnx64
    sudo cp -pv lib/x86_64/* /usr/lib/
    sudo rsync -avl include/CL/ /usr/include/CL/
    cd ..
    sudo tar -zxvf icd-registration.tgz
    sudo rsync -avl etc/OpenCL/ /etc/OpenCL/
    sudo ldconfig
    sudo perl default-install_lnx_64.pl
    sudo aticonfig --adapter=all --initial
    14- Reboot.
    Install Sgminer
    15- The hard part's over (yay!). Copy/git sgminer's files to your computer:
    Code:
    cd ~/
    git clone https://github.com/sgminer-dev/sgminer.git
    16- Sgminer needs three files from the AMD ADL SDK:
    Code:
    cd ~/Downloads
    curl -o adl_sdk.zip http://blog.truepps.com/downloads/AMD/ADL_SDK_6.0.zip
    mkdir adl_sdk
    mv adl_sdk.zip adl_sdk
    cd adl_sdk
    unzip adl_sdk.zip
    cp ~/Downloads/adl_sdk/include/* ~/sgminer/ADL_SDK
    17- Compile, make, and install it.
    Code:
    cd ~/sgminer
    git submodule init
    git submodule update
    autoreconf -i
    CFLAGS="-O2 -Wall -march=native" ./configure
    make
    sudo make install
    18- Check to make sure it worked
    Code:
    sgminer -n
    19- If it does detect your GPU('s), continue to step 22. If it does not detect your GPU('s) run "sudo aticonfig --adapter=all --initial" and then reboot.
     
    #1 GreenRaccoon23, Jul 16, 2014
    Last edited by a moderator: Nov 29, 2014
    • Like Like x 3
  2. GreenRaccoon23

    GreenRaccoon23 New Member

    Joined:
    Jul 7, 2014
    Messages:
    26
    Likes Received:
    13
    Trophy Points:
    3
    Configuring Sgminer
    20- Now make a script that you'll use whenever you want to launch sgminer. This script saves your mining preferences. It's pretty handy.
    Code:
    cd ~
    gedit darkgpu
    21- An empty file should pop up. Copy and paste this in there:
    Code:
    #!/bin/bash
    cd ~/sgminer
    export DISPLAY=:0
    export GPU_MAX_ALLOC_PERCENT=100
    export GPU_USE_SYNC_OBJECTS=1
    ./sgminer -k x11mod -o # -u # -p # --no-submit-stale -I # 
    22- Now you can fill in your sgminer configuration. *Always keep the first 5 lines the same,* but you'll want to replace the "#" signs with something else. If you have no idea what to put for "#", keep reading. If you know what to put, then skip to step 25.

    [*]"-o" stands for your pool's address and port. "stratum+tcp://address.com:####" Find that on your pool's website (usually under "Help" and then "Getting started"). This is what mine is:
    Code:
    ./sgminer -k x11mod -o stratum+tcp://darkcoin.stonedpuppy.com:9902

    [/LIST]
    • "-u" stands for your personal username that you use on your pool's website. BUT "-u" also includes a worker name that you have to create on your pool's website. On your pool's website, you can have ONE username but MANY different workers. Think of it this way. The "username" represents "you" and the "workers" are the "slaves" that work for you. :eek: Your username identifies you, and each worker represents each computer that's mining for you. You create a name for each one of your workers on your pool's website. This is what it looks like when you type it after "-u": "username.worker". So if the username on my pool is "GreenRaccoon23," and I created a worker on there named "chucknorris," it would look like this:
      Code:
      ./sgminer -k x11mod -o stratum+tcp://darkcoin.stonedpuppy.com:9902 -u GreenRaccoon23.chucknorris
    • "-p" stands for your password: your WORKER'S password, NOT your username's password. You set this up on your pool's website. So if the password for my worker "chucknorris" is "knowsvictoriassecret," this is what it would look like:
      Code:
      ./sgminer -k x11mod -o stratum+tcp://darkcoin.stonedpuppy.com:9902 -u GreenRaccoon23.chucknorris -p knowsvictoriassecret
    • "-I" stands for "intensity," and you type it as a number. 18 is probably a good starting point. If you make it too high, sgminer will just whine that something's not right. For my Radeon HD7970, mine's set to 25. Start out low and work your way up one number at a time until sgminer starts to whine. Here's our final result of a basic config:
      Code:
      sudo ./sgminer -k x11mod -o stratum+tcp://darkcoin.stonedpuppy.com:9902 -u GreenRaccoon23.chucknorris -p knowsvictoriassecret -I 25
    • To give you some reference, here's my own darkgpu file for my Radeon HD7970 (except the personal stuff, of course). I run sgminer (GPU miner) and minerd (CPU miner) at the same time, and this is as fast as I can make sgminer run without my computer crashing:
      Code:
      #!/bin/bash
      cd ~/sgminer
      [COLOR=#141414]export DISPLAY=:0
      export GPU_MAX_ALLOC_PERCENT=100
      export GPU_USE_SYNC_OBJECTS=1
      ./sgminer -k x11mod -o stratum+tcp://darkcoin.stonedpuppy.com:9902 -u GreenRaccoon23.chucknorris -p knowsvictoriassecret --no-submit-stale --auto-fan --auto-gpu --gpu-fan 25-75 --gpu-memclock 850 --thread-concurrency 8192 -I 23[/COLOR]
    23- Save.
    24- Make the script executable.
    Code:
    chmod +x darkgpu
    Run Sgminer
    25- Running sgminer is easy once you make that "darkgpu" script explained above. Just go to your home directory (the default) and run the script:
    Code:
    cd ~
    ./darkgpu
    26- IT IS ALIVE. When you want to stop it, press "q" or "ctrl+c". To run it again, redo step 25. To change sgminer's settings, go through steps 20-23 again.


    *NOTE:* If you ever have a problem running the darkgpu script (where it starts and then stops right away), it means that sgminer has already saved your settings. Instead of running "./darkgpu", run "sgminer -k x11mod -I 23". Replace "23" with whatever number you'd like for intensity.

    Sources:
    https://forums.chunkypools.com/t/guide-compiling-sgminer-for-x11-coins-in-ubuntu/28
    https://help.ubuntu.com/community/BinaryDriverHowto/AMD
    https://github.com/djm34/sph-sgminer_x11mod
    https://bitcointalk.org/index.php?topic=658411.0

    http://ubuntuforums.org/showthread.php?t=2234408
    http://www.distrogeeks.com/install-cgminer-3-7-2-ubuntu/
    https://wiki.archlinux.org/index.php/AMD_Catalyst
    http://darkcoin.stonedpuppy.com/index.php?page=gettingstarted (site has been taken down)

    (If you want to install cpuminer for CPU mining also, I have another guide: https://darkcointalk.org/threads/noob-proof-how-to-install-cpuminer-under-ubuntu-linux.2168/)[/B]
     
    #2 GreenRaccoon23, Jul 18, 2014
    Last edited by a moderator: Dec 4, 2014
    • Like Like x 2
  3. GreenRaccoon23

    GreenRaccoon23 New Member

    Joined:
    Jul 7, 2014
    Messages:
    26
    Likes Received:
    13
    Trophy Points:
    3
    If you got stuck on step 5 (like if all you see is a blank screen), this might help you login.
    Press ctrl+alt+f1 to get to the Terminal, aka "black screen of death" (jk ;)). Type in your username (the name of your Home folder) and then your password. Then type this in:
    Code:
    sudo amdconfig --adapter=all --initial
    sudo service lightdm stop
    rm ~/.config/dconf/user
    sudo reboot
    If you STILL see just a blank screen, don't worry! It's ok! :) Press ctrl+alt+f1 to get to the Terminal. Type in your username and then type in your password. Now just go back up to step 6 under post 1 of this thread and continue the guide. Once you install the AMD driver, you SHOULD be able to login normally again. :)
     
    #3 GreenRaccoon23, Jul 18, 2014
    Last edited by a moderator: Sep 8, 2014
    • Like Like x 1
  4. Skycoin

    Skycoin New Member

    Joined:
    Jul 11, 2014
    Messages:
    10
    Likes Received:
    2
    Trophy Points:
    3
    Thanks a lot!
     
    • Like Like x 1
  5. MaxFangX

    MaxFangX Active Member
    Foundation Member

    Joined:
    Jun 30, 2014
    Messages:
    26
    Likes Received:
    10
    Trophy Points:
    103
    Just curious - why didn't you use BAMT?
     
  6. GreenRaccoon23

    GreenRaccoon23 New Member

    Joined:
    Jul 7, 2014
    Messages:
    26
    Likes Received:
    13
    Trophy Points:
    3
    I actually didn't know about BAMT beforehand haha. But I use Linux anyway so having sgminer right on my hard drive is nice. Do you know if BAMT has any performance benefits or anything?
     
  7. MaxFangX

    MaxFangX Active Member
    Foundation Member

    Joined:
    Jun 30, 2014
    Messages:
    26
    Likes Received:
    10
    Trophy Points:
    103
    BAMT has a whole bunch of pre-built tools and monitoring adds for specialized mining rigs, but I'm not aware of any performance benefits specifically. I'd say the main benefit is allowing you to run your OS off a flash drive, thus cost-cutting and reducing ROI time
     
    • Like Like x 1
  8. GreenRaccoon23

    GreenRaccoon23 New Member

    Joined:
    Jul 7, 2014
    Messages:
    26
    Likes Received:
    13
    Trophy Points:
    3
    Awesome! I might check it out.
     
  9. tuppydog

    tuppydog Member

    Joined:
    Dec 30, 2014
    Messages:
    251
    Likes Received:
    72
    Trophy Points:
    88
    Dash Address:
    XhyHv1cs4T54kD1HXVY7kYZMqo2Kg8hWu4
    This was the tutorial that worked for me (being a noob). I noted when you add cards later on, it screws up, but if you do a complete install and get to step #12, put the extra card(s) in and suddenly Sgminer will recongnize them. It took me hours of doing this, I wish I knew code. I tried sgminer on windows 7 64, I never could get anything to work and tried many versions, and I watched countless tutorials could never get it to work.... thanks again Green, great stuff...!!!!!
     
  10. tungfa

    tungfa Administrator
    Dash Core Team Foundation Member Masternode Owner/Operator Moderator

    Joined:
    Apr 9, 2014
    Messages:
    8,068
    Likes Received:
    6,291
    Trophy Points:
    1,283
    Can you please start working on "rebranding" the guide ?!
    that would be great and super appreciated
    Tx
     

Share This Page