Jump to content

[GUIDE] Etherum Nvidia mining on Ubuntu 17.10 from the ground up

Hi All,

 

Recently went through my own build of a rig from the ground up.  Nothing special about it (no web interface or other "nice" things you get with the prebuilt OS).  All this takes is your time.  My build took me about 2 hours using a 250MB Comcast cable connection.

 

Rig Specs

  • Intel i3-6100
  • 8gb or DDR memory
  • 2x Zotac 1060's 3gb

My hash per card is 19.08.  Below are my steps

 

Found this useful? Buy me a beer

ETH:0x5DeDbebF13Ead7fF869c8f86906F91640542097C

 

First get your OS from ubuntu.com

  • I used the mini.iso, wrote it a USB stick and started the install.  this is where the fast internet connection will come in to download your OS
  • using my MAC issued dd if=mini.sio of=/dev/disk2 (or whatever your USB disk) bs=1.  after about 15 minutes my USB stick was ready to go

 

the install was very simple for I changed nothing from the default settings.  when it came time to add additional packages I chose the following

  • OpenSSH server

 

after install is completed, the system was rebooted and I was at the login screen.  Some may need to hit CTRL + Alt + F1 to get to this screen.  If you see an entry referencing clean blocks..  simply press CTRL + Alt + F1 to get the login prompt.  Login using the information you setup using install. 

 

Set your root password

issue sudo passwd root

 

Lets add the necessary repository's to get the process started

 

sudo apt-get install software-properties-common -y
sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse
sudo apt-get update


 

 

We now need to install a lot of packages.  we do this in stages to ensure APT does not choke / give errors / tell us no!

 

Group 1

sudo apt install ocl-icd-opencl-dev -y
sudo apt-get install libmicrohttpd-dev libssl-dev cmake build-essential -y 
sudo apt-get install automake libtool make gcc -y
sudo apt-get install libjansson-dev -y 
sudo apt-get update


Second round of repository's

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update

 

Install an older version of GCC and link it

sudo apt-get install g++-6 -y
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10
sudo apt-get upgrade

 

Setup and grab the necessary files needed for kernel injection of the Nvidia

sudo update-initramfs -u
sudo apt-get install libopenblas-dev liblapack-dev -y
sudo apt-get install linux-image-generic linux-image-extra-virtual -y
sudo apt-get install linux-source linux-headers-generic -y
sudo apt-get install nvidia-common nvidia-prime nvidia-settings -y
sudo add-apt-repository ppa:graphics-drivers/ppa -y
sudo apt-get update
sudo apt-get install nvidia-387 -y (current version as of 11-30-17)
sudo apt-get install python-pip python-dev -y
sudo apt-get install python-numpy python-scipy -y
sudo apt-get install libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev -y 
sudo apt-get install apt-file -y && sudo apt-file update
sudo apt-get install build-essential -y

head on over to Nvidia and download the Cuda drivers 

  • https://developer.nvidia.com/cuda-downloads. (as of 11-30-17)
  • make your selection of OS (Linux --> x86_64 --> Ubuntu --> 17.04 --> run file (local)
  • Right Click the Download (1.6GB) and choose copy link
  • back to your SSH client into your rig... issue cd $home
  • issue wget and paste the link from the Nvidia website.  Below is an example of what the command looks like
  • wget https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda_9.1.85_387.26_linux.run

     

issue

chmod +x cuda* 

to make the file executable

 

Lets install cuda.  Notice in the above wget, we have a file named cuda_9.1.85_387.26_linux.run.  this is the file we downloaded from Nvidia and is what we will use to install cuda on our system. 

 

this process took around 20-40 minutes per line to complete on my system. 

sudo ./cuda_9.1.85_387.26_linux.run --driver --silent
sudo ./cuda_9.1.85_387.26_linux.run --toolkit --silent
sudo ./cuda_9.1.85_387.26_linux.run --samples --silent

 

install more software which will allow us to connect to our pools which require https and x-org (a window session manager - graphical interface) 

sudo apt-get install libcurl4-openssl-dev -y
sudo apt-get install build-essential xserver-xorg p7zip xorg-dev libgtk-3-dev xdm -y
you will get a prompt asking which session manager you want..  choose xdm

 

we must change the xdm file as follows

sudo vi /etc/X11/xdm/Xsetup

copy and paste the following lines into the file.  

  • use your arrow keys to scroll down to the bottom of the file and at the last word and letter of that file. 
  • Hit the a key.  
  • Press enter again to to go the next line
export PATH=/bin:/usr/bin:/sbin
export HOME=/root
export DISPLAY=:0
xset –dpms
xset s off
xhost +

 

  • hit the Escape key
  • type :w!
  • type :q.  this should bring you back to your regular shell

 

issue the following and reboot the machine after

sudo nvidia-xconfig -a --allow-empty-initial-configuration --cool-bits=28 --use-display-device="DFP-0" --connected-monitor="DFP-0" --custom-edid="DFP-0:/etc/X11/dfp-edid.bin" --enable-all-gpus
sudo sed -i '/Driver/a Option "Interactive" "False"' /etc/X11/xorg.conf
sudo reboot

ssh back into the machine and issue your over clocks for your cards

sudo nvidia-smi -pm 1
sudo nvidia-smi -pl 80
sudo nvidia-settings -c :0 -a [gpu:0]/GPUMemoryTransferRateOffset[3]=1000
sudo nvidia-settings -c :0 -a [gpu:0]/GPUGraphicsClockOffset[3]=-200
sudo nvidia-settings -c :0 -a [gpu:0]/GPUFanControlState=1
sudo nvidia-settings -c :0 -a [fan:0]/GPUTargetFanSpeed=95

repeat the red font for each card you have in the machine.   change :0 to the card you want to change the settings for.  If you have a single card, no need to do anything further.  if you have other cards issue the following (notice the change from 0 above to 1 below)

 

sudo nvidia-settings -c :0 -a [gpu:1]/GPUMemoryTransferRateOffset[3]=1000
sudo nvidia-settings -c :0 -a [gpu:1]/GPUGraphicsClockOffset[3]=-200
sudo nvidia-settings -c :0 -a [gpu:1]/GPUFanControlState=1
sudo nvidia-settings -c :0 -a [fan:1]/GPUTargetFanSpeed=95

 

your all set...    download your favorite mining software and start mining!   

 

I use ethminer and my startup script is as follows.  I Recommend you make yourself a nice script to issue these commands so all you have to do is run a single program.  Remember the below should be issued on the console of the host - not via SSH.  If you issue via SSH and close the SSH window you will stop mining. 

 

./ethminer --report-hashrate --farm-recheck 200 -U -S us1.ethermine.org:14444 -O 0x5DeDbebF13Ead7fF869c8f86906F91640542097C

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Guide Updated on 12-8-17

 

  • 12-80-17  - Updated reboot commands with SU so copy paste works better.
Link to comment
Share on other sites

Link to post
Share on other sites

May I suggest that you put all commands in code blocks for easier copying and pasting?

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Definitely gonna refer to this when I start mining. Saves me a couple hundred I would've spent on Windows

Quote or tag me( @Crunchy Dragon) if you want me to see your reply

If a post solved your problem/answered your question, please consider marking it as "solved"

Community Standards // Join Floatplane!

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, orddie said:

 

head on over to Nvidia and download the Cuda drivers 

  • https://developer.nvidia.com/cuda-downloads. (as of 11-30-17)
  • make your selection of OS (Linux --> x86_64 --> Ubuntu --> 17.04 --> run file (local)
  • Right Click the Download (1.6GB) and choose copy link
  • back to your SSH client into your rig... issue cd $home
  • issue wget and paste the link from the Nvidia website.  Below is an example of what the command looks like
  • 
    wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run

 

I'm not familiar with SSH client.  Is it just a program that allows you to remote access your rig?  Is it necessary for setting up the miner?  If so, how do you access the client to input that cd $home line?

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, Jman said:

I'm not familiar with SSH client.  Is it just a program that allows you to remote access your rig?  Is it necessary for setting up the miner?  If so, how do you access the client to input that cd $home line?

 

head on over to putty.org to download an ssh client. ssh is necessary / easy to SETUP your rig but not necessary to mine. 

1 hour ago, LtStaffel said:

May I suggest that you put all commands in code blocks for easier copying and pasting?

had considered that but the commands mostly needed to be entered line by line / not copy paste all at once. I think how I added the commands help with that concept 

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/30/2017 at 6:00 PM, orddie said:

 

head on over to putty.org to download an ssh client. ssh is necessary / easy to SETUP your rig but not necessary to mine.

Thanks, I have it downloaded but I still do not know what it's purpose is or how I need to use it in the process of setting up my rig.

 

I got this error when I was installing the cuda drivers: ( sudo: ./cuda_9.0cuda_9.0.176_384.81_linux.run: command not found ). any suggestions?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Jman said:

I got this error when I was installing the cuda drivers: ( sudo: ./cuda_9.0cuda_9.0.176_384.81_linux.run: command not found ). any suggestions?

Jamn.  did you download the Cuda file from Nvidia website? 

Link to comment
Share on other sites

Link to post
Share on other sites

I down

7 minutes ago, orddie said:

Jamn.  did you download the Cuda file from Nvidia website? 

I downloaded it both from the nvidia website and through the wget address

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, orddie said:

had considered that but the commands mostly needed to be entered line by line / not copy paste all at once. I think how I added the commands help with that concept 

In my experience, when you copy a command set with newlines in it, it executes them as the one before completes. Meaning if I copy this:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install supercoolprogram
cd supercoolprogram
./supercoolprogram

it will update lists, then upgrade once that finishes, then install supercoolprogram, switch to its directory, and run it

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/30/2017 at 6:36 PM, Jman said:

I down

I downloaded it both from the nvidia website and through the wget address

and your issuing the command while in the same folder as the the file is located?    

 

you can confirm this by doing an ls -al.  you should see the file listed. 

 

On 11/30/2017 at 7:25 PM, LtStaffel said:

In my experience, when you copy a command set with newlines in it, it executes them as the one before completes. Meaning if I copy this:


sudo apt-get update
sudo apt-get upgrade
sudo apt-get install supercoolprogram
cd supercoolprogram
./supercoolprogram

it will update lists, then upgrade once that finishes, then install supercoolprogram, switch to its directory, and run it

 

ok.  Updated.  thanks for the feedback. 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, orddie said:

and your issuing the command while in the same folder as the the file is located?    

 

you can confirm this by doing an ls -al.  you should see the file listed. 

Managed to get passed this but ran across issues now with the xorg part.  After entering the command: 

sudo apt-get install build-essential xserver-xorg p7zip xorg-dev libgtk-3-dev xdm

I was met with the error: 

Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 xserver-xorg : Depends: xserver-xorg-core (>= 2:1.17.2-2)
E: Unable to correct problems, you have held broken packages.

 

Not sure what to do from here.  Any suggestions?

Link to comment
Share on other sites

Link to post
Share on other sites

On 12/1/2017 at 12:32 AM, Jman said:

Managed to get passed this but ran across issues now with the xorg part.  After entering the command: 


sudo apt-get install build-essential xserver-xorg p7zip xorg-dev libgtk-3-dev xdm

I was met with the error: 

Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 xserver-xorg : Depends: xserver-xorg-core (>= 2:1.17.2-2)
E: Unable to correct problems, you have held broken packages.

 

Not sure what to do from here.  Any suggestions?

 

I ran back through this guide as I needed to setup a new rig today.  Please review things line be line and let me know if you get stuck again.

 

Thanks! 

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/30/2017 at 5:28 PM, orddie said:

Guide Updated on 12-3-17

does this work with ubuntu lts 16.04 the same way?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Pachuca said:

does this work with ubuntu lts 16.04 the same way?

tested on 17.10 only.   I would assume you would have less GCC issues with the older OS but overall should not be a problem. 

Link to comment
Share on other sites

Link to post
Share on other sites

22 hours ago, orddie said:

tested on 17.10 only.   I would assume you would have less GCC issues with the older OS but overall should not be a problem. 

any chance there will be an amd guide in the future? I'm planning to put together an AMD rig for a friend.

Link to comment
Share on other sites

Link to post
Share on other sites

34 minutes ago, Pachuca said:

any chance there will be an amd guide in the future? I'm planning to put together an AMD rig for a friend.

while I find myself Team Green (Nvidia) member, I cant rule out AMD a guide for more and more people are talking about the hash rate for AMD cards verse Nvidia.    

 

All the work I did was a mix of others work on the net - just combined with what worked for me several times over. 

 

Bottom line: If I had access to an AMD card (rent or ssh access to the box running it) I could put together the guide.   Until that day..  No. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×