Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    [Guide] How to Mine FTC / Neoscrypt - Sgminer + Ubuntu 14.04 + AMD

    Guides
    7
    14
    37370
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      ChristianRiesen Regular Member last edited by wrapper

      This [Guide] is relevant but out of date :

      After Ghostlander did so much new work on it, NSGminer. is now a recommended miner and has a guide in the Github and is compatible with a wide variety of GPUs.

      http://forum.feathercoin.com/topic/8235/nsgminer-v0-9-0-the-fastest-neoscrypt-gpu-miner/1


      Ubuntu 14.04 + AMD Card + sgminer Tutorial

      I recently had to redo this so I decided to make a write up for this to share with everyone. This might be helpful or blow up your machine, so don’t hold me responsible for any damage to your stuff. With the disclaimer out of the way, here the process.

      Installing Ubuntu Server

      First go and get the ISO for Ubuntu 14.04.1 LTS Server at the Ubuntu site. When you have the file “ubuntu-14.04.1-server-amd64.iso” you need to put it on a USB stick. If you use Windows, then the Linux Live USB Creator is your best bet. Feed it the ISO and you have a bootable USB stick for installation.

      Take your hardware, attach stick, keyboard and monitor, then boot from the stick. As a side note I would start with one GPU card if you intend to use multiple. Once you have one single card running, you can add more, safe in the knowledge that your system is sound.

      Install it as you prefer. I’d use English as language, it can make your life a bit easier since it says the same things you see online. When partitioning the disk, I would use “Guided, entire disk” and just accept what it does. Give it a good hostname (mine are miner01, miner02 and so on) and give it a simple username/password. I would suggest using the same for both, something you remember even if you don’t touch the box for months. I chose “miner” for my setup and will use that throughout the guide, so if you see /home/miner, then you should replace the “miner” with something else that you picked. It should be behind some router/firewall so there shouldn’t be a problem with that. When it asks you what to install, only hit the spacebar once so it selects the OpenSSH server, then tab and enter to continue. Everything needed is covered in this guide beyond that. When asked to install the grub loader into the MBR, say yes.

      The system reboots, remove the USB stick, then let it boot until you see the prompt with the hostname you chose (miner01 in my case). Login with your username/password you chose.

      Type

      ifconfig 
      

      and note down the IP address it has. Usually something like 192.168.1.12 or the likes. You will need that for the next parts.

      Installing drivers

      I suggest you switch to your main computer now and connect to the miner with a tool such as putty or terminal. The advantage is you can copy paste things over simply with this and you can have the miner in another room or less comfortable place while remotely working on it from your comfy chair. Connect using your IP you noted before (the 192.168 thing) and login using your username/password.

      Simply copy paste the following lines and let them run through. If it asks you should it do it, just hit the Y key and then enter.

      First the system upgrades to make sure you are up to date with all the dependencies.

      sudo -s
      aptitude update
      aptitude safe-upgrade
      aptitude install acl libtool libncurses5-dev libjansson-dev libcurl4-openssl-dev build-essential git make gcc automake curl x11-common xserver-xorg-core unzip libxrandr2 libxrandr-dev xserver-xorg x11-utils opencl-headers
      

      Now your system is ready for the drivers. Unfortunately they are not that easy to come by from within the box. So use your machine and collect the 3 files you need to make this work.

      First is the AMD Display Library (ADL) SDK or short ADL_SDK which will allow sgminer to get data from the GPU card like temperature and also tweak settings. This might seem like not much, but in order to get the most from your miner, you need this. At the time of this writing that page linked above shows the latest version is 7.0 and the file you get is ADL_SDK.zip which is 1.77 MB and was released 05/29/2014. Download it and save it somewhere.

      Second file is the AMD APP SDK which is needed for sgminer to talk to the graphics card in it’s own language (OpenCL). The file you should get (at the time of this writing) is AMD-APP-SDK-linux-v2.9-1.599.381-GA-x64.tar.bz2 which is 123 MB large and was released 8/18/14. Make sure you get the 64 bit version. If a newer version is out,

      And lastly you need the OpenCL 2.0 enabled graphics card drivers. You can get them on the AMD support page. What you want is behind the AMD Catalyst™ Software for Linux® 64 bit system link. This will give you file called linux-amd-14.41rc1-opencl2-sep19.zip of 150 MB.

      Now you need to get those on to the miner. I use FileZilla for this and make an sftp connection for it. Works fast and is free. The files are now in the home directory of your miner user.

      Considering all the filenames are still the same, you can use these commands now

      cd /home/miner
      tar -xvjf AMD-APP-SDK-linux-v2.9-1.599.381-GA-x64.tar.bz2
      ./AMD-APP-SDK-v2.9-1.599.381-GA-linux64.sh
      ln -s /opt/AMDAPPSDK-2.9-1 /opt/AMDAPP
      ln -s /opt/AMDAPP/include/CL /usr/include
      ln -s /opt/AMDAPP/lib/x86_64/* /usr/lib/
      ldconfig
      reboot
      

      Your miner will do a quick reboot, don’t worry, it needs that for the next part (just makes it easier).

      Now the catalyst driver comes into play.

      sudo -s
      cd /home/miner
      unzip linux-amd-14.41rc1-opencl2-sep19.zip
      fglrx-14.41/amd-driver-installer-14.41-x86.x86_64.run
      aticonfig --adapter=all -f --initial
      reboot
      

      With this you have installed and configured the driver. Time for building the sgminer binary.

      Building sgminer

      You can do a quick check if the above worked before going on if you want with the following lines:

      export DISPLAY=:0
      aticonfig --list-adapters
      

      It should show you (at least) one graphics card. If it doesn’t something went wrong before, so buidling sgminer is not your problem just yet.

      The prep for sgminer is relative simple. Just run these in order.

      cd /usr/local
      git clone https://github.com/veox/sgminer.git
      cd /home/miner
      unzip ADL_SDK.zip
      cp include/* /usr/local/sgminer/ADL_SDK/
      cd /usr/local/sgminer
      ./autogen.sh
      CFLAGS="-O2 -Wall -march=native -I/opt/AMDAPP/include" LDFLAGS="-L/opt/AMDAPP/lib/x86_64" ./configure --enable-scrypt
      make
      

      If all goes well you should now have the sgminer binary. Most problems happen on the line that starts with CFLAGS where the configure will spit out some errors. Don’t worry about warnings on the make line, that’s normal.

      Run

      ./sgminer -n
      

      to see if it worked and you have a working binary.

      Autostart miner on boot

      To control your miner and do some magic, you need scripts to help you with that. No worries, I got you covered. Open an editor with this:

      nano /etc/init.d/sgminer
      

      Now paste the following content into the open file, BUT change the line. The -o should be your mining pool you want to mine for. The -u your username. And of course your password with -p for the pools user. If you don’t change them, thank you for mining for me.

      #!/bin/bash
      #
      case "$1" in
      start)
      echo "Starting sgminer"
      export DISPLAY=:0
      export GPU_USE_SYNC_OBJECTS=1
      export GPU_MAX_ALLOC_PERCENT=100
      export GPU_MAX_HEAP_SIZE=100
      /usr/local/sgminer/sgminer -I 15 -o stratum+tcp://pool.d2.cc:3333 -u ChristianRiesen.tutorial -p x
      ;;
      stop)
      echo "Stopping sgminer"
      killall -9 sgminer -w -q
      ;;
       
      *)
      echo "sgminer"
      echo $"Usage: $0 {start|stop}"
      exit 1
      esac
      exit 0
      

      When you are done, hit CTRL+O for writing and then CTRL+X to exit the editor.

      I also added an Intesity of 15 in there, so you might want to tweak the settings with this. Alternatively you can also create a config, and reference it here. But that’s not part of this guide. All I aim here to do is get your running first.

      Now you need to set the script to execute.

      chmod a+x /etc/init.d/sgminer
      

      If you want to run it automatically every time the system boots, then you should also execute this.

      ln -s /etc/init.d/sgminer /etc/rc2.d/S99sgminer
      

      There is one more thing you have to do. For sgminer to run properly, you need X to start (aka x Windows). So open a document like this:

      nano /etc/init.d/x-boot
      

      Insert this content

      #!/bin/bash
      #
      case "$1" in
      start)
      echo "Starting X"
      X &
      ;;
      
      *)
      echo "X"
      echo $"Usage: $0 {start}"
      exit 1
      esac
      exit 0
      

      Exit with CTRL+O and CTRL+X again, then mark it executable and let it autoboot. This way your miner will be able to work properly, otherwise you might run into problems that cost me countless hours in the past.

      chmod a+x /etc/init.d/x-boot
      ln -s /etc/init.d/x-boot /etc/rc2.d/S89x-boot
      

      Reboot your box and it should automatically start mining for you. Alternatively, run these two commands now to see it mine right in front of you:

      /etc/init.d/x-boot start
      /etc/init.d/sgminer start
      

      When you quit sgminer, you can just start it again with the lower line only, which is probably something you will do a lot while tweaking it.

      Where to from here?

      Maybe more cards? Now here is a thing you have to do to make them work. Shutdown, insert card, boot up, then run this command, then reboot.

      sudo aticonfig --adapter=all -f --initial
      

      Now you should be able to access the card.

      You might also want to tweak the settings of your card, to get more power out of it, but that’s not this tutorial.

      I successfully used this on a dozen different machines and has yet to fail me. I used 7950’s mostly, so your results may vary. Enjoy!

      1 Reply Last reply Reply Quote 5
      • M
        mirrax last edited by

        There is never enough Linux tutorials, nice job!

        1 Reply Last reply Reply Quote 0
        • C
          ChristianRiesen Regular Member last edited by

          Most welcome. I was looking for something like this when I first started and never found anything similar, so I made lots of notes as I fought through the jungle. Now those notes were very helpful but I still could not find something like this, so I decided it needs to be out there. This of course works for all scrypt coins, just happen to make this work for feathercoin because I needed some for testing.

          1 Reply Last reply Reply Quote 1
          • MrWyrm
            MrWyrm administrators last edited by

            worth a sticky? :)

            Like what I do: 6uuy6isbrW1SBF191Bzgui1gWxPdNKx2PB

            1 Reply Last reply Reply Quote 0
            • kris_davison
              kris_davison last edited by

              Yes this is a great tutorial. :)

              1 Reply Last reply Reply Quote 0
              • C
                ChristianRiesen Regular Member last edited by

                Any enhancements, please send them my way and I gladly upgrade it. This is really partly almost a year old and just what got me to make it work. I think some parts could use a better setup for certain, just didn’t have the time to make it nicer.

                1 Reply Last reply Reply Quote 1
                • wrapper
                  wrapper Moderators last edited by wrapper

                  [Guide] How to Mine crypto-currency with Linux on AMD Graphics cards GPU, install sgminer 5.1.2

                  This guide is for GPU mining with Sgminer 5.1.2 on GNU/Linux (Ubuntu 14.04.0x LTS). It is set up to mine Feathercoin, which uses the neoscrypt algorythm to encrypt each transaction, but will work with multiple algorithms from other alternate currencies, with an appropriate Sgminer config file set-up.

                  Sgminer 5.1.2 is the same as version 5.1.1, except it has has some additional neoscrypt kernels which kave been let out in the wild and the option to return to version one, which is better with some cards.

                  See “forked from” on Github, if you want to use the guide on the sgminer-dev source instead.

                  In general the performance and complexity of GPU mineing comes down to the AMD drivers and lack of support for all previous cards versions in each release. here are also problems where certain versions of the AMD drivers will not work with versions of linux or sgminer.

                  In order make a stable install which will work with the neoscrypt algorithm, specific versions are used, 14.04 LTS Ubuntu operating system, 14.9 AMD fglrx, 2.9 AMD application SDK and version 6 of AMD’s ADL SDK.

                  This guide has been tested on R9 2** cards and is optimised for Neoscrypt on R9 280 in the guides default configuration.

                  #1. install Ubuntu 14.04.0x
                  Open a terminal and do an update to Ubuntu
                  Code:
                  sudo apt-get update
                  sudo apt-get upgrade -y

                  Install build essentials and dependencies
                  Code:
                  sudo apt-get install -y 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 gdebi gedit execstack dh-modaliases lib32gcc1 dkms

                  sudo apt-get install -y xserver-xorg-core xserver-xorg-video-ati

                  #2. Manually Install correct AMD Catalyst drivers (14.9)
                  Code:
                  sudo apt-get install linux-headers-generic
                  sudo apt-get purge ‘fglrx*’
                  sudo rm /etc/X11/xorg.conf
                  sudo apt-get install --reinstall -y xserver-xorg-core
                  sudo dpkg-reconfigure xserver-xorg

                  Download 14.9 driver from AMD :
                  http://support.amd.com/en-us/download/desktop/previous/detail?os=Linux x86&rev=14.9
                  Code:
                  cd ~/
                  mkdir fglrx4.9

                  Extract the AMD driver installer
                  Extract the files and folders from download of the AMD Catalyst™ 14.9 Proprietary Linux x86 Display Driver zip and copy / extract them into the fglrx4.9 directory

                  run the install commands, after it finishes press exit, then install on the pop up.
                  Code:
                  cd fglrx4.9
                  sudo sh *.run

                  Initialise the graphics card, install xorg and dependencies.
                  Code:
                  sudo aticonfig --adapter=all --initial
                  sudo aptitude install -yr boinc-amd-opencl opencl-headers mesa-utils libglu1-mesa libgl1-mesa-glx libgl1-mesa-dri

                  #3. Reboot

                  #4. install AMD App SDK
                  Code:
                  cd ~/
                  mkdir amd-app-sdk

                  Download APP-SDK from AMD :
                  http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/
                  make sure it is version 2.9 AMD-APP-SDK-v2.9-lnx64.tgz extract it into /amd-app-sdk
                  Code:
                  cd amd-app-sdk
                  chmod a+x *.sh
                  sudo ./Install-AMD-App.sh
                  sudo aticonfig --adapter=all --initial

                  #5. Reboot

                  #6. Install sgminer 5.1.2
                  Code
                  cd ~/
                  git clone https://github.com/wrapperband/sgminer.git

                  #Download AMD/ADL_SDK_6.0.zip, extract the 'h files from include to ~/sgminer/adl_sdk
                  http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdk/
                  Make sure it is the version ADL_SDK_6.0
                  Code:
                  cd ~/sgminer
                  git submodule init
                  git submodule update
                  autoreconf -i -f
                  CFLAGS=“-O2 -Wall -march=native -std=gnu99” ./configure
                  make
                  (sudo make install : optional install)

                  Check that the build worked
                  Code:
                  ./sgminer -n
                  export DISPLAY=:0
                  export GPU_MAX_ALLOC_PERCENT=100
                  export GPU_USE_SYNC_OBJECTS=1
                  ./sgminer

                  #7. Create a sgminer start script
                  #Create the script file to start sgminer correctly
                  Code:
                  nano sgminer.sh

                  Copy in the script code and customise as required :
                  #!/bin/bash -
                  #title :sgminer.sh
                  #description :Start sgminer
                  export DISPLAY=:0
                  export GPU_MAX_ALLOC_PERCENT=100
                  export GPU_USE_SYNC_OBJECTS=1
                  ./sgminer

                  #Make the bash script runnable
                  Code:
                  chmod a+x *.sh

                  #8. Run the sgminer script
                  Code:
                  cd ~/sgminer
                  ./sgminer.sh

                  The different coin algorithms are stored in the sgminer/kernels directory. The kernels are created in C for AMD cl graphics processing programming interface. Esencially the GPU speeds up over CPU by parallel processing.

                  There are four neoscypts available in the 5.1.2, neoscrypt.cl, neoscrypt.v1 and neoscrypt.v2 are marked as such and version 3 which is “optimised” for R9 280 (default neoscrypt kernel) and marked as neoscrypt.280.

                  There is also a 79XX kernel version, with some of the 290 code replaced to handle older cards, which is included as a separate file neoscrypt.7690.
                  It is worth experimenting to see which kernel works best with your setup, copy one of the neoscrypt files then run a recompile…

                  Recompile sgminer after changing the kernel
                  Code:
                  cd ~/sgminer
                  rm *.bin
                  autoreconf -i -f && CFLAGS=“-O2 -Wall -march=native -std=gnu99” ./configure && make && ./sgminer.sh

                  The configuration file sgminer.conf is stored in the .sgminer hidden directory. Use Ctr-H in Gnome / Nautilus or Alt . in KDE / Dolphin, to show the hidden directories in the home directories.

                  I have experimented and read about xIntensity, it made no difference to adjust that from 3 for neoscrypt. It gave exactly the same results with raw intensity of 5690.

                  An example sgminer.conf pointing towards p2pools, just replace the address with your own.
                  Code :
                  nano ~/sgminer/sgminer.conf

                  {
                  “pools”: [
                  {
                  “name”: “Neoscrypt Pool2P”,
                  “url”: “stratum+tcp://p2pool.neoscrypt.de:19327”,
                  “user”: “ftc address”,
                  “pass”: “password”,
                  “no-extranonce”: true
                  “priority”: “1”
                  },
                  {
                  “name”: “kosmoplovci Pool2P”,
                  “url”: “stratum+tcp://p2pool.kosmoplovci.org:19327”,
                  “user”: “ftc address”,
                  “pass”: “password”,
                  “no-extranonce”: true,
                  “priority”: “2”
                  }
                  ],
                  “profiles”: [],
                  “failover-only”: true,
                  “algorithm”: “neoscrypt”,
                  “device”: “all”,
                  “xintensity”: “3”,
                  “thread-concurrency”: “8192”,
                  “worksize”: “32”,
                  “gpu-threads”: “2”,
                  “temp-cutoff”: “95”,
                  “temp-overheat”: “85”,
                  “temp-target”: “75”,
                  “gpu-memdiff”: “0”,
                  “shares”: “0”,
                  “kernel-path”: “/usr/local/bin”,
                  “api-mcast-port”: “4028”,
                  “api-port”: “4028”,
                  “expiry”: “12”,
                  “failover-switch-delay”: “60”,
                  “gpu-dyninterval”: “7”,
                  “gpu-platform”: “-1”,
                  “hamsi-expand-big”: “4”,
                  “keccak-unroll”: “0”,
                  “log”: “5”,
                  “no-pool-disable”: true,
                  “no-client-reconnect”: true,
                  “queue”: “0”,
                  “scan-time”: “5”,
                  “tcp-keepalive”: “30”,
                  “temp-hysteresis”: “3”,
                  “watchpool-refresh”: “30”
                  }

                  1 Reply Last reply Reply Quote 5
                  • Wellenreiter
                    Wellenreiter Moderators last edited by

                    Well done, Wrapper :)

                    Feathercoin development donation address: 6p8u3wtct7uxRGmvWr2xvPxqRzbpbcd82A
                    Openpgp key: 0x385C34E77F0D74D7 (at keyserver.ubuntu.com)/fingerprint: C7B4 E9EA 17E1 3D12 07AB 1FDB 385C 34E7 7F0D 74D7

                    1 Reply Last reply Reply Quote 1
                    • U
                      uncle_muddy administrators last edited by

                      Ahh now you have gone and done it… I have a machine just sitting here doing nothing with a toxic left in it… I might just have to give this ago and see what i get.

                      If nothing else with winter in the UK coming I can use it to heat the office :)

                      1 Reply Last reply Reply Quote 1
                      • wrapper
                        wrapper Moderators last edited by wrapper

                        I’m going to put it up on Github, to ease changes.

                        We could do with a similar thing for the windows version, and a link to the download. I’ll gradually get round to looking at that,
                        +the windows guide - It’s probably already here somewhere, as I didn’t find the sgminer guide till after I wrote mine and was tidying guides…

                        My main forum priority is to help do a bit of tidying up of the forum conversion errors, particularly main pages / threads recent history.

                        1.We need to move guides up to the top level on the forum and

                        1. go around upping the kudos on guides and up to date threads. My Modes of failure (P.2) is pinned, but is well down the list in support…
                        1 Reply Last reply Reply Quote 0
                        • wrapper
                          wrapper Moderators last edited by wrapper

                          P.S.
                          Neoscrypt runs pretty low and cool, especially on Linux. The extra memory requirement doesn’t drive the fan so hard as scrypt did. That is perhaps one reason the sgminer choice of intensity is limited to xI 3

                          1 Reply Last reply Reply Quote 0
                          • wrapper
                            wrapper Moderators last edited by wrapper

                            The new forum relies on voting to raise the importance of threads, any chance of “Voting UP” the new Guide to mining Feathercoin on SGMINER . (I can’t vote for my own threads…)

                            1 Reply Last reply Reply Quote 1
                            • wrapper
                              wrapper Moderators last edited by

                              Just found some Nice stuff, Nice Hash has done, to document and bug fix ALT COIN mining including Neoscrypt

                              https://www.nicehash.com/?p=multialgo

                              Updated sgminer for switching - from 5.0.0
                              https://github.com/nicehash/sgminer

                              Link to further additional Alt-coin GPU kernels
                              https://github.com/djm34/sgminer

                              I’ll gradually test the AMD kernels and see if there is any fixes / links to add to FTC guide

                              1 Reply Last reply Reply Quote 2
                              • wrapper
                                wrapper Moderators last edited by

                                After Ghostlander did so much new work on it, I’m now recommending NSGminer.

                                http://forum.feathercoin.com/topic/8235/nsgminer-v0-9-0-the-fastest-neoscrypt-gpu-miner/59

                                1 Reply Last reply Reply Quote 2
                                • First post
                                  Last post