Category Archives: Mining

XMR-STAK-AMD on Ubuntu Server 16.04 and AMD HD 7870

I bough an old desktop, since one of my other test desktops died. Of course I wanted to set it up for XMR mining. I spend countless hour trying to install some OS one it, but they all failed. Googled my ass off. Tested the memory – all red… Why didn´t I start with that. Anyway, this setup worked.

Since Ubuntu Server comes with no GUI, I used my Macbook with SSH, so I could copy+paste stuff. At Mac Terminal

Accept crypt key and enter password. (Change IP and username).

Of all the tutorials I tried, the one from AMD got me the furthest. All the reboots are important. Updating the system.

Download AMDGPU-PRO Driver Version 17.30 for Ubuntu 16.04.3

For some reason wget did not work for me on this file, so I downloaded the file to my Macbook and copied to Ubunty with scp. From Mac Terminal, in download folder:

Back to Ubuntu.

Check if you are member of the video group.

If you are not in the group, add with this command (karstein = your username)

Log off and on again to make the change.

The AMDGPU-Pro driver package incorporates the ROCm component that can be optionally installed for running Compute/OpenCL applications.  Not entirely sure if I need it for mining, but this step made stuff work.

 

Install the opencl headers.

Now for the XMR-STAK-AMD compile. Normally it works with just cmake, but I got so many errors – and again hours of googling. Cmake needs all the parameters. It is possible to make symlinks for the libraries, but for me that didn’t work.

The last line creates a needed script file. Add the lines below. CTRL+X, Y + Enter for saving.

If you don´t start XMR-STAK-AMD with this export script you will get the following error, which sent me on a wild goose chase for some hours.

Open the config file for editing.

Change these lines.

There are lots of other settings to set, but these are the ones that makes it work. Intensity can probably go up to 7-800, but then the GPU got unstable and crashed. Some sites can use pool_password as identifier for your computers.

Make the startup script executable.

Finally, start XMR-STAK-AMD with

You should get a nice printout like this.

supportxmr.com will give you nice stats for each pc.

Installing xmr-stak-nvidia on Ubuntu 16.04

 

EDIT: If you are REALLY lazy, download this script. Do a chmod on the file:

Be sure to read the text below, as you have to input some text while in nano.

Quick and dirty commands:

This gives you something like this:

Add/replace the above to the config file:

Also add this, maybe change to your wallet address:

CTRL+X , YES – to exit and save

Start the mining:

If everything is OK, you will get an output like this:

After some minutes, you can press ‘h’. This is the results if using Nvidia Geforce 1080

 

sudo apt install linuxbrew-wrapper

 

cd Downloads/
git clone https://github.com/fireice-uk/xmr-stak-nvidia
cd xmr-stak-nvidia
cmake .

CMake Error at /usr/share/cmake-3.5/Modules/FindCUDA.cmake:617 (message):
Specify CUDA_TOOLKIT_ROOT_DIR

Browse to: https://developer.nvidia.com/cuda-downloads
In my case go to Linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)

Runfile(local)

sudo sh cuda_8.0.61_375.26_linux.run

CTRL+C for skipping 200 pages of EULA

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?
(y)es/(n)o/(q)uit: n

Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: y

karstein@phobic-ubuntu:~/Downloads$ lspci | grep -i nvidia01:00.0 VGA compatible controller: NVIDIA Corporation G92 [GeForce 8800 GT] (rev a2)
karstein@phobic-ubuntu:~/Downloads$ cd xmr-stak-nvidia
karstein@phobic-ubuntu:~/Downloads/xmr-stak-nvidia$ cmake .

— Configuring done
— Generating done
— Build files have been written to: /home/karstein/Downloads/xmr-stak-nvidia

make install -Wno-deprecated-gpu-targets

karstein@phobic-ubuntu:~/Downloads/xmr-stak-nvidia$ make install
[ 4%] Building NVCC (Device) object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/xmr-stak-nvidiaCuda_generated_cuda_core.cu.o
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 9%] Building NVCC (Device) object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/xmr-stak-nvidiaCuda_generated_cuda_extra.cu.o
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
Scanning dependencies of target xmr-stak-nvidiaCuda
[ 14%] Linking CXX static library libxmr-stak-nvidiaCuda.a
[ 14%] Built target xmr-stak-nvidiaCuda
Scanning dependencies of target xmr-stak-nvidiaCrypto
[ 19%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_groestl.c.o
[ 23%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_skein.c.o
[ 28%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_keccak.c.o
[ 33%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_blake256.c.o
[ 38%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/soft_aes.c.o
[ 42%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_jh.c.o
[ 47%] Linking C static library libxmr-stak-nvidiaCrypto.a
[ 47%] Built target xmr-stak-nvidiaCrypto
Scanning dependencies of target xmr-stak-nvidia
[ 52%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/webdesign.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/console.cpp.o
[ 61%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/socket.cpp.o
[ 66%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/jpsock.cpp.o
[ 71%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/jconf.cpp.o
[ 76%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/executor.cpp.o
[ 80%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/minethd.cpp.o
[ 85%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/httpd.cpp.o
[ 90%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/cli-miner.cpp.o
[ 95%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/crypto/cryptonight_common.cpp.o
[100%] Linking CXX executable bin/xmr-stak-nvidia
[100%] Built target xmr-stak-nvidia

INSTALLING CUDA 9.0 ON UBUNTU 16.04 WITH NVIDIA GEFORCE 1080

I have spent countless hours trying to install CUDA on my old computer with Geforce 8800 GT with Ubuntu 16.04 – and according the matching google hits, several others also have problems.

But my main conclusion is, for NVIDIA Geforce 8800 GT:

  • Only works with the Nvidia 340 driver
  • Does not work with higher CUDA version than 6.5
  • Do NOT install OPENGL drivers on Ubunty, it will destroy your graphical boot up, and it is so much hazzle getting it to work, that you’d rather install Ubuntu again. Which I have done – like 15 times…

Of all the tutorials and forum posts I have found, this is the only one actually working:

https://kislayabhi.github.io/Installing_CUDA_with_Ubuntu/

But I had to modifiy it for my use, and that is the tutorial below.

Installing CUDA 8.0 on clean install Ubuntu 16.04 with NVIDIA Geforce 8800GT

Install build essentials and do an update.

Download 64-bit Ubuntu driver cuda_6.5.14_linux_64.run from NVIDIA.

Open up a terminal (CTRL+SHIFT+T) and check if the downloaded file cuda_6.5.14_linux_64.run is executable, it should be green.

If it is white, it’s not executable, and you have to run:

You can now extract the separate installers via:

Download NVIDIA-Linux-x86_64-340.104 instead of the default nvidia-304.29 that comes with the toolkit from here: http://www.nvidia.com/Download/driverResults.aspx/123703/en-us

Completely uninstall anything in the Ubuntu repositories with nvidia-* A purge will completely uninstall programs and configuration.

No need to create an xorg.conf file. If you have one, remove it (assuming you have a fresh OS install).

Create theblacklist-nouveau.conf file

Add these two lines:


Then do:

Reboot computer. Nothing should have changed in loading up menu. You should be taken to the login screen. Once there type: Ctrl + Alt + F1, and login to your user. Keep the next commands handy in another machine since now you are in tty.

In tty:

The top line is a necessary step for installing the driver. Then do

Direct quote from Abhijeet Kislay, and this is what makes the differense from ALL other tutorials and forum posts I have seen!

I cannot stress how important is the opengl flag in the above command. If you miss that, either you will get stuck in “login loop” or your computer would boot with a black screen at all times.

If you get a problem with the driver saying X is running, do this, and try again:

Install the toolkit

Set Environment path variables in .bashrc

Verify the driver version

Answer will be something like this

Check CUDA driver version:

Answer

At this point you can switch the lightdm back on again by doing:

Fix/break the header file that doesn’t want to let us use gcc > 4.8. All we are going to do is comment out (//) the error line that drops you out of a build.

In nano press CTRL+SHIFT+_ to enter line number.

Line: 82 – comment out error //#error — unsupported GNU version! gcc 4.9 and up are not supported!

To see if we are properly done with the installation, we need to run a sample.

Something like this should show up

And now everything works perfect.

 

 

Sjekk ut:

https://github.com/xmrMiner/xmrMiner/blob/master/INSTALL.md

 

Installing CUDA 6.5 on Ubuntu 16.04 with NVIDIA Geforce 8800GT

I have spent countless hours trying to install CUDA on my old computer with Geforce 8800 GT with Ubuntu 16.04 – and according the matching google hits, several others also have problems.

But my main conclusion is, for NVIDIA Geforce 8800 GT:

  • Only works with the Nvidia 340 driver
  • Does not work with higher CUDA version than 6.5
  • Do NOT install OPENGL drivers on Ubunty, it will destroy your graphical boot up, and it is so much hazzle getting it to work, that you’d rather install Ubuntu again. Which I have done – like 15 times…

Of all the tutorials and forum posts I have found, this is the only one actually working:

https://kislayabhi.github.io/Installing_CUDA_with_Ubuntu/

But I had to modifiy it for my use, and that is the tutorial below.

Installing CUDA 8.0 on clean install Ubuntu 16.04 with NVIDIA Geforce 8800GT

Install build essentials and do an update.

Download 64-bit Ubuntu driver cuda_6.5.14_linux_64.run from NVIDIA.

Open up a terminal (CTRL+SHIFT+T) and check if the downloaded file cuda_6.5.14_linux_64.run is executable, it should be green.

If it is white, it’s not executable, and you have to run:

You can now extract the separate installers via:

Download NVIDIA-Linux-x86_64-340.104 instead of the default nvidia-304.29 that comes with the toolkit from here: http://www.nvidia.com/Download/driverResults.aspx/123703/en-us

Completely uninstall anything in the Ubuntu repositories with nvidia-* A purge will completely uninstall programs and configuration.

No need to create an xorg.conf file. If you have one, remove it (assuming you have a fresh OS install).

Create theblacklist-nouveau.conf file

Add these two lines:


Then do:

Reboot computer. Nothing should have changed in loading up menu. You should be taken to the login screen. Once there type: Ctrl + Alt + F1, and login to your user. Keep the next commands handy in another machine since now you are in tty.

In tty:

The top line is a necessary step for installing the driver. Then do

Direct quote from Abhijeet Kislay, and this is what makes the differense from ALL other tutorials and forum posts I have seen!

I cannot stress how important is the opengl flag in the above command. If you miss that, either you will get stuck in “login loop” or your computer would boot with a black screen at all times.

If you get a problem with the driver saying X is running, do this, and try again:

Install the toolkit

Set Environment path variables in .bashrc

Verify the driver version

Answer will be something like this

Check CUDA driver version:

Answer

At this point you can switch the lightdm back on again by doing:

Fix/break the header file that doesn’t want to let us use gcc > 4.8. All we are going to do is comment out (//) the error line that drops you out of a build.

In nano press CTRL+SHIFT+_ to enter line number.

Line: 82 – comment out error //#error — unsupported GNU version! gcc 4.9 and up are not supported!

To see if we are properly done with the installation, we need to run a sample.

Something like this should show up

And now everything works perfect.

 

 

Sjekk ut:

https://github.com/xmrMiner/xmrMiner/blob/master/INSTALL.md

 

Installing xmr-stak-cpu on Ubuntu

I have an “old” computer I also wanted to setup for Montero mining.  It’s really unstable on a Windows install, so I wanted to install Linux on it. It’s nice to have different computers with all kinds of OS’s on them.

I downloaded Ubuntu 16.04.3 LTS, put on an USB stick with LinuxLive USB Creator , installed and booted up.

EDIT: If you are REALLY lazy, download this script. Do a chmod on the file:

Be sure to read the text below, as you have to input some text while in nano.

Quick and dirty commands:

This gives you something like this:

Add/replace the above to the config file:

Also add this, maybe change to your wallet address:

CTRL+X , YES – to exit and save

Start the mining:

if you get this error,

you need to configure large page support:

Add these lines at the bottom of the file:

Try mining again:

If you get this error:

Then you need to run mining with sudo.

If everything is OK, you will get an output like this:

After some minutes, you can press ‘h’. This is the results if using 4 cores on a Intel Core i7-4770K 3.5GHz

 

sudo apt install linuxbrew-wrapper

 

cd Downloads/
git clone https://github.com/fireice-uk/xmr-stak-nvidia
cd xmr-stak-nvidia
cmake .

CMake Error at /usr/share/cmake-3.5/Modules/FindCUDA.cmake:617 (message):
Specify CUDA_TOOLKIT_ROOT_DIR

Browse to: https://developer.nvidia.com/cuda-downloads
In my case go to Linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)

Runfile(local)

sudo sh cuda_8.0.61_375.26_linux.run

CTRL+C for skipping 200 pages of EULA

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?
(y)es/(n)o/(q)uit: n

Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: y

karstein@phobic-ubuntu:~/Downloads$ lspci | grep -i nvidia01:00.0 VGA compatible controller: NVIDIA Corporation G92 [GeForce 8800 GT] (rev a2)
karstein@phobic-ubuntu:~/Downloads$ cd xmr-stak-nvidia
karstein@phobic-ubuntu:~/Downloads/xmr-stak-nvidia$ cmake .

— Configuring done
— Generating done
— Build files have been written to: /home/karstein/Downloads/xmr-stak-nvidia

make install -Wno-deprecated-gpu-targets

karstein@phobic-ubuntu:~/Downloads/xmr-stak-nvidia$ make install
[ 4%] Building NVCC (Device) object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/xmr-stak-nvidiaCuda_generated_cuda_core.cu.o
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
[ 9%] Building NVCC (Device) object CMakeFiles/xmr-stak-nvidiaCuda.dir/nvcc_code/xmr-stak-nvidiaCuda_generated_cuda_extra.cu.o
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The ‘compute_20’, ‘sm_20’, and ‘sm_21’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
Scanning dependencies of target xmr-stak-nvidiaCuda
[ 14%] Linking CXX static library libxmr-stak-nvidiaCuda.a
[ 14%] Built target xmr-stak-nvidiaCuda
Scanning dependencies of target xmr-stak-nvidiaCrypto
[ 19%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_groestl.c.o
[ 23%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_skein.c.o
[ 28%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_keccak.c.o
[ 33%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_blake256.c.o
[ 38%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/soft_aes.c.o
[ 42%] Building C object CMakeFiles/xmr-stak-nvidiaCrypto.dir/crypto/c_jh.c.o
[ 47%] Linking C static library libxmr-stak-nvidiaCrypto.a
[ 47%] Built target xmr-stak-nvidiaCrypto
Scanning dependencies of target xmr-stak-nvidia
[ 52%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/webdesign.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/console.cpp.o
[ 61%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/socket.cpp.o
[ 66%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/jpsock.cpp.o
[ 71%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/jconf.cpp.o
[ 76%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/executor.cpp.o
[ 80%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/minethd.cpp.o
[ 85%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/httpd.cpp.o
[ 90%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/cli-miner.cpp.o
[ 95%] Building CXX object CMakeFiles/xmr-stak-nvidia.dir/crypto/cryptonight_common.cpp.o
[100%] Linking CXX executable bin/xmr-stak-nvidia
[100%] Built target xmr-stak-nvidia

cd bin

sudo ./xmr-stak-nvidia config.txt

No CUDA device found!

 

A modprobe blacklist file has been created at /etc/modprobe.d to prevent Nouveau from loading. This can be reverted by deleting /etc/modprobe.d/nvidia-graphics-drivers.conf.
A new initrd image has also been created. To revert, please replace /boot/initrd-4.10.0-35-generic with /boot/initrd-$(uname -r)-backup.

*****************************************************************************
*** Reboot your computer and verify that the NVIDIA graphics driver can ***
*** be loaded. ***
*****************************************************************************

export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\

 

No CUDA device found!

 

Forsøk 17:

Run the following
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Then make sure your driver is in the repo example:
apt search nvidia-367

if it is there

sudo apt-get nvidia-367

https://linuxconfig.org/how-to-install-the-latest-nvidia-drivers-on-ubuntu-16-04-xenial-xerus

https://kislayabhi.github.io/Installing_CUDA_with_Ubuntu/

 

Prøvd:

https://askubuntu.com/questions/726683/problem-after-install-nvidia-340-or-nvidia-352-on-gt630 – Samme feil…

 

Monero Mining

I have started a attempt to mine some cryptocurrency. Mostly for fun. This is I good tutorial for installing on Windows 10.

https://www.usxmrpool.com/#easy_mining_guide

For my Macbook I used this page, where they have compiled xmr-stak-cpu for MacOS.

https://github.com/JPaulMora/xmr-stak-cpu/releases

Following this tutorial, opening (from Finder) the Unix executable xmr-stak-cpu – I get this error.

I can’t find any solutions by googling, so I tried some different stuff myself. The easy fix is to drag and drop the xmr-stak-cpu file, then the config.txt file to Terminal. Somehow using the full path on both files, makes it work.

Now xmr-stak-cpu suggests the correct settings for the CPU. Copy and paste into config.txt, add your pool address/ wallet.

Run program again. Your will se something like this.

The hash rate of my Macbook.

The hash rate of my NVIDIA GeForce GTX 3GB.

The hash rate of my Intel Corei5-74003 Ghz (using 3 cores)