Bitcoin Forum
May 14, 2024, 06:55:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to Install Sgminer, AMD Drivers, and Mine Darkcoin under Linux/Ubuntu 64-bit  (Read 5611 times)
GreenRaccoon23 (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
July 19, 2014, 05:36:08 PM
Last edit: December 04, 2014, 05:49:54 PM by GreenRaccoon23
 #1

***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  Shocked, 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.
  • 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 Ubunt:o Shocked (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. Grin If you'd rather run some scripts than copy and paste every single step below, you have the option to do that now. Grin
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.  Smiley If that command did give you something, that's ok, but it means you need to do more work, sorry.  Cry 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.
    Every time a block is mined, a certain amount of BTC (called the subsidy) is created out of thin air and given to the miner. The subsidy halves every four years and will reach 0 in about 130 years.
    Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
    1715669711
    Hero Member
    *
    Offline Offline

    Posts: 1715669711

    View Profile Personal Message (Offline)

    Ignore
    1715669711
    Reply with quote  #2

    1715669711
    Report to moderator
    GreenRaccoon23 (OP)
    Newbie
    *
    Offline Offline

    Activity: 10
    Merit: 0


    View Profile
    July 19, 2014, 05:47:54 PM
    Last edit: December 04, 2014, 06:46:34 PM by GreenRaccoon23
     #2

    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

    • "-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
    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

    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]
    GreenRaccoon23 (OP)
    Newbie
    *
    Offline Offline

    Activity: 10
    Merit: 0


    View Profile
    July 19, 2014, 05:55:07 PM
    Last edit: December 04, 2014, 05:51:22 PM by GreenRaccoon23
     #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  Wink). 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!  Smiley 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. Smiley
    thiec
    Hero Member
    *****
    Offline Offline

    Activity: 854
    Merit: 502



    View Profile
    July 26, 2014, 05:57:27 AM
     #4

    Thanks for the guide. i will try it

    GreenRaccoon23 (OP)
    Newbie
    *
    Offline Offline

    Activity: 10
    Merit: 0


    View Profile
    July 29, 2014, 03:41:31 PM
     #5

    Thanks for the guide. i will try it

    Let me know if you have any problems or questions. Smiley
    Arux
    Hero Member
    *****
    Offline Offline

    Activity: 500
    Merit: 500



    View Profile
    July 30, 2014, 10:15:14 AM
     #6

    Thanks for the guide. i will try it

    +1

    QuintLeo
    Legendary
    *
    Offline Offline

    Activity: 1498
    Merit: 1030


    View Profile
    May 10, 2016, 08:07:39 AM
     #7

    Issue the first - on a fresh Ubuntu 14.04.4 install, aptitude is NOT installed.

    Easy fix, just do apt-get install aptitude before you start the rest of the guide.



    Unfortunately, the guide is COMPLETELY broken in Ubuntu 14.04.4 at step 12 due to an issue where installing MESA drivers *AFTER* you have installed AMD drivers causes your xorg.conf file to be deleted every time you reboot.

     Ubuntu folks are aware of the issue, no timeframe or mention of when/if they will have a fix - and since most later Ubuntu versions don't get along with fglrx AT ALL "upgrading" to a newer version isn't an option - not to mention certain other programs I run require 14.04 for compatability.


     I'm going to try installing fglrx AFTER the step where you install the mesa stuff, see if that's a viable workaround, but due to time limits it might be a few days before I can report back on success or failure.


     BTW - why is installing the BOINC stuff mentioned in your guide? I am not aware that SGMiner is a BOINC application or has anything to do with BOINC?





    I'm no longer legendary just in my own mind!
    Like something I said? Donations gratefully accepted. LYLnTKvLefz9izJFUvEGQEZzSkz34b3N6U (Litecoin)
    1GYbjMTPdCuV7dci3iCUiaRrcNuaiQrVYY (Bitcoin)
    Pages: [1]
      Print  
     
    Jump to:  

    Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!