Enable BBR tcp congestion control under CentOS 7

It’s been a while since a new tcp congestion has been developed (by Google), which has the potential to replace the default cubic one! The TCP BBR tries to keep being fast and improves the network connectivity when there is packet loss. Enabling it on the server does not require it to enable it on the client to function BBR algorithm properly. So probably we’ll see the switch to this new tcp congestion control in the next major linux distros releases.

Here we present how to enable TCP BBR on your CentOS 7 box. As you know the CentOS 7 uses kernel 3.10.X and the TCP BBR was introduced in version 4.9+ kernels and in version 4.13 and on it has a tcp-level pacing so you do not need the qdisc “fq” to be enabled, when using TCP BBR. So we need a new kernel version 4.9 and on and the easiest and safest way to do it to use the mainline kernel from https://www.elrepo.org/. We have a detailed howto for this if you need more information on using mainline kernel with your CentOS 7.

Here are the steps, you need to be root to execute the following commands:

STEP 1) Update your system and reboot

yum clean all
yum -y update
reboot

Keep on reading!

Close socket as if the remote closed the connection

If you have a hung process and it happened to be in this state because of the network, for example your client or server program is in read timeout state, you can use

lsof and gbg

to close the network socket simulating the other (remote) end closed it and the process will continue operating normally.

In our case there is a couple of nrpe process hung in read from a network socket:

[root@srv ~]# lsof -n -p 9948
COMMAND  PID USER   FD   TYPE             DEVICE SIZE/OFF    NODE NAME
nrpe    9948 nrpe  cwd    DIR                9,2     4096       2 /
nrpe    9948 nrpe  rtd    DIR                9,2     4096       2 /
nrpe    9948 nrpe  txt    REG                9,2    69960 1053396 /usr/sbin/nrpe
nrpe    9948 nrpe  mem    REG                9,2    62184 1053312 /usr/lib64/libnss_files-2.17.so
nrpe    9948 nrpe  mem    REG                9,2   402384 1051943 /usr/lib64/libpcre.so.1.2.0
nrpe    9948 nrpe  mem    REG                9,2   155784 1057231 /usr/lib64/libselinux.so.1
nrpe    9948 nrpe  mem    REG                9,2   144792 1051919 /usr/lib64/libpthread-2.17.so
nrpe    9948 nrpe  mem    REG                9,2   106848 1053314 /usr/lib64/libresolv-2.17.so
nrpe    9948 nrpe  mem    REG                9,2    15688 1051678 /usr/lib64/libkeyutils.so.1.5
nrpe    9948 nrpe  mem    REG                9,2    58728 1051843 /usr/lib64/libkrb5support.so.0.1
nrpe    9948 nrpe  mem    REG                9,2    90664 1051808 /usr/lib64/libz.so.1.2.7
nrpe    9948 nrpe  mem    REG                9,2    19776 1053308 /usr/lib64/libdl-2.17.so
nrpe    9948 nrpe  mem    REG                9,2   210840 1051701 /usr/lib64/libk5crypto.so.3.1
nrpe    9948 nrpe  mem    REG                9,2    15920 1051682 /usr/lib64/libcom_err.so.2.1
nrpe    9948 nrpe  mem    REG                9,2   963576 1051755 /usr/lib64/libkrb5.so.3.3
nrpe    9948 nrpe  mem    REG                9,2   320408 1051956 /usr/lib64/libgssapi_krb5.so.2.2
nrpe    9948 nrpe  mem    REG                9,2  2173512 1051792 /usr/lib64/libc-2.17.so
nrpe    9948 nrpe  mem    REG                9,2    42520 1051997 /usr/lib64/libwrap.so.0.7.6
nrpe    9948 nrpe  mem    REG                9,2   117680 1053310 /usr/lib64/libnsl-2.17.so
nrpe    9948 nrpe  mem    REG                9,2  2512832 1051648 /usr/lib64/libcrypto.so.1.0.2k
nrpe    9948 nrpe  mem    REG                9,2   470360 1051690 /usr/lib64/libssl.so.1.0.2k
nrpe    9948 nrpe  mem    REG                9,2   164240 1049135 /usr/lib64/ld-2.17.so
nrpe    9948 nrpe    0r   CHR                1,3      0t0    1028 /dev/null
nrpe    9948 nrpe    1w   CHR                1,3      0t0    1028 /dev/null
nrpe    9948 nrpe    2w   CHR                1,3      0t0    1028 /dev/null
nrpe    9948 nrpe    3u  unix 0xffff961d48d37000      0t0   19091 socket
nrpe    9948 nrpe    6u  IPv4          261850576      0t0     TCP 10.10.10.10:5666->10.10.10.254:39056 (ESTABLISHED)

As you can see the FD column shows the File Descriptor number of the opened file (network resource here) and you can use it with

gdb

to simulate closing the network socket as if the remote close it but from the same machine.

[root@srv ~]# gdb -p 9948
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Attaching to process 9948
Reading symbols from /usr/sbin/nrpe...Reading symbols from /usr/sbin/nrpe...(no debugging symbols found)...done.
(no debugging symbols found)...done.
....
....
Loaded symbols for /lib64/libpcre.so.1
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_files.so.2
0x00007f91e8295c70 in __read_nocancel () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install nrpe-3.2.0-6.el7.x86_64
(gdb) call shutdown(6, 0)
$1 = 0
(gdb) quit
A debugging session is active.

        Inferior 1 [process 9948] will be detached.

Quit anyway? (y or n) Y
Detaching from program: /usr/sbin/nrpe, process 9948

Just call

call shutdown(FileDescriptorID, 0)

and quit the gdb. In our case the FileDescriptorID is 6, so we executed

call shutdown(6, 0)

And the network socket between this machine and the remote one will be terminated, so the process nrpe could continue its execution.
Of course, in your cases you can look for a specific network connection among many other, but lsof is the tool you can use to identify the connection and the right file descriptor number to use in gdb.

Delete files in a directory with checking for the free space with find and stat command – effective and fast approach

If you have a big storage for let’s say your cache proxy and you may want to delete some files fast you could use

find

linux command to delete files. There are plenty examples in the Internet how to do it but many of them use pipes and sorts or other manipulation of the output, which could require the whole output before running some of the piped commands and if you have millions of files you could wait for an hour or two before the command to run and then to see it is not efficient for you case!
So we need a command (or commands), which begins to delete files immediately with some sort of simple selection. We can use linux command “find” with the most used options like

  • “-type f” – only files
  • “-mtime +/-N” – only files older or newer than N days. “-mtime +5” – files or directory older than 5 days and “-mtime -5” files or directory newer than 5 days
  • “-name ‘*.jpg'” – files or directories with patterns in the name *.jpg, for example “sample.jpg”

So we’ll use

  1. “find” to delete files
  2. and a while cycle periodically to check for the free space
  3. and if the free space gets greater than we would like we will kill the find command.

This approach is probably the most effective one, because we run only once the “find” command – if you have multiple runs of the find command in directory with many sub-directories it will check them on every execution in the same order – you may imagine what is like to have hundreds of thousands sub-directories full of files!

The goal is to execute only one find command and to stop it when we reach the desired free space!

So here an example:

echo "STARTING WITH /mnt/cache/"
find /mnt/cache/ -type f -name '*.jpg' -mtime +60 -delete &>/dev/null &
PID=$!
stime=60

while kill -0 "$PID" >/dev/null 2>&1; do
    FREESPACE=$(($(stat -f --format="%a*%S/1024" "/mnt/cache/")))
    if [[ $FREESPACE -gt 50000000 ]]
    then 
        kill "$PID"
        break
    fi
    echo "SLEEPING FOR $stime"
    sleep ${stime}s
done
echo "TERMINATING"
exit 0

The above piece of bash code will find in /mnt/cache/ only files with names ‘*.jpg’ and older than 60 days and will delete them. In parallel we check if the find command is still executing (because it could return finding nothing or just a small amount of files) and sleep for a 60 seconds. If there is 50000000 kylobites (50Gbytes) it will kill the find command!
Someone would argue we could have used

timeout command,

but this will kill “find” every time the check time passes and on every execution of find there will be the same files to check from the previous run!!! And if the first “find” command passed 10000 files and deleted 100, the second time it will check again this 9900 not deleted files and then will continue with the new one and if you execute it again and again you could enter in a endless loop, because the time is used only for checking the files previously checked and not deleted.

Here is the bash script with two parameters for the command line:

#!/bin/bash

if [ "$1" == "" ]
then 
        echo "USAGE: <script> <path> <time=60s>"
        exit 0
fi
if [ "$2" == "" ] || [ "$2" == 0 ]
then
        stime=60
else
        stime=$2
fi

sleep ${stime}s

echo "STARTING WITH $1"
find "$1" -type f -delete &>/dev/null &
PID=$!

while kill -0 "$PID" >/dev/null 2>&1; do
    FREESPACE=$(($(stat -f --format="%a*%S/1024" "$1")))
    if [[ $FREESPACE -gt 50000000 ]]
    then 
        kill "$PID"
        break
    fi
    echo "SLEEPING FOR $2"
    sleep ${stime}s
done
echo "TERMINATING"
exit 0

Check for the missing two parameters. The second parameter is not mandatory and the default value is 60s. Probably you can tune the script for your needs:

  • the find commands to look for specific files with name/mtime/type and so on.
  • third parameter in the command line to set minimum free space to check.
  • the time of the second parameter to be passed with the argument for s=seconds, m=minutes, h=hours and so on.

Install xmr-stak 2.4 in a machine with NVIDIA video card under Ubuntu 18.04 LTS

This is simple “how to” to get started mining crypto currency with XMR-STAK using cryptonight algorithm like monero, electroneum, intensecoin and more. This time we are going to use PPA repository for the NVIDIA drivers and the CUDA toolkit. Installing the official NVIDIA driver we can use our ASUS ROG POSEIDON GTX 1080Ti Platinum Edition to mine along with our processor AMD Ryzen Threadripper 1950X (16 cores with 32 threads with 3.4GHz base frequency and boost to 4GHz).
XMR-STAK could be used only for CPU mining, but now we installed an NVIDIA card and Ubuntu 18.04 LTS. Ubuntu is installed with the default open source NVIDIA driver (nouveau), which is OK for every day and office use, but if you like to game or to mine you must install the proprietary driver shipped by NVIDIA. The following howto will show you how to do it!

Just follow the simple steps and you’ll have an optimized GPU and CPU miner for cryptonight crypto currencies:

STEP 1) Install Ubuntu 18.04 LTS.

If you do not have Ubuntu installed yet it is time to do it. You can see how easy is to do it here even if you have multiple systems installed – Install Ubuntu Desktop 18.04 LTS on a PC with existing windows 10 and linux If your machine is only for mining and you want to have only one system it’s even simpler and you can still follow the above howto!

STEP 2) Install NVIDIA proprietary driver and CUDA Toolkit

Here we show you a brief command set to execute, but if you want a detailed explanations you could check the two howtos on the subject: Install NVIDIA proprietary drivers on Ubuntu 18.0 LTS (x86_64) and Install NVIDIA Cuda on Ubuntu 18.04 LTS (x86_64)

myuser@srv:~$ sudo apt -y update
myuser@srv:~$ sudo add-apt-repository -y ppa:graphics-drivers/ppa
myuser@srv:~$ sudo apt -y update
myuser@srv:~$ sudo ubuntu-drivers autoinstall
myuser@srv:~$ sudo reboot
myuser@srv:~$ sudo apt install -y nvidia-cuda-toolkit gcc-6

Check if your driver is loaded successfully before continuing:

myuser@srv:~$ dmesg|grep -i nvidia
[    1.414268] nvidia: loading out-of-tree module taints kernel.
[    1.414273] nvidia: module license 'NVIDIA' taints kernel.
[    1.632334] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    1.639698] nvidia-nvlink: Nvlink Core is being initialized, major device number 236
[    1.640031] nvidia 0000:0a:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[    1.640146] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  396.24.10  Tue Jul 10 10:00:18 PDT 2018 (using threaded interrupts)
[    1.647029] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  396.24.10  Tue Jul 10 08:53:56 PDT 2018
[    1.648372] [drm] [nvidia-drm] [GPU ID 0x00000a00] Loading driver
[    1.648373] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:0a:00.0 on minor 0
[   37.086767] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 511
[   37.761570] caller os_map_kernel_space.part.7+0xda/0x120 [nvidia] mapping multiple BARs
[   38.532918] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input16
[   38.532960] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input17
[   38.532996] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input18
[   38.533028] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input19
[   40.851562] caller os_map_kernel_space.part.7+0xda/0x120 [nvidia] mapping multiple BARs
[   41.205592] nvidia-modeset: Allocated GPU:0 (GPU-3bad60bf-8ff7-4cba-8b51-a931299a56d8) @ PCI:0000:0a:00.0

STEP 3) Install dependencies for XMR-STAK

Around 380Mbytes of libraries and tools to be installed in addition.

myuser@srv:~$ sudo apt -y install libboost-all-dev libleveldb-dev libcurl4-openssl-dev libmicrohttpd-dev libminiupnpc-dev libgmp-dev libmicrohttpd-dev libssl-dev cmake build-essential screen git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
build-essential set to manually installed.
The following additional packages will be installed:
  autotools-dev cmake-data dh-python gir1.2-harfbuzz-0.0 ibverbs-providers icu-devtools libboost-atomic-dev libboost-atomic1.65-dev libboost-atomic1.65.1
  libboost-chrono-dev libboost-chrono1.65-dev libboost-chrono1.65.1 libboost-container-dev libboost-container1.65-dev libboost-container1.65.1 libboost-context-dev
  libboost-context1.65-dev libboost-context1.65.1 libboost-coroutine-dev libboost-coroutine1.65-dev libboost-coroutine1.65.1 libboost-date-time-dev
  libboost-date-time1.65-dev libboost-dev libboost-exception-dev libboost-exception1.65-dev libboost-fiber-dev libboost-fiber1.65-dev libboost-fiber1.65.1
  libboost-filesystem-dev libboost-filesystem1.65-dev libboost-graph-dev libboost-graph-parallel-dev libboost-graph-parallel1.65-dev libboost-graph-parallel1.65.1
  libboost-graph1.65-dev libboost-graph1.65.1 libboost-iostreams-dev libboost-iostreams1.65-dev libboost-locale-dev libboost-locale1.65-dev libboost-log-dev
  libboost-log1.65-dev libboost-log1.65.1 libboost-math-dev libboost-math1.65-dev libboost-math1.65.1 libboost-mpi-dev libboost-mpi-python-dev libboost-mpi-python1.65-dev
  libboost-mpi-python1.65.1 libboost-mpi1.65-dev libboost-mpi1.65.1 libboost-numpy-dev libboost-numpy1.65-dev libboost-numpy1.65.1 libboost-program-options-dev
  libboost-program-options1.65-dev libboost-program-options1.65.1 libboost-python-dev libboost-python1.65-dev libboost-python1.65.1 libboost-random-dev
  libboost-random1.65-dev libboost-random1.65.1 libboost-regex-dev libboost-regex1.65-dev libboost-regex1.65.1 libboost-serialization-dev libboost-serialization1.65-dev
  libboost-serialization1.65.1 libboost-signals-dev libboost-signals1.65-dev libboost-signals1.65.1 libboost-stacktrace-dev libboost-stacktrace1.65-dev
  libboost-stacktrace1.65.1 libboost-system-dev libboost-system1.65-dev libboost-test-dev libboost-test1.65-dev libboost-test1.65.1 libboost-thread-dev
  libboost-thread1.65-dev libboost-timer-dev libboost-timer1.65-dev libboost-timer1.65.1 libboost-tools-dev libboost-type-erasure-dev libboost-type-erasure1.65-dev
  libboost-type-erasure1.65.1 libboost-wave-dev libboost-wave1.65-dev libboost-wave1.65.1 libboost1.65-dev libboost1.65-tools-dev libcurl4 libexpat1-dev libfabric1
  libgcrypt20-dev libglib2.0-dev libglib2.0-dev-bin libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libgpg-error-dev libgraphite2-dev
  libharfbuzz-dev libharfbuzz-gobject0 libhwloc-dev libhwloc-plugins libhwloc5 libibverbs-dev libibverbs1 libicu-dev libicu-le-hb-dev libicu-le-hb0 libiculx60
  libidn2-0-dev libidn2-dev libjsoncpp1 libleveldb1v5 libltdl-dev libmicrohttpd12 libnl-route-3-200 libnuma-dev libopenmpi-dev libopenmpi2 libp11-kit-dev libpcre16-3
  libpcre3-dev libpcre32-3 libpcrecpp0v5 libpsm-infinipath1 libpython-dev libpython-stdlib libpython2.7-dev libpython3-dev libpython3.6-dev librdmacm1 librhash0
  libsnappy1v5 libssl-doc libtasn1-6-dev libtasn1-doc libtool libunbound2 libuv1 mpi-default-bin mpi-default-dev nettle-dev openmpi-bin openmpi-common python python-dev
  python-minimal python2.7 python2.7-dev python2.7-minimal python3-dev python3-distutils python3-lib2to3 python3.6-dev zlib1g-dev git-man liberror-perl libutempter0
Suggested packages:
  cmake-doc ninja-build libboost-doc graphviz libboost1.65-doc gccxml libmpfrc++-dev libntl-dev xsltproc doxygen docbook-xml docbook-xsl default-jdk fop libcurl4-doc
  libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev libgcrypt20-doc libglib2.0-doc gmp-doc libgmp10-doc libmpfr-dev gnutls-doc gnutls-bin libgraphite2-utils
  libhwloc-contrib-plugins icu-doc leveldb-doc libtool-doc minissdpd openmpi-doc autoconf automaken gfortran | fortran95-compiler gcj-jdk gfortran python-doc python-tk git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn byobu | screenie | iselect
  python2.7-doc binfmt-support
The following NEW packages will be installed:
  autotools-dev cmake cmake-data dh-python gir1.2-harfbuzz-0.0 ibverbs-providers icu-devtools libboost-all-dev libboost-atomic-dev libboost-atomic1.65-dev
  libboost-atomic1.65.1 libboost-chrono-dev libboost-chrono1.65-dev libboost-chrono1.65.1 libboost-container-dev libboost-container1.65-dev libboost-container1.65.1
  libboost-context-dev libboost-context1.65-dev libboost-context1.65.1 libboost-coroutine-dev libboost-coroutine1.65-dev libboost-coroutine1.65.1 libboost-date-time-dev
  libboost-date-time1.65-dev libboost-dev libboost-exception-dev libboost-exception1.65-dev libboost-fiber-dev libboost-fiber1.65-dev libboost-fiber1.65.1
  libboost-filesystem-dev libboost-filesystem1.65-dev libboost-graph-dev libboost-graph-parallel-dev libboost-graph-parallel1.65-dev libboost-graph-parallel1.65.1
  libboost-graph1.65-dev libboost-graph1.65.1 libboost-iostreams-dev libboost-iostreams1.65-dev libboost-locale-dev libboost-locale1.65-dev libboost-log-dev
  libboost-log1.65-dev libboost-log1.65.1 libboost-math-dev libboost-math1.65-dev libboost-math1.65.1 libboost-mpi-dev libboost-mpi-python-dev libboost-mpi-python1.65-dev
  libboost-mpi-python1.65.1 libboost-mpi1.65-dev libboost-mpi1.65.1 libboost-numpy-dev libboost-numpy1.65-dev libboost-numpy1.65.1 libboost-program-options-dev
  libboost-program-options1.65-dev libboost-program-options1.65.1 libboost-python-dev libboost-python1.65-dev libboost-python1.65.1 libboost-random-dev
  libboost-random1.65-dev libboost-random1.65.1 libboost-regex-dev libboost-regex1.65-dev libboost-regex1.65.1 libboost-serialization-dev libboost-serialization1.65-dev
  libboost-serialization1.65.1 libboost-signals-dev libboost-signals1.65-dev libboost-signals1.65.1 libboost-stacktrace-dev libboost-stacktrace1.65-dev
  libboost-stacktrace1.65.1 libboost-system-dev libboost-system1.65-dev libboost-test-dev libboost-test1.65-dev libboost-test1.65.1 libboost-thread-dev
  libboost-thread1.65-dev libboost-timer-dev libboost-timer1.65-dev libboost-timer1.65.1 libboost-tools-dev libboost-type-erasure-dev libboost-type-erasure1.65-dev
  libboost-type-erasure1.65.1 libboost-wave-dev libboost-wave1.65-dev libboost-wave1.65.1 libboost1.65-dev libboost1.65-tools-dev libcurl4 libcurl4-openssl-dev
  libexpat1-dev libfabric1 libgcrypt20-dev libglib2.0-dev libglib2.0-dev-bin libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev libgnutlsxx28
  libgpg-error-dev libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libhwloc-dev libhwloc-plugins libhwloc5 libibverbs-dev libibverbs1 libicu-dev libicu-le-hb-dev
  libicu-le-hb0 libiculx60 libidn2-0-dev libidn2-dev libjsoncpp1 libleveldb-dev libleveldb1v5 libltdl-dev libmicrohttpd-dev libmicrohttpd12 libminiupnpc-dev
  libnl-route-3-200 libnuma-dev libopenmpi-dev libopenmpi2 libp11-kit-dev libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpsm-infinipath1 libpython-dev
  libpython-stdlib libpython2.7-dev libpython3-dev libpython3.6-dev librdmacm1 librhash0 libsnappy1v5 libssl-dev libssl-doc libtasn1-6-dev libtasn1-doc libtool
  libunbound2 libuv1 mpi-default-bin mpi-default-dev nettle-dev openmpi-bin openmpi-common python python-dev python-minimal python2.7 python2.7-dev python2.7-minimal
  python3-dev python3-distutils python3-lib2to3 python3.6-dev zlib1g-dev git git-man liberror-perl libutempter0 screen
0 upgraded, 179 newly installed, 0 to remove and 26 not upgraded.
Need to get 76.9 MB of archives.
After this operation, 380 MB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu bionic/main amd64 python2.7-minimal amd64 2.7.15~rc1-1 [1292 kB]
....
....

Tune the screen program (this is not mandatory, but is important to have good scrolling) and start screen.

myuser@srv:~$ echo "termcapinfo xterm* ti@:te@" >> ~/.screenrc
myuser@srv:~$ screen -R xmr-stak

STEP 4) Compile XMR-STAK

First get the sources from the official github repository. The master is now with tag 2.4.7. If you do not know how to work with git and want the exact tag version it is easy, just open in the browser “https://github.com/fireice-uk/xmr-stak” change “Branch:master” (click on it and a dropdown will appear, click the tab “Tag” and select your tag version) to “Tag:2.4.7” then click on “Clone or download” on the right and click on “Download ZIP” and it will offer you to download a zip file with the name 2.4.7.zip (here is the URL: https://codeload.github.com/fireice-uk/xmr-stak/zip/2.4.7).
This step it is important to note that we MUST build XMR-STAK with GNU GCC 6 (6.4.0) and the default GNU GCC in Ubuntu 18.04 LTS is 7 (7.3.0), so we export environment variables “CC” and “CXX” to use gcc-6. Exporting CC and CXX is enough to compile succeessfully no need to mess with “update-alternatives”.

myuser@srv:~$ git clone https://github.com/fireice-uk/xmr-stak
Cloning into 'xmr-stak'...
remote: Counting objects: 5078, done.
remote: Total 5078 (delta 0), reused 0 (delta 0), pack-reused 5078
Receiving objects: 100% (5078/5078), 1.48 MiB | 1.86 MiB/s, done.
Resolving deltas: 100% (3628/3628), done.
myuser@srv:~$ #or just download the tag version 2.4.7 from this url: https://codeload.github.com/fireice-uk/xmr-stak/zip/2.4.7 or as it was described above. This 3 lines are comments, if you want tag 2.4.7 just uncomment the second and the third lines
myuser@srv:~$ #wget https://codeload.github.com/fireice-uk/xmr-stak/zip/2.4.7
myuser@srv:~$ #unzip 2.4.7.zip
myuser@srv:~$ mkdir -p ./xmr-stak/build
myuser@srv:~$ cd ./xmr-stak/build
myuser@srv:~/xmr-stak/build$ export CFLAGS="-O2 -march=native -msse3 -fomit-frame-pointer -pipe"
myuser@srv:~/xmr-stak/build$ export CHOST="x86_64-pc-linux-gnu"
myuser@srv:~/xmr-stak/build$ export CXXFLAGS="${CFLAGS}"
myuser@srv:~/xmr-stak/build$ export LDFLAGS="-Wl,-O1"
myuser@srv:~/xmr-stak/build$ export CC=/usr/bin/gcc-6
myuser@srv:~/xmr-stak/build$ export CXX=/usr/bin/g++-6
myuser@srv:~/xmr-stak/build$ cmake ../
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/bin/gcc-6
-- Check for working C compiler: /usr/bin/gcc-6 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-6
-- Check for working CXX compiler: /usr/bin/g++-6 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr (found suitable version "9.1", minimum required is "7.5") 
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - found
-- Found OpenCL: /usr/lib/x86_64-linux-gnu/libOpenCL.so (found version "2.2") 
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.0g") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/myuser/xmr-stak/build
myuser@srv:~/xmr-stak/build$ make -j 16
Scanning dependencies of target xmr-stak-c
[  8%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_jh.c.o
[  8%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_blake256.c.o
[  8%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_skein.c.o
[ 11%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_groestl.c.o
[ 14%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_keccak.c.o
[ 17%] Linking C static library bin/libxmr-stak-c.a
[ 17%] Built target xmr-stak-c
Scanning dependencies of target xmr-stak-backend
[ 20%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/version.cpp.o
[ 22%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/jconf.cpp.o
[ 25%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/backendConnector.cpp.o
[ 28%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/telemetry.cpp.o
[ 34%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/jpsock.cpp.o
[ 34%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/executor.cpp.o
[ 37%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/httpd.cpp.o
[ 42%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/hwlocMemory.cpp.o
[ 42%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/jconf.cpp.o
[ 45%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/crypto/cryptonight_common.cpp.o
[ 48%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/minethd.cpp.o
[ 51%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/console.cpp.o
[ 54%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/globalStates.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/webdesign.cpp.o
[ 60%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/uac.cpp.o
[ 62%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/utility.cpp.o
[ 65%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/socket.cpp.o
[ 68%] Linking CXX static library bin/libxmr-stak-backend.a
[ 68%] Built target xmr-stak-backend
[ 71%] Building NVCC (Device) object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_extra.cu.o
[ 74%] Building NVCC (Device) object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_core.cu.o
Scanning dependencies of target xmr-stak
Scanning dependencies of target xmrstak_opencl_backend
[ 77%] Building CXX object CMakeFiles/xmr-stak.dir/xmrstak/cli/cli-miner.cpp.o
[ 85%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/jconf.cpp.o
[ 85%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/amd_gpu/gpu.cpp.o
[ 85%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/minethd.cpp.o
[ 88%] Linking CXX executable bin/xmr-stak
[ 88%] Built target xmr-stak
[ 91%] Linking CXX shared library bin/libxmrstak_opencl_backend.so
[ 91%] Built target xmrstak_opencl_backend
Scanning dependencies of target xmrstak_cuda_backend
[ 94%] Building CXX object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/jconf.cpp.o
[ 97%] Building CXX object CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/minethd.cpp.o
[100%] Linking CXX shared library bin/libxmrstak_cuda_backend.so
[100%] Built target xmrstak_cuda_backend
myuser@srv:~/xmr-stak/build$

STEP 5) Execute XMR-STAK, but before you must execute some tuning exports for the GPU and the linux kernel

Now is the time to use XMR-STAK.

myuser@srv:~/xmr-stak/build$ sudo sysctl -w vm.nr_hugepages=128
myuser@srv:~/xmr-stak/build$ export GPU_FORCE_64BIT_PTR=0
myuser@srv:~/xmr-stak/build$ export GPU_MAX_HEAP_SIZE=100
myuser@srv:~/xmr-stak/build$ export GPU_USE_SYNC_OBJECTS=1
myuser@srv:~/xmr-stak/build$ export GPU_MAX_ALLOC_PERCENT=100
myuser@srv:~/xmr-stak/build$ export GPU_SINGLE_ALLOC_PERCENT=100
myuser@srv:~/xmr-stak/build$ cd ./bin
myuser@srv:~/xmr-stak/build/bin$ ls -la
total 35804
drwxrwxr-x 2 myuser myuser     4096 Jul 19 16:13 .
drwxrwxr-x 4 myuser myuser     4096 Jul 19 16:05 ..
-rw-rw-r-- 1 myuser myuser  1614230 Jul 19 16:05 libxmr-stak-backend.a
-rw-rw-r-- 1 myuser myuser    75182 Jul 19 16:05 libxmr-stak-c.a
-rwxrwxr-x 1 myuser myuser 32570440 Jul 19 16:13 libxmrstak_cuda_backend.so
-rwxrwxr-x 1 myuser myuser  1307456 Jul 19 16:06 libxmrstak_opencl_backend.so
-rwxrwxr-x 1 myuser myuser  1075784 Jul 19 16:06 xmr-stak
myuser@srv:~/xmr-stak/build/bin$ ./xmr-stak 

Always execute the exports before running the xmr-stak binary.
As you can see the XMR-STAK is in

./bin/xmr-stak

under the “~/xmr-stak/build”.

STEP 6) Mining with XMR-STAK.

Execute the program and follow the first run questions. Here you can see a MONERO configuration and the first run – Mining Monero with xmr-stak 2.4 in a machine with NVIDIA video card under Ubuntu 18.04 LTS.

* Options of the XMR-STAK program

As you can see all the algo you can use with this program – new and classic (the old) criptonight coins to mine like Monero, Electroneum, IntenseCoin and many more!

myuser@srv:~/xmr-stak/build/bin$ ./xmr-stak --help
Usage: xmr-stak [OPTION]...
 
  -h, --help                 show this help
  -v, --version              show version number
  -V, --version-long         show long version number
  -c, --config FILE          common miner configuration file
  -C, --poolconf FILE        pool configuration file
  --benchmark BLOCKVERSION   ONLY do a benchmark and exit
  --benchwait WAIT_SEC             ... benchmark wait time
  --benchwork WORK_SEC             ... benchmark work time
  --noCPU                    disable the CPU miner backend
  --cpu FILE                 CPU backend miner config file
  --noAMD                    disable the AMD miner backend
  --noAMDCache               disable the AMD(OpenCL) cache for precompiled binaries
  --openCLVendor VENDOR      use OpenCL driver of VENDOR and devices [AMD,NVIDIA]
                             default: AMD
  --amd FILE                 AMD backend miner config file
  --noNVIDIA                 disable the NVIDIA miner backend
  --nvidia FILE              NVIDIA backend miner config file
  -i --httpd HTTP_PORT       HTTP interface port
 
The following options can be used for automatic start without a guided config,
If config exists then this pool will be top priority.
  -o, --url URL              pool url and port, e.g. pool.usxmrpool.com:3333
  -O, --tls-url URL          TLS pool url and port, e.g. pool.usxmrpool.com:10443
  -u, --user USERNAME        pool user name or wallet address
  -r, --rigid RIGID          rig identifier for pool-side statistics (needs pool support)
  -p, --pass PASSWD          pool password, in the most cases x or empty ""
  --use-nicehash             the pool should run in nicehash mode
  --currency NAME            currency to mine

Supported coin options: 
        - aeon7
        - bbscoin
        - bittube
        - cryptonight
        - cryptonight_bittube2
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v7_stellite
        - graft
        - haven
        - intense
        - masari
        - monero7
        - ryo
        - stellite
        - turtlecoin

Version: xmr-stak 2.4.7 c5f0505
Brought to by fireice_uk and psychocrypt under GPLv3.

* Troubleshooting – the right version of GNU GCC

You must use GNU GCC 6, because version above 6 (7 and 8) are not supported by the NVIDIA 9.1 Toolkit. So if you end up with this error you must change to the version to 6 from 7 (the default in Ubuntu 18.04 LTS is GNU 7.3.0). GNU GCC 6 was installed as a dependency to NVIDIA 9.1 Toolkit in STEP 2) and we exported two environments “CC” and “CCX” in STEP 4)

[ 85%] Building CXX object CMakeFiles/xmrstak_opencl_backend.dir/xmrstak/backend/amd/jconf.cpp.o
In file included from /usr/include/host_config.h:50:0,
                 from /usr/include/cuda_runtime.h:78,
                 from <command-line>:0:
/usr/include/crt/host_config.h:121:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
 #error -- unsupported GNU version! gcc versions later than 6 are not supported!
  ^~~~~
In file included from /usr/include/host_config.h:50:0,
                 from /usr/include/cuda_runtime.h:78,
                 from <command-line>:0:
/usr/include/crt/host_config.h:121:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
 #error -- unsupported GNU version! gcc versions later than 6 are not supported!
  ^~~~~
CMake Error at xmrstak_cuda_backend_generated_cuda_core.cu.o.Release.cmake:219 (message):
  Error generating
  /home/myuser/xmr-stak/build/CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/./xmrstak_cuda_backend_generated_cuda_core.cu.o


CMakeFiles/xmrstak_cuda_backend.dir/build.make:63: recipe for target 'CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_core.cu.o' failed
make[2]: *** [CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_core.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at xmrstak_cuda_backend_generated_cuda_extra.cu.o.Release.cmake:219 (message):
  Error generating
  /home/myuser/xmr-stak/build/CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/./xmrstak_cuda_backend_generated_cuda_extra.cu.o


CMakeFiles/xmrstak_cuda_backend.dir/build.make:70: recipe for target 'CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_extra.cu.o' failed
make[2]: *** [CMakeFiles/xmrstak_cuda_backend.dir/xmrstak/backend/nvidia/nvcc_code/xmrstak_cuda_backend_generated_cuda_extra.cu.o] Error 1
CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/xmrstak_cuda_backend.dir/all' failed
make[1]: *** [CMakeFiles/xmrstak_cuda_backend.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 88%] Linking CXX executable bin/xmr-stak
[ 88%] Built target xmr-stak
[ 91%] Linking CXX shared library bin/libxmrstak_opencl_backend.so
[ 91%] Built target xmrstak_opencl_backend
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

The solution is simple as said, just export CC and CXX before compilation in the same terminal console:

myuser@srv:~$ export CC=/usr/bin/gcc-6
myuser@srv:~$ export CXX=/usr/bin/g++-6

Mining Monero with xmr-stak 2.4 in a machine with NVIDIA video card under Ubuntu 18.04 LTS

Here are all the steps you need to begin mining Monero crypto coin with XMR-STAK 2.4. We can use our ASUS ROG POSEIDON GTX 1080Ti Platinum Edition to mine along with our processor AMD Ryzen Threadripper 1950X (16 cores with 32 threads with 3.4GHz base frequency and boost to 4GHz). As you’ll see our processor has better performance with cryptonight v7 than our GPU.

STEP 1) Install all the needed software

  1. Install linux distro – Ubuntu 18.04 LTS
  2. Install NVIDIA proprietary driver
  3. Install NVIDIA CURA Toolkit
  4. Build XMR-STAK

This step is a matter of another howto, you can check all the step and detail explanations here – Install xmr-stak 2.4 in a machine with NVIDIA video card under Ubuntu 18.04 LTS. Skip it if you just followed the above howto and you want to see an example of how to mine the Monero coins with XMR-STAK using CPU and GPU power.

STEP 2) First run of XMR-STAK

If you followed our howto above you should have installed XMR-STAK in “~/xmr-stak/build/bin”, so all the examples will be run from this directory.

myuser@srv:~/xmr-stak/build/bin$ ./xmr-stak 
Please enter:
- Do you want to use the HTTP interface?
Unlike the screen display, the browser interface is not affected by the GPU lag.
If you don't want to use it, please enter 0, otherwise enter port number that the miner should listen on
0
Configuration stored in file 'config.txt'
Please enter:
- Please enter the currency that you want to mine: 
        - aeon7
        - bbscoin
        - bittube
        - cryptonight
        - cryptonight_bittube2
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v7_stellite
        - graft
        - haven
        - intense
        - masari
        - monero7
        - ryo
        - stellite
        - turtlecoin

cryptonight_v7
- Pool address: e.g. pool.example.com:3333
pool.monero.spacepools.org:3333
- Username (wallet address or pool login):
111111111111111111111111111111111111111111111111111111111111111111111
- Password (mostly empty or x):
mining@example.com
- Rig identifier for pool-side statistics (needs pool support). Can be empty:

- Does this pool port support TLS/SSL? Use no if unknown. (y/N)
N
- Do you want to use nicehash on this pool? (y/n)
n
- Do you want to use multiple pools? (y/n)
n
Pool configuration stored in file 'pools.txt'
-------------------------------------------------------------------
xmr-stak 2.4.7 c5f0505

Brought to you by fireice_uk and psychocrypt under GPLv3.
Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).
Based on NVIDIA mining code by KlausT and psychocrypt.
Based on OpenCL mining code by wolf9466.

Configurable dev donation level is set to 2.0%

You can use following keys to display reports:
'h' - hashrate
'r' - results
'c' - connection
-------------------------------------------------------------------
[2018-07-20 03:13:52] : Mining coin: cryptonight_v7
[2018-07-20 03:13:52] : NVIDIA: GPU configuration stored in file 'nvidia.txt'
[2018-07-20 03:13:52] : Starting NVIDIA GPU thread 0, no affinity.
[2018-07-20 03:13:52] : WARNING: No AMD OpenCL platform found. Possible driver issues or wrong vendor driver.
[2018-07-20 03:13:52] : WARNING: backend AMD (OpenCL) disabled.
[2018-07-20 03:13:52] : CPU configuration stored in file 'cpu.txt'
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 0.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 1.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 2.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 3.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 4.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 5.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 6.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 7.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 8.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 9.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 10.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 11.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 12.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 13.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 14.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Starting 1x thread, affinity: 15.
[2018-07-20 03:13:52] : hwloc: memory pinned
[2018-07-20 03:13:52] : Fast-connecting to pool.monero.spacepools.org:3333 pool ...
[2018-07-20 03:13:52] : Pool pool.monero.spacepools.org:3333 connected. Logging in...
[2018-07-20 03:13:53] : Difficulty changed. Now: 50000.
[2018-07-20 03:13:53] : Pool logged in.
[2018-07-20 03:14:16] : Result accepted by the pool.
[2018-07-20 03:14:23] : Difficulty changed. Now: 35000.
[2018-07-20 03:14:23] : New block detected.
[2018-07-20 03:14:24] : Result accepted by the pool.
[2018-07-20 03:14:27] : Result accepted by the pool.
[2018-07-20 03:14:38] : Difficulty changed. Now: 45500.
[2018-07-20 03:14:38] : New block detected.
[2018-07-20 03:14:53] : Difficulty changed. Now: 31850.
[2018-07-20 03:14:53] : New block detected.
[2018-07-20 03:14:59] : Result accepted by the pool.
[2018-07-20 03:15:06] : Result accepted by the pool.
[2018-07-20 03:15:08] : Difficulty changed. Now: 41405.
[2018-07-20 03:15:08] : New block detected.
[2018-07-20 03:15:18] : Result accepted by the pool.
[2018-07-20 03:15:23] : Difficulty changed. Now: 51756.
[2018-07-20 03:15:23] : New block detected.
[2018-07-20 03:15:38] : Difficulty changed. Now: 38817.
[2018-07-20 03:15:38] : New block detected.
[2018-07-20 03:16:08] : New block detected.
[2018-07-20 03:16:08] : Difficulty changed. Now: 27172.
[2018-07-20 03:16:08] : New block detected.
[2018-07-20 03:16:08] : Result accepted by the pool.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   (na) |  1 |   80.7 |   80.7 |   (na) |
|  2 |   80.7 |   80.7 |   (na) |  3 |   80.7 |   80.7 |   (na) |
|  4 |   81.2 |   81.1 |   (na) |  5 |   81.2 |   81.1 |   (na) |
|  6 |   81.2 |   81.1 |   (na) |  7 |   81.2 |   81.1 |   (na) |
|  8 |   80.8 |   81.0 |   (na) |  9 |   80.5 |   81.0 |   (na) |
| 10 |   81.0 |   81.1 |   (na) | 11 |   81.0 |   81.0 |   (na) |
| 12 |   81.2 |   81.2 |   (na) | 13 |   81.2 |   81.2 |   (na) |
| 14 |   81.1 |   81.1 |   (na) | 15 |   81.2 |   81.2 |   (na) |
Totals (CPU):  1295.2 1295.8    0.0 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |   (na) |  772.2 |   (na) |
Totals (NVIDIA):     0.0  772.2    0.0 H/s
-----------------------------------------------------------------
Totals (ALL):   1295.2 2068.0    0.0 H/s
Highest:  2069.8 H/s
-----------------------------------------------------------------
[2018-07-20 03:16:15] : Result accepted by the pool.
RESULT REPORT
Difficulty       : 27172
Good results     : 8 / 8 (100.0 %)
Avg result time  : 17.6 sec
Pool-side hashes : 279449

Top 10 best results found:
|  0 |           179318 |  1 |            98494 |
|  2 |            65145 |  3 |            59550 |
|  4 |            58982 |  5 |            50332 |
|  6 |            42050 |  7 |            34703 |
|  8 |                0 |  9 |                0 |

Error details:
Yay! No errors.
[2018-07-20 03:16:23] : Difficulty changed. Now: 35324.
[2018-07-20 03:16:23] : New block detected.
[2018-07-20 03:16:38] : Difficulty changed. Now: 24727.
[2018-07-20 03:16:38] : New block detected.
[2018-07-20 03:16:42] : Result accepted by the pool.
[2018-07-20 03:16:49] : Result accepted by the pool.
[2018-07-20 03:16:53] : Difficulty changed. Now: 32145.
[2018-07-20 03:16:53] : New block detected.
[2018-07-20 03:16:55] : Result accepted by the pool.
[2018-07-20 03:17:08] : Difficulty changed. Now: 41789.
[2018-07-20 03:17:08] : New block detected.
[2018-07-20 03:17:23] : Difficulty changed. Now: 29252.
[2018-07-20 03:17:23] : New block detected.
[2018-07-20 03:17:47] : Result accepted by the pool.
[2018-07-20 03:17:53] : Difficulty changed. Now: 20476.
[2018-07-20 03:17:53] : New block detected.
[2018-07-20 03:17:54] : Result accepted by the pool.
[2018-07-20 03:18:00] : Result accepted by the pool.
[2018-07-20 03:18:08] : Difficulty changed. Now: 26619.
[2018-07-20 03:18:08] : New block detected.
[2018-07-20 03:18:15] : Result accepted by the pool.
[2018-07-20 03:18:21] : Result accepted by the pool.
[2018-07-20 03:18:23] : Difficulty changed. Now: 34605.
[2018-07-20 03:18:23] : New block detected.
[2018-07-20 03:18:30] : Result accepted by the pool.
[2018-07-20 03:18:30] : Result accepted by the pool.
[2018-07-20 03:18:36] : Result accepted by the pool.
[2018-07-20 03:18:38] : Difficulty changed. Now: 44987.
[2018-07-20 03:18:38] : New block detected.
[2018-07-20 03:18:53] : Difficulty changed. Now: 39694.
[2018-07-20 03:18:53] : New block detected.
[2018-07-20 03:18:55] : Result accepted by the pool.
[2018-07-20 03:18:56] : Result accepted by the pool.
[2018-07-20 03:19:08] : Difficulty changed. Now: 51602.
[2018-07-20 03:19:08] : New block detected.
[2018-07-20 03:19:23] : Difficulty changed. Now: 36121.
[2018-07-20 03:19:23] : New block detected.
[2018-07-20 03:19:28] : New block detected.
[2018-07-20 03:19:37] : Result accepted by the pool.
[2018-07-20 03:20:01] : Result accepted by the pool.
[2018-07-20 03:20:08] : Difficulty changed. Now: 28517.
[2018-07-20 03:20:08] : New block detected.
[2018-07-20 03:20:08] : New block detected.
[2018-07-20 03:20:23] : Difficulty changed. Now: 19962.
[2018-07-20 03:20:23] : New block detected.
[2018-07-20 03:20:23] : Result accepted by the pool.
[2018-07-20 03:20:30] : Result accepted by the pool.
[2018-07-20 03:20:31] : Result accepted by the pool.
[2018-07-20 03:20:38] : Difficulty changed. Now: 25951.
[2018-07-20 03:20:38] : New block detected.
[2018-07-20 03:20:45] : Result accepted by the pool.
[2018-07-20 03:21:08] : Difficulty changed. Now: 21041.
[2018-07-20 03:21:08] : New block detected.
[2018-07-20 03:21:18] : Result accepted by the pool.
[2018-07-20 03:21:23] : Difficulty changed. Now: 27353.
[2018-07-20 03:21:23] : New block detected.
[2018-07-20 03:21:26] : Result accepted by the pool.
[2018-07-20 03:21:32] : Result accepted by the pool.
[2018-07-20 03:21:35] : Result accepted by the pool.
[2018-07-20 03:21:38] : Difficulty changed. Now: 35559.
[2018-07-20 03:21:38] : New block detected.
[2018-07-20 03:21:53] : Difficulty changed. Now: 29633.
[2018-07-20 03:21:53] : New block detected.
[2018-07-20 03:21:55] : Result accepted by the pool.
[2018-07-20 03:22:08] : Difficulty changed. Now: 38523.
[2018-07-20 03:22:08] : New block detected.
[2018-07-20 03:22:23] : Difficulty changed. Now: 26966.
[2018-07-20 03:22:23] : New block detected.
[2018-07-20 03:22:28] : Result accepted by the pool.
[2018-07-20 03:22:38] : Difficulty changed. Now: 35056.
[2018-07-20 03:22:38] : New block detected.
[2018-07-20 03:22:49] : Result accepted by the pool.
[2018-07-20 03:22:52] : Result accepted by the pool.
[2018-07-20 03:22:53] : Difficulty changed. Now: 43820.
[2018-07-20 03:22:53] : New block detected.
[2018-07-20 03:23:00] : Result accepted by the pool.
[2018-07-20 03:23:08] : Difficulty changed. Now: 56966.
[2018-07-20 03:23:08] : New block detected.
[2018-07-20 03:23:13] : Result accepted by the pool.
[2018-07-20 03:23:23] : Difficulty changed. Now: 65730.
[2018-07-20 03:23:23] : New block detected.
[2018-07-20 03:23:23] : Result accepted by the pool.
[2018-07-20 03:23:30] : New block detected.
[2018-07-20 03:23:38] : Difficulty changed. Now: 85449.
[2018-07-20 03:23:38] : New block detected.
[2018-07-20 03:23:53] : Difficulty changed. Now: 59814.
[2018-07-20 03:23:53] : New block detected.
[2018-07-20 03:24:07] : Result accepted by the pool.
[2018-07-20 03:24:35] : New block detected.
[2018-07-20 03:24:38] : Difficulty changed. Now: 41870.
[2018-07-20 03:24:38] : New block detected.
[2018-07-20 03:25:08] : Difficulty changed. Now: 29309.
[2018-07-20 03:25:08] : New block detected.
[2018-07-20 03:25:38] : Difficulty changed. Now: 20516.
[2018-07-20 03:25:38] : New block detected.
[2018-07-20 03:25:49] : Result accepted by the pool.
[2018-07-20 03:25:53] : Difficulty changed. Now: 26671.
[2018-07-20 03:25:53] : New block detected.
[2018-07-20 03:26:08] : Difficulty changed. Now: 21056.
[2018-07-20 03:26:08] : New block detected.
[2018-07-20 03:26:15] : Result accepted by the pool.
[2018-07-20 03:26:22] : Result accepted by the pool.
[2018-07-20 03:26:23] : Difficulty changed. Now: 27373.
[2018-07-20 03:26:23] : New block detected.
[2018-07-20 03:26:52] : Result accepted by the pool.
[2018-07-20 03:26:53] : Difficulty changed. Now: 19161.
[2018-07-20 03:26:53] : New block detected.
[2018-07-20 03:26:56] : Result accepted by the pool.
[2018-07-20 03:27:08] : Difficulty changed. Now: 24909.
[2018-07-20 03:27:08] : New block detected.
[2018-07-20 03:27:19] : Result accepted by the pool.
[2018-07-20 03:27:23] : Difficulty changed. Now: 17436.
[2018-07-20 03:27:23] : New block detected.
[2018-07-20 03:27:26] : Result accepted by the pool.
[2018-07-20 03:27:36] : Result accepted by the pool.
[2018-07-20 03:27:38] : Difficulty changed. Now: 22667.
[2018-07-20 03:27:38] : New block detected.
[2018-07-20 03:27:43] : Result accepted by the pool.
[2018-07-20 03:27:43] : Result accepted by the pool.
[2018-07-20 03:27:49] : Result accepted by the pool.
[2018-07-20 03:27:53] : Difficulty changed. Now: 29467.
[2018-07-20 03:27:53] : New block detected.
[2018-07-20 03:27:57] : Result accepted by the pool.
[2018-07-20 03:28:00] : Result accepted by the pool.
[2018-07-20 03:28:03] : Result accepted by the pool.
[2018-07-20 03:28:08] : Difficulty changed. Now: 38307.
[2018-07-20 03:28:08] : New block detected.
[2018-07-20 03:28:23] : Difficulty changed. Now: 28730.
[2018-07-20 03:28:23] : New block detected.
[2018-07-20 03:28:30] : Result accepted by the pool.
[2018-07-20 03:28:30] : Result accepted by the pool.
[2018-07-20 03:28:35] : Result accepted by the pool.
[2018-07-20 03:28:37] : Result accepted by the pool.
[2018-07-20 03:28:37] : Result accepted by the pool.
[2018-07-20 03:28:38] : Difficulty changed. Now: 37349.
[2018-07-20 03:28:38] : New block detected.
[2018-07-20 03:29:07] : Result accepted by the pool.
[2018-07-20 03:29:08] : Difficulty changed. Now: 26144.
[2018-07-20 03:29:08] : New block detected.
[2018-07-20 03:29:36] : Result accepted by the pool.
[2018-07-20 03:29:38] : Result accepted by the pool.
[2018-07-20 03:29:38] : Difficulty changed. Now: 18301.
[2018-07-20 03:29:38] : New block detected.
[2018-07-20 03:29:41] : Result accepted by the pool.
[2018-07-20 03:29:45] : Result accepted by the pool.
[2018-07-20 03:29:50] : Result accepted by the pool.
[2018-07-20 03:29:53] : Difficulty changed. Now: 23791.
[2018-07-20 03:29:53] : New block detected.
[2018-07-20 03:29:58] : New block detected.
[2018-07-20 03:29:58] : Result accepted by the pool.
[2018-07-20 03:30:08] : Difficulty changed. Now: 30928.
[2018-07-20 03:30:08] : New block detected.
[2018-07-20 03:30:12] : Result accepted by the pool.
[2018-07-20 03:30:13] : Result accepted by the pool.
[2018-07-20 03:30:23] : Difficulty changed. Now: 40206.
[2018-07-20 03:30:23] : New block detected.
[2018-07-20 03:30:24] : Result accepted by the pool.
[2018-07-20 03:30:38] : Difficulty changed. Now: 52268.
[2018-07-20 03:30:38] : New block detected.
[2018-07-20 03:30:53] : Difficulty changed. Now: 36588.
[2018-07-20 03:30:53] : New block detected.
[2018-07-20 03:31:23] : Difficulty changed. Now: 25612.
[2018-07-20 03:31:23] : New block detected.
[2018-07-20 03:31:53] : Difficulty changed. Now: 17928.
[2018-07-20 03:31:53] : New block detected.
[2018-07-20 03:31:53] : Result accepted by the pool.
[2018-07-20 03:32:08] : Difficulty changed. Now: 23306.
[2018-07-20 03:32:08] : New block detected.
[2018-07-20 03:32:14] : Result accepted by the pool.
[2018-07-20 03:32:20] : Result accepted by the pool.
[2018-07-20 03:32:53] : Difficulty changed. Now: 17480.
[2018-07-20 03:32:53] : New block detected.
RESULT REPORT
Difficulty       : 17480
Good results     : 71 / 71 (100.0 %)
Avg result time  : 16.2 sec
Pool-side hashes : 2085841

Top 10 best results found:
|  0 |          4672722 |  1 |           993908 |
|  2 |           991887 |  3 |           271993 |
|  4 |           210975 |  5 |           208951 |
|  6 |           207738 |  7 |           179318 |
|  8 |           144045 |  9 |           118699 |

Error details:
Yay! No errors.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   80.3 |  1 |   80.7 |   80.7 |   80.7 |
|  2 |   80.7 |   80.7 |   80.7 |  3 |   80.7 |   80.7 |   80.7 |
|  4 |   81.2 |   81.2 |   81.2 |  5 |   81.2 |   81.2 |   81.2 |
|  6 |   81.2 |   81.2 |   81.1 |  7 |   81.2 |   81.2 |   81.2 |
|  8 |   80.7 |   81.1 |   81.0 |  9 |   80.9 |   81.1 |   81.1 |
| 10 |   80.9 |   81.0 |   81.0 | 11 |   80.9 |   81.1 |   81.1 |
| 12 |   81.0 |   81.1 |   81.1 | 13 |   81.1 |   81.1 |   81.2 |
| 14 |   81.1 |   81.1 |   81.1 | 15 |   81.1 |   81.1 |   81.2 |
Totals (CPU):  1295.1 1296.0 1295.9 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |   (na) |  771.7 |  771.5 |
Totals (NVIDIA):     0.0  771.7  771.5 H/s
-----------------------------------------------------------------
Totals (ALL):   1295.1 2067.7 2067.4 H/s
Highest:  2069.9 H/s
-----------------------------------------------------------------
[2018-07-20 03:33:07] : Result accepted by the pool.
[2018-07-20 03:33:09] : Result accepted by the pool.

You could use monero7 or cryptonight_v7to mine Monero. The pool we use is under “Pool address:” – pool.monero.spacepools.org:3333 You cannot mine crypto without to be part of a pool of other mining “people”, because the difficulty is too big for solo mining! So choose your mining pool carefully – by the “Total Pool Fee”, which for the Spacepools is 0.1% and the stability of the pool.
The username is your MONERO wallet address (we changed our to invalid 111111111111111111111111111111111111111111111111111111111111111111111, DO NOT USE THIS ADDRESS) – check this to see how you can generate monero wallet address – Generate a new Monero address (wallet). The password in most cases is your email address, with which you could change some account information in the pool web page.

It is good to see

Result accepted by the pool.

it means your discovered a hash and you are going to be awarded by the pool for your mining share! As many as “accepted results” as good as for you!

As you can see our ASUS ROG POSEIDON GTX 1080Ti Platinum Edition without any overclocking has 771.5 H/s of Cryptonight v7 algorithm!
Our AMD Ryzen Threadripper 1950X (16 cores with 32 threads with 3.4GHz base frequency and boost to 4GHz) without any overclocking has 1295.1 of Cryptonight v7 algorithm! The performance of the CPU is almost double the performance of the GPU.
Our motherboard is ASUS ROG ZENITH EXTREME with 4x8Gbytes (G.Skill Trident Z RGB DIMM Kit 32GB F4-3200C14Q-32GTZR) of RAM running in fourth channel mode.

There are three control keys to display additional information of your XMR-STAK. Press one of the key during the program execution. In the above first run we used “h” and “r”.

'h' - hashrate
'r' - results
'c' - connection

And here is the stat after 5 hours:

[2018-07-20 08:42:32] : Result accepted by the pool.
RESULT REPORT
Difficulty       : 27881
Good results     : 1266 / 1266 (100.0 %)
Avg result time  : 15.6 sec
Pool-side hashes : 41195382

Top 10 best results found:
|  0 |         86854459 |  1 |         47586423 |
|  2 |         35768342 |  3 |         25208619 |
|  4 |          8208523 |  5 |          7828657 |
|  6 |          6669723 |  7 |          6490827 |
|  8 |          6448233 |  9 |          5964065 |

Error details:
Yay! No errors.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   80.3 |  1 |   80.8 |   80.8 |   80.8 |
|  2 |   80.8 |   80.8 |   80.8 |  3 |   80.8 |   80.8 |   80.8 |
|  4 |   81.2 |   81.1 |   81.1 |  5 |   81.2 |   81.1 |   81.1 |
|  6 |   81.2 |   81.1 |   81.1 |  7 |   81.2 |   81.1 |   81.1 |
|  8 |   81.0 |   80.9 |   81.0 |  9 |   81.0 |   81.0 |   81.0 |
| 10 |   81.0 |   81.0 |   80.9 | 11 |   80.5 |   80.8 |   81.0 |
| 12 |   81.2 |   81.1 |   81.1 | 13 |   81.2 |   81.2 |   81.2 |
| 14 |   81.2 |   81.2 |   81.1 | 15 |   81.2 |   81.2 |   81.1 |
Totals (CPU):  1295.7 1295.5 1295.7 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |  773.0 |  769.9 |  771.6 |
Totals (NVIDIA):   773.0  769.9  771.6 H/s
-----------------------------------------------------------------
Totals (ALL):   2068.8 2065.4 2067.3 H/s
Highest:  2069.9 H/s
-----------------------------------------------------------------
[2018-07-20 08:42:42] : Result accepted by the pool.
[2018-07-20 08:42:43] : Difficulty changed. Now: 36245.
[2018-07-20 08:42:43] : New block detected.

Here we use https://dwarfpool.com/ and after 14 hours of mining:

[2018-07-21 02:21:05] : New block detected.
[2018-07-21 02:21:24] : Result accepted by the pool.
[2018-07-21 02:21:31] : Result accepted by the pool.
[2018-07-21 02:21:55] : Result accepted by the pool.
[2018-07-21 02:22:09] : Result accepted by the pool.
[2018-07-21 02:22:32] : Result accepted by the pool.
[2018-07-21 02:23:03] : Result accepted by the pool.
[2018-07-21 02:23:05] : Result accepted by the pool.
[2018-07-21 02:23:19] : Result accepted by the pool.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   80.3 |  1 |   80.8 |   80.8 |   80.8 |
|  2 |   80.8 |   80.8 |   80.8 |  3 |   80.8 |   80.8 |   80.8 |
|  4 |   81.2 |   81.1 |   81.2 |  5 |   81.2 |   81.1 |   81.2 |
|  6 |   81.2 |   81.1 |   81.1 |  7 |   81.2 |   81.1 |   81.2 |
|  8 |   81.0 |   80.9 |   81.0 |  9 |   81.0 |   81.0 |   81.0 |
| 10 |   81.0 |   81.0 |   81.0 | 11 |   81.0 |   80.8 |   81.0 |
| 12 |   81.1 |   81.2 |   81.2 | 13 |   81.1 |   81.2 |   81.2 |
| 14 |   81.1 |   81.1 |   81.1 | 15 |   81.0 |   81.2 |   81.2 |
Totals (CPU):  1295.8 1295.5 1295.8 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |   (na) |  769.5 |  771.1 |
Totals (NVIDIA):     0.0  769.5  771.1 H/s
-----------------------------------------------------------------
Totals (ALL):   1295.8 2065.0 2066.9 H/s
Highest:  2069.8 H/s
-----------------------------------------------------------------
RESULT REPORT
Difficulty       : 50000
Good results     : 2592 / 2595 (99.9 %)
Avg result time  : 23.1 sec
Pool-side hashes : 3300000

Top 10 best results found:
|  0 |       1257001197 |  1 |         62229932 |
|  2 |         58697077 |  3 |         13938510 |
|  4 |         13393176 |  5 |         12264166 |
|  6 |         10357917 |  7 |          8800621 |
|  8 |          8669175 |  9 |          8547001 |

Error details:
| Count | Error text                       | Last seen           |
|     3 | [NETWORK ERROR]                  | 2018-07-20 19:26:18 |
[2018-07-21 02:45:48] : Result accepted by the pool.
[2018-07-21 02:45:50] : Result accepted by the pool.
[2018-07-21 02:46:11] : New block detected.
[2018-07-21 02:46:13] : New block detected.
[2018-07-21 02:46:44] : Result accepted by the pool.
[2018-07-21 02:46:53] : Result accepted by the pool.
[2018-07-21 02:47:21] : Result accepted by the pool.
[2018-07-21 02:47:33] : Result accepted by the pool.
[2018-07-21 02:47:48] : Result accepted by the pool.
RESULT REPORT
Difficulty       : 50000
Good results     : 2657 / 2660 (99.9 %)
Avg result time  : 20.8 sec
Pool-side hashes : 1000000

Top 10 best results found:
|  0 |       1257001197 |  1 |         62229932 |
|  2 |         58697077 |  3 |         13938510 |
|  4 |         13393176 |  5 |         12264166 |
|  6 |         10357917 |  7 |          8800621 |
|  8 |          8669175 |  9 |          8547001 |

Error details:
| Count | Error text                       | Last seen           |
|     3 | [NETWORK ERROR]                  | 2018-07-20 19:26:18 |
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.2 |   80.3 |   77.5 |  1 |   80.7 |   80.7 |   77.9 |
|  2 |   80.7 |   80.7 |   77.9 |  3 |   80.7 |   80.7 |   77.9 |
|  4 |   81.1 |   81.1 |   78.3 |  5 |   81.1 |   81.1 |   78.3 |
|  6 |   81.1 |   81.1 |   78.3 |  7 |   81.1 |   81.1 |   78.3 |
|  8 |   81.1 |   81.0 |   78.2 |  9 |   81.1 |   81.1 |   78.2 |
| 10 |   81.1 |   81.0 |   78.2 | 11 |   81.1 |   81.1 |   78.2 |
| 12 |   81.0 |   81.1 |   78.3 | 13 |   81.1 |   81.1 |   78.3 |
| 14 |   81.0 |   81.1 |   78.3 | 15 |   81.1 |   81.1 |   78.3 |
Totals (CPU):  1295.2 1295.5 1250.7 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |   (na) |  770.5 |  745.5 |
Totals (NVIDIA):     0.0  770.5  745.5 H/s
-----------------------------------------------------------------
Totals (ALL):   1295.2 2066.0 1996.1 H/s
Highest:  2069.8 H/s
-----------------------------------------------------------------
[2018-07-21 02:48:40] : New block detected.

The difficult is constant 50000 and you see we have multiple results, so we can try to higher it with another port (check for this the configuration page of the pool – https://dwarfpool.com/xmr/). The stats is “Earning in last 24 hours: 0.00753535 XMR”, “Current balance: 0.00732356 XMR” and ” Unconfirmed: 0.00078419 XMR” (in most cases all of it will be confirmed successfully), so the total monero we mined is “0.00810775 XMR” for these 14 hours with our machine and the estimate for the next 24 hours is “0.01440000 XMR” (for the current price you’ll earn 1.832300 USD for 24hours with this machine).

Here is the https://dwarfpool.com/xmr/ with almost 24 hours with difficult 100 000:

[2018-07-22 02:04:35] : Result accepted by the pool.
[2018-07-22 02:04:37] : Result accepted by the pool.
[2018-07-22 02:04:44] : Result accepted by the pool.
[2018-07-22 02:05:29] : Result accepted by the pool.
[2018-07-22 02:05:29] : Result accepted by the pool.
RESULT REPORT
Difficulty       : 100001
Good results     : 1691 / 1693 (99.9 %)
Avg result time  : 35.2 sec
Pool-side hashes : 4800048

Top 10 best results found:
|  0 |         50511124 |  1 |         32008411 |
|  2 |         27907718 |  3 |         27563158 |
|  4 |         20638537 |  5 |         19189255 |
|  6 |         18843649 |  7 |         15123109 |
|  8 |         12496904 |  9 |         12222295 |

Error details:
| Count | Error text                       | Last seen           |
|     1 | Low difficulty share             | 2018-07-21 15:11:03 |
|     1 | [NETWORK ERROR]                  | 2018-07-21 17:22:50 |
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   80.3 |   80.3 |   80.3 |  1 |   80.7 |   80.7 |   80.7 |
|  2 |   80.7 |   80.7 |   80.7 |  3 |   80.7 |   80.7 |   80.7 |
|  4 |   81.1 |   81.2 |   81.1 |  5 |   81.1 |   81.2 |   81.1 |
|  6 |   80.8 |   81.1 |   81.1 |  7 |   81.1 |   81.2 |   81.1 |
|  8 |   80.9 |   81.0 |   81.0 |  9 |   81.0 |   81.0 |   81.0 |
| 10 |   81.0 |   81.1 |   81.1 | 11 |   81.0 |   81.1 |   81.1 |
| 12 |   81.0 |   81.1 |   81.1 | 13 |   81.0 |   81.1 |   81.1 |
| 14 |   80.9 |   81.1 |   81.1 | 15 |   81.0 |   81.1 |   81.1 |
Totals (CPU):  1294.5 1295.8 1295.6 H/s
-----------------------------------------------------------------
HASHRATE REPORT - NVIDIA
| ID |    10s |    60s |    15m |
|  0 |  771.4 |  770.7 |  771.0 |
Totals (NVIDIA):   771.4  770.7  771.0 H/s
-----------------------------------------------------------------
Totals (ALL):   2065.9 2066.5 2066.7 H/s
Highest:  2069.7 H/s
-----------------------------------------------------------------
[2018-07-22 02:06:15] : New block detected.

Current balance: 0.01082526 XMR, Unconfirmed: 0.00242919 XMR, the total is: 0.01325445 XMR, Earning in last 24 hours: 0.00603805 XMR. Next 24h earning with this speed: 0.01850000 XMR (with the current price of Monero 2.455200 USD) very approximated avg_24h_diff = 54061666755.14

Here is the nvidia-smi output

myuser@srv:~/xmr-stak/build/bin$ nvidia-smi 
Fri Jul 20 03:38:52 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.24.10              Driver Version: 396.24.10                 |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:0A:00.0  On |                  N/A |
| 46%   64C    P2   143W / 275W |  10711MiB / 11173MiB |    100%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2119      G   /usr/lib/xorg/Xorg                            59MiB |
|    0      2170      G   /usr/bin/gnome-shell                          70MiB |
|    0     20146      C   ./xmr-stak                                 10577MiB |
+-----------------------------------------------------------------------------+

The GPU is using 143W and here is the used GPU RAM 10711MiB out of 11173MiB by xmr-stak.
All CPU cores are running at 3680.374 Mhz. The uptime is

myuser@srv:~/xmr-stak/build/bin$ uptime
 03:48:37 up 18:28,  3 users,  load average: 16.04, 16.05, 14.39

After the first run there will be created 4 files in your current directory of the xmr-stak binary:

myuser@srv:~/xmr-stak/build/bin$ ls -altr
total 35824
drwxrwxr-x 4 myuser myuser     4096 Jul 19 16:05 ..
-rw-rw-r-- 1 myuser myuser    75182 Jul 19 16:05 libxmr-stak-c.a
-rw-rw-r-- 1 myuser myuser  1614230 Jul 19 16:05 libxmr-stak-backend.a
-rwxrwxr-x 1 myuser myuser  1075784 Jul 19 16:06 xmr-stak
-rwxrwxr-x 1 myuser myuser  1307456 Jul 19 16:06 libxmrstak_opencl_backend.so
-rwxrwxr-x 1 myuser myuser 32570440 Jul 19 16:13 libxmrstak_cuda_backend.so
-rw-rw-r-- 1 myuser myuser     7228 Jul 20 03:10 config.txt
-rw-rw-r-- 1 myuser myuser     2087 Jul 20 03:13 pools.txt
-rw-rw-r-- 1 myuser myuser     2032 Jul 20 03:13 nvidia.txt
-rw-rw-r-- 1 myuser myuser     2963 Jul 20 03:13 cpu.txt
drwxrwxr-x 2 myuser myuser     4096 Jul 20 03:13 .
myuser@srv:~/xmr-stak/build/bin$

The configuration files are

  • config.txt – the general config
  • pools.txt – configuration for what coin your are mining and which pool you are using. You can tune the rig naming and additional pools.
  • nvidia.txt – configuration for GPU miner part – GPU threads, blocks and affine_to_cpu. Definitely check this out.
  • cpu.txt – configuration for the cpu miner part – Thread configuration for each thread – a line for each core. CPU affinity, power mode and more.

These files are generated on the first run with default values and then you could quit the xmr-stak and edit the files with text editor.

* Options of the XMR-STAK program

As you can see all the algo you can use with this program – new and classic (the old) criptonight coins to mine like Monero, Electroneum, IntenseCoin and many more!

myuser@srv:~/xmr-stak/build/bin$ ./xmr-stak --help
Usage: xmr-stak [OPTION]...
 
  -h, --help                 show this help
  -v, --version              show version number
  -V, --version-long         show long version number
  -c, --config FILE          common miner configuration file
  -C, --poolconf FILE        pool configuration file
  --benchmark BLOCKVERSION   ONLY do a benchmark and exit
  --benchwait WAIT_SEC             ... benchmark wait time
  --benchwork WORK_SEC             ... benchmark work time
  --noCPU                    disable the CPU miner backend
  --cpu FILE                 CPU backend miner config file
  --noAMD                    disable the AMD miner backend
  --noAMDCache               disable the AMD(OpenCL) cache for precompiled binaries
  --openCLVendor VENDOR      use OpenCL driver of VENDOR and devices [AMD,NVIDIA]
                             default: AMD
  --amd FILE                 AMD backend miner config file
  --noNVIDIA                 disable the NVIDIA miner backend
  --nvidia FILE              NVIDIA backend miner config file
  -i --httpd HTTP_PORT       HTTP interface port
 
The following options can be used for automatic start without a guided config,
If config exists then this pool will be top priority.
  -o, --url URL              pool url and port, e.g. pool.usxmrpool.com:3333
  -O, --tls-url URL          TLS pool url and port, e.g. pool.usxmrpool.com:10443
  -u, --user USERNAME        pool user name or wallet address
  -r, --rigid RIGID          rig identifier for pool-side statistics (needs pool support)
  -p, --pass PASSWD          pool password, in the most cases x or empty ""
  --use-nicehash             the pool should run in nicehash mode
  --currency NAME            currency to mine

Supported coin options: 
        - aeon7
        - bbscoin
        - bittube
        - cryptonight
        - cryptonight_bittube2
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v7_stellite
        - graft
        - haven
        - intense
        - masari
        - monero7
        - ryo
        - stellite
        - turtlecoin

Version: xmr-stak 2.4.7 c5f0505
Brought to by fireice_uk and psychocrypt under GPLv3.

sed with delimiter – any other single character in replacing words or characters

It is not so known fact that this powerful unix world command

sed

could be used with other delimiter than “/” (when replacing words or characters), which is used in 100% of the time in the Internet examples.
You probably know the syntax from the manual like:

s/regexp/replacement/
              Attempt to match regexp against the pattern space.  If successful, replace that portion matched with replacement.  The replacement may  con‐
              tain  the special character & to refer to that portion of the pattern space which matched, and the special escapes \1 through \9 to refer to
              the corresponding matching sub-expressions in the regexp.

The Internet examples always use “/” as shown in the man, BUT you CAN use “#” instead of “/” for example:

s#regexp#replacement#g

or

s:regexp:replacement:g

or you can even use letter character (not a special character as “!@#$%#^”):

sRregexpRreplacementRg

and with “r” lower case (you see not so readable, but possible!)

srregexprreplacementrg

Here are the examples:

sed 's@else@elllllse@g' test.php
sed 's#else#elllllse#g' test.php
sed 's:else:elllllse:g' test.php
sed 's~else~elllllse~g' test.php
sed 's!else!elllllse!g' test.php
sed 'spelsepelllllsepg' test.php
sed 'sRelseRelllllseRg' test.php
#could be paired with "-i", too
sed 'spelsepelllllsepg' -i test.php
sed 'sRelseRelllllseRg' -i test.php

What does it mean to you? The simple implication is you are not forced to escape characters in your regexp and replacement part. Consider you want to replace part of a unix/linux path string: /home/myuser/Desktop/mydirectory1/myfile.log if you use the default “/” you MUST escape all the “/” in your string:

sed 's/\/home\/myuser\/Desktop\/mydirectory1\/myfile.log/\/home\/user\/Desktop\/mydirectory2\/myfile.log/g' test.log

versus the simpler and more readable version with “#”

sed 's#/home/myuser/Desktop/mydirectory1/myfile.log#/home/user/Desktop/mydirectory2/myfile.log#g' test.log

And consider you use an variable:

cat file.test | sed "s/\[version\]/${PKGVERSION}/g"

* additional explanations:

  • /g (or what ever character is used for delimiter like “@”, “:”, “~” and so on) is for “Apply the replacement to all matches to the regexp, not just the first.”
  • -i (used in some of the examples above) is for inline replacement – the file you add in the sed command will be modified and the replacement will be saved in the file (the default behavior is to show the modified output in the standard output – console output)

Install NVIDIA Cuda on Ubuntu 18.04 LTS (x86_64)

to install NVIDIA Cuda we need the NVIDIA proprietary driver working (and the libraries and files it provides). Ubuntu and most linux distributions come with the open source driver nouveau, but it is with limited performance and capabilities. For gaming and development you will need the official NVIDIA driver, the SDK and many additional proprietary libraries.
This howto is a sort of continuing the Install NVIDIA proprietary drivers on Ubuntu 18.0 LTS (x86_64) where we install the proprietary driver from the unofficial community driven repository “Graphics Drivers” team. This is Personal Package Archives (PPA) repository! So you should check it, too and be careful about this repository as the maintainers say. For completeness will include all the steps to install the NVIDIA proprietary driver (and for more details for this part just read the specific howto we offer above) and Cuda.

Here are the steps to install NVIDIA CUDA on Ubuntu 18.0 LTS (x86_64) with the help of ppa:graphics-drivers/ppa

STEP 1) Update your current repositories, add the new repository, update again and install the NVIDIA driver with the tool ubuntu-drivers

myuser@srv:~$ sudo apt -y update
myuser@srv:~$ sudo add-apt-repository -y ppa:graphics-drivers/ppa
myuser@srv:~$ sudo apt -y update
myuser@srv:~$ sudo ubuntu-drivers autoinstall
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  build-essential dkms dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-8-base:i386 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4
  libatomic1 libbsd0:i386 libc-dev-bin libc6:i386 libc6-dev libcilkrts5 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386
  libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libfakeroot libffi6:i386 libgcc-7-dev libgcc1:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386
  libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libitm1 libllvm6.0:i386 liblsan0 libmpx2 libnvidia-cfg1-396 libnvidia-common-396 libnvidia-compute-396
  libnvidia-compute-396:i386 libnvidia-decode-396 libnvidia-decode-396:i386 libnvidia-encode-396 libnvidia-encode-396:i386 libnvidia-fbc1-396
  libnvidia-fbc1-396:i386 libnvidia-gl-396 libnvidia-gl-396:i386 libnvidia-ifr1-396 libnvidia-ifr1-396:i386 libpciaccess0:i386 libquadmath0 libsensors4:i386
  libstdc++-7-dev libstdc++6:i386 libtinfo5:i386 libtsan0 libubsan0 libvdpau1 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
  libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxnvctrl0
  libxshmfence1:i386 libxxf86vm1:i386 linux-libc-dev make manpages-dev mesa-vdpau-drivers nvidia-compute-utils-396 nvidia-dkms-396 nvidia-kernel-common-396
  nvidia-kernel-source-396 nvidia-prime nvidia-settings nvidia-utils-396 pkg-config screen-resolution-extra vdpau-driver-all xserver-xorg-video-nvidia-396
  zlib1g:i386
Suggested packages:
  menu debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg gcc-multilib autoconf automake libtool flex bison gcc-doc gcc-7-multilib
  gcc-7-locales libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg
  libquadmath0-dbg glibc-doc:i386 locales:i386 glibc-doc lm-sensors:i386 libstdc++-7-doc make-doc libvdpau-va-gl1 nvidia-vdpau-driver
  nvidia-legacy-340xx-vdpau-driver
The following NEW packages will be installed:
  build-essential dkms dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-8-base:i386 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4
  libatomic1 libbsd0:i386 libc-dev-bin libc6:i386 libc6-dev libcilkrts5 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386
  libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libfakeroot libffi6:i386 libgcc-7-dev libgcc1:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386
  libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libitm1 libllvm6.0:i386 liblsan0 libmpx2 libnvidia-cfg1-396 libnvidia-common-396 libnvidia-compute-396
  libnvidia-compute-396:i386 libnvidia-decode-396 libnvidia-decode-396:i386 libnvidia-encode-396 libnvidia-encode-396:i386 libnvidia-fbc1-396
  libnvidia-fbc1-396:i386 libnvidia-gl-396 libnvidia-gl-396:i386 libnvidia-ifr1-396 libnvidia-ifr1-396:i386 libpciaccess0:i386 libquadmath0 libsensors4:i386
  libstdc++-7-dev libstdc++6:i386 libtinfo5:i386 libtsan0 libubsan0 libvdpau1 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
  libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxnvctrl0
  libxshmfence1:i386 libxxf86vm1:i386 linux-libc-dev make manpages-dev mesa-vdpau-drivers nvidia-compute-utils-396 nvidia-dkms-396 nvidia-driver-396
  nvidia-kernel-common-396 nvidia-kernel-source-396 nvidia-prime nvidia-settings nvidia-utils-396 pkg-config screen-resolution-extra vdpau-driver-all
  xserver-xorg-video-nvidia-396 zlib1g:i386
0 upgraded, 97 newly installed, 0 to remove and 22 not upgraded.
Need to get 145 MB of archives.
After this operation, 743 MB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-cfg1-396 amd64 396.24.10-0ubuntu0~gpu18.04.1 [71.7 kB]
....
....
myuser@srv:~$ sudo reboot

As you can see the nvidia 396 driver is going to be installed in our system. You can see all the additional (some of which are dependencies) packages to be installed.
After the reboot you should see something similar in your dmesg:

NVIDIA proprietary driver information

myuser@srv:~$ dmesg|grep -i nvidia
[    1.414268] nvidia: loading out-of-tree module taints kernel.
[    1.414273] nvidia: module license 'NVIDIA' taints kernel.
[    1.632334] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    1.639698] nvidia-nvlink: Nvlink Core is being initialized, major device number 236
[    1.640031] nvidia 0000:0a:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[    1.640146] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  396.24.10  Tue Jul 10 10:00:18 PDT 2018 (using threaded interrupts)
[    1.647029] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  396.24.10  Tue Jul 10 08:53:56 PDT 2018
[    1.648372] [drm] [nvidia-drm] [GPU ID 0x00000a00] Loading driver
[    1.648373] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:0a:00.0 on minor 0
[   37.086767] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 511
[   37.761570] caller os_map_kernel_space.part.7+0xda/0x120 [nvidia] mapping multiple BARs
[   38.532918] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input16
[   38.532960] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input17
[   38.532996] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input18
[   38.533028] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input19
[   40.851562] caller os_map_kernel_space.part.7+0xda/0x120 [nvidia] mapping multiple BARs
[   41.205592] nvidia-modeset: Allocated GPU:0 (GPU-3bad60bf-8ff7-4cba-8b51-a931299a56d8) @ PCI:0000:0a:00.0

STEP 2) Install NVIDIA CUDA toolkit. As of writing this howto the CUDA 9.1 will be installed.

It depends on GNU GCC 6, but it will automatically pull it as dependencies (you can include it in the install command line as we did).

myuser@srv:~$ sudo apt install -y nvidia-cuda-toolkit gcc-6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ca-certificates-java cpp-6 fonts-dejavu-extra g++-6 gcc-6-base java-common libaccinj64-9.1 libasan3 libatk-wrapper-java libatk-wrapper-java-jni libcublas9.1
  libcudart9.1 libcufft9.1 libcufftw9.1 libcuinj64-9.1 libcurand9.1 libcusolver9.1 libcusparse9.1 libdrm-dev libgcc-6-dev libgif7 libgl1-mesa-dev libglvnd-core-dev
  libglvnd-dev libnppc9.1 libnppial9.1 libnppicc9.1 libnppicom9.1 libnppidei9.1 libnppif9.1 libnppig9.1 libnppim9.1 libnppist9.1 libnppisu9.1 libnppitc9.1 libnpps9.1
  libnvblas9.1 libnvgraph9.1 libnvrtc9.1 libnvtoolsext1 libnvvm3 libopengl0 libpthread-stubs0-dev libstdc++-6-dev libthrust-dev libvdpau-dev libx11-dev libx11-doc
  libx11-xcb-dev libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev
  libxcb-xfixes0-dev libxcb1-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxshmfence-dev libxxf86vm-dev mesa-common-dev nvidia-cuda-dev nvidia-cuda-doc
  nvidia-cuda-gdb nvidia-opencl-dev nvidia-profiler nvidia-visual-profiler ocl-icd-libopencl1 ocl-icd-opencl-dev opencl-c-headers openjdk-8-jre openjdk-8-jre-headless
  x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools
  xtrans-dev
Suggested packages:
  gcc-6-locales g++-6-multilib gcc-6-doc libstdc++6-6-dbg gcc-6-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan3-dbg liblsan0-dbg libtsan0-dbg
  libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg default-jre libstdc++-6-doc libvdpau-doc libxcb-doc libxext-doc libcupti-dev nvidia-driver libpoclu-dev
  icedtea-8-plugin fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei fonts-wqy-zenhei
Recommended packages:
  libnvcuvid1
The following NEW packages will be installed:
  ca-certificates-java cpp-6 fonts-dejavu-extra g++-6 gcc-6 gcc-6-base java-common libaccinj64-9.1 libasan3 libatk-wrapper-java libatk-wrapper-java-jni libcublas9.1
  libcudart9.1 libcufft9.1 libcufftw9.1 libcuinj64-9.1 libcurand9.1 libcusolver9.1 libcusparse9.1 libdrm-dev libgcc-6-dev libgif7 libgl1-mesa-dev libglvnd-core-dev
  libglvnd-dev libnppc9.1 libnppial9.1 libnppicc9.1 libnppicom9.1 libnppidei9.1 libnppif9.1 libnppig9.1 libnppim9.1 libnppist9.1 libnppisu9.1 libnppitc9.1 libnpps9.1
  libnvblas9.1 libnvgraph9.1 libnvrtc9.1 libnvtoolsext1 libnvvm3 libopengl0 libpthread-stubs0-dev libstdc++-6-dev libthrust-dev libvdpau-dev libx11-dev libx11-doc
  libx11-xcb-dev libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev
  libxcb-xfixes0-dev libxcb1-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxshmfence-dev libxxf86vm-dev mesa-common-dev nvidia-cuda-dev nvidia-cuda-doc
  nvidia-cuda-gdb nvidia-cuda-toolkit nvidia-opencl-dev nvidia-profiler nvidia-visual-profiler ocl-icd-libopencl1 ocl-icd-opencl-dev opencl-c-headers openjdk-8-jre
  openjdk-8-jre-headless x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-xext-dev
  x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev
0 upgraded, 90 newly installed, 0 to remove and 25 not upgraded.
Need to get 831 MB of archives.
After this operation, 2005 MB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu bionic/main amd64 java-common all 0.63ubuntu1~02 [7032 B]
....
....

done.
done.

You can see all the extra packages you will get – 2G of space is needed and the NVIDIA CUDA 9.1 will be installed (along with GNU GCC 6).

Here you can verify everything is OK:

myuser@srv:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
myuser@srv:~$ ldconfig -p | grep cuda
        libicudata.so.60 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libicudata.so.60
        libcudart.so.9.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcudart.so.9.1
        libcudart.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcudart.so
        libcuda.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcuda.so.1
        libcuda.so.1 (libc6) => /usr/lib/i386-linux-gnu/libcuda.so.1
        libcuda.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcuda.so
        libcuda.so (libc6) => /usr/lib/i386-linux-gnu/libcuda.so
myuser@srv:~$ nvidia-smi 
Tue Jul 17 14:27:41 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.24.10              Driver Version: 396.24.10                 |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:0A:00.0  On |                  N/A |
|  0%   33C    P8    12W / 275W |    131MiB / 11173MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1696      G   /usr/lib/xorg/Xorg                            59MiB |
|    0      1745      G   /usr/bin/gnome-shell                          69MiB |
+-----------------------------------------------------------------------------+

Install NVIDIA proprietary drivers on Ubuntu 18.0 LTS (x86_64)

The new Ubuntu release is here and as usual it comes with nouveau kernel module for your NVIDIA GPU. Probably this driver is good for everyday office use, but if you like to play games you will need the proprietary driver from NVIDIA for sure! Here are the steps to install the official drivers from NVIDIA with the help of the unofficial community driven repository “Graphics Drivers” team. This is Personal Package Archives (PPA) repository!
DKMS is used for building the NVIDIA kernel module when a new kernel is installed. So you do not have to worry if you update your kernel.
Be careful as it is stated in the repository:

Important: The contents of Personal Package Archives are not checked or monitored. You install software from them at your own risk.

and

You can update your system with unsupported packages from this untrusted PPA by adding …

Still till now no major problems in this repository from its creation and if you just have a home computer and you are a novice in Ubuntu (linux) world you can use this approach of installing NVIDIA proprietary drivers. There is another way of installing the NVIDIA driver from an official source and we are going to cover it soon (coming soon).

STEP 1) Update your system.

Always do this step before installing new software or repositories!

myuser@srv:~$ sudo apt update -y

STEP 2) Add the new repository, which has the nvidia proprietary driver – ppa:graphics-drivers/ppa

myuser@srv:~$ sudo add-apt-repository -y ppa:graphics-drivers/ppa
Hit:1 http://gb.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Get:3 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease [21.3 kB]                     
Hit:4 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease                                                   
Get:5 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                       
Get:6 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 Packages [14.1 kB]  
Get:7 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main i386 Packages [13.1 kB]
Get:8 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main Translation-en [4644 B]       
Fetched 211 kB in 1s (302 kB/s)                     
Reading package lists... Done
myuser@srv:~$

STEP 3) Update and install the nvidia driver

As you can see we use a tool for installing drivers under Ubuntu:

ubuntu-drivers

which is part of this package “ubuntu-drivers-common” and it should be installed by default if missing just install it with apt (look below for more information).

myuser@srv:~$ sudo apt -y update
Hit:1 http://gb.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:4 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease                
Get:5 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]    
Fetched 158 kB in 1s (273 kB/s)                                                                  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
myuser@srv:~$ sudo ubuntu-drivers autoinstall
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  build-essential dkms dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-8-base:i386 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4
  libatomic1 libbsd0:i386 libc-dev-bin libc6:i386 libc6-dev libcilkrts5 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386
  libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libfakeroot libffi6:i386 libgcc-7-dev libgcc1:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386
  libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libitm1 libllvm6.0:i386 liblsan0 libmpx2 libnvidia-cfg1-396 libnvidia-common-396 libnvidia-compute-396
  libnvidia-compute-396:i386 libnvidia-decode-396 libnvidia-decode-396:i386 libnvidia-encode-396 libnvidia-encode-396:i386 libnvidia-fbc1-396
  libnvidia-fbc1-396:i386 libnvidia-gl-396 libnvidia-gl-396:i386 libnvidia-ifr1-396 libnvidia-ifr1-396:i386 libpciaccess0:i386 libquadmath0 libsensors4:i386
  libstdc++-7-dev libstdc++6:i386 libtinfo5:i386 libtsan0 libubsan0 libvdpau1 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
  libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxnvctrl0
  libxshmfence1:i386 libxxf86vm1:i386 linux-libc-dev make manpages-dev mesa-vdpau-drivers nvidia-compute-utils-396 nvidia-dkms-396 nvidia-kernel-common-396
  nvidia-kernel-source-396 nvidia-prime nvidia-settings nvidia-utils-396 pkg-config screen-resolution-extra vdpau-driver-all xserver-xorg-video-nvidia-396
  zlib1g:i386
Suggested packages:
  menu debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg gcc-multilib autoconf automake libtool flex bison gcc-doc gcc-7-multilib
  gcc-7-locales libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg
  libquadmath0-dbg glibc-doc:i386 locales:i386 glibc-doc lm-sensors:i386 libstdc++-7-doc make-doc libvdpau-va-gl1 nvidia-vdpau-driver
  nvidia-legacy-340xx-vdpau-driver
The following NEW packages will be installed:
  build-essential dkms dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-8-base:i386 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4
  libatomic1 libbsd0:i386 libc-dev-bin libc6:i386 libc6-dev libcilkrts5 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386
  libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libfakeroot libffi6:i386 libgcc-7-dev libgcc1:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386
  libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libitm1 libllvm6.0:i386 liblsan0 libmpx2 libnvidia-cfg1-396 libnvidia-common-396 libnvidia-compute-396
  libnvidia-compute-396:i386 libnvidia-decode-396 libnvidia-decode-396:i386 libnvidia-encode-396 libnvidia-encode-396:i386 libnvidia-fbc1-396
  libnvidia-fbc1-396:i386 libnvidia-gl-396 libnvidia-gl-396:i386 libnvidia-ifr1-396 libnvidia-ifr1-396:i386 libpciaccess0:i386 libquadmath0 libsensors4:i386
  libstdc++-7-dev libstdc++6:i386 libtinfo5:i386 libtsan0 libubsan0 libvdpau1 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
  libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxnvctrl0
  libxshmfence1:i386 libxxf86vm1:i386 linux-libc-dev make manpages-dev mesa-vdpau-drivers nvidia-compute-utils-396 nvidia-dkms-396 nvidia-driver-396
  nvidia-kernel-common-396 nvidia-kernel-source-396 nvidia-prime nvidia-settings nvidia-utils-396 pkg-config screen-resolution-extra vdpau-driver-all
  xserver-xorg-video-nvidia-396 zlib1g:i386
0 upgraded, 97 newly installed, 0 to remove and 22 not upgraded.
Need to get 145 MB of archives.
After this operation, 743 MB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-cfg1-396 amd64 396.24.10-0ubuntu0~gpu18.04.1 [71.7 kB]
....
....
myuser@srv:~$ sudo reboot

As you can see the nvidia 396 driver is going to be installed in our system. We included part of the output – the packages, which will be installed. When the setup is ready reboot your system to load the newly installed driver.

NVIDIA proprietary driver information

myuser@srv:~$ dmesg|grep -i nvidia
[    1.414268] nvidia: loading out-of-tree module taints kernel.
[    1.414273] nvidia: module license 'NVIDIA' taints kernel.
[    1.632334] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    1.639698] nvidia-nvlink: Nvlink Core is being initialized, major device number 236
[    1.640031] nvidia 0000:0a:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[    1.640146] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  396.24.10  Tue Jul 10 10:00:18 PDT 2018 (using threaded interrupts)
[    1.647029] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  396.24.10  Tue Jul 10 08:53:56 PDT 2018
[    1.648372] [drm] [nvidia-drm] [GPU ID 0x00000a00] Loading driver
[    1.648373] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:0a:00.0 on minor 0
[   37.086767] nvidia-uvm: Loaded the UVM driver in 8 mode, major device number 511
[   37.761570] caller os_map_kernel_space.part.7+0xda/0x120 [nvidia] mapping multiple BARs
[   38.532918] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input16
[   38.532960] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input17
[   38.532996] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input18
[   38.533028] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input19
[   40.851562] caller os_map_kernel_space.part.7+0xda/0x120 [nvidia] mapping multiple BARs
[   41.205592] nvidia-modeset: Allocated GPU:0 (GPU-3bad60bf-8ff7-4cba-8b51-a931299a56d8) @ PCI:0000:0a:00.0
myuser@srv:~$ nvidia-smi 
Mon Jul 16 15:32:06 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.24.10              Driver Version: 396.24.10                 |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:0A:00.0  On |                  N/A |
|  0%   53C    P0    69W / 275W |    271MiB / 11173MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2143      G   /usr/lib/xorg/Xorg                            18MiB |
|    0      2193      G   /usr/bin/gnome-shell                          13MiB |
|    0      3593      G   /usr/lib/xorg/Xorg                           108MiB |
|    0      3695      G   /usr/bin/gnome-shell                         123MiB |
|    0      5052      G   nvidia-settings                                3MiB |
+-----------------------------------------------------------------------------+

main menu
nvidia-settings general information

main menu
nvidia-settings for 1080Ti

nouveau driver and vainfo information

myuser@srv:~$ lspci|grep -i nvidia
0a:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
0a:00.1 Audio device: NVIDIA Corporation GP102 HDMI Audio Controller (rev a1)
myuser@srv:~$ dmesg|grep -i nvidia
[    1.617118] nouveau 0000:0a:00.0: NVIDIA GP102 (132000a1)
[   40.077131] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input16
[   40.077194] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input17
[   40.077234] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input18
[   40.077282] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input19
myuser@srv:~$ sudo apt -y install vainfo mesa-utils
myuser@srv:~$ vainfo 
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nouveau_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: mesa gallium vaapi
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc

Troubleshooting – missing “ubuntu-drivers” in your system just install it with:

myuser@srv:~$ sudo apt install -y ubuntu-drivers-common

Install openssh (sshd) server in Ubuntu 18.04 LTS

Yes, new major system upgrade new rules. If you’ve installed openssh server till Ubuntu 18 (Bionic Beaver) with just the simple command:

myuser@srv:~$ sudo apt-get install -y openssh-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package openssh-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'openssh-server' has no installation candidate
myuser@srv:~$

Now it is impossible as you can see. It is strange why they just did not include it as an alias just to prevent you from searching the Net (google?).

So there is a new way of installing OpenSSH server – it is a software collection called “OpenSSH server” and there is a new tool to manage such collections:

tasksel

So you must use tasksel to install OpenSSH server, here is the three command you should use:

sudo apt update
sudo apt install tasksel
sudo tasksel install openssh-server

And their explanation below in steps:

STEP 1) Update your server!

Because you could miss tasksel, it is not installed by default and even after clean install it seems not available before you do an update:

myuser@srv:~$ sudo apt update

STEP 2) Install tasksel

myuser@srv:~$ sudo apt install tasksel

STEP 3) Install OpenSSH server with tasksel

You are going to enter an console based graphic setup showing you the installation of the software collection “OpenSSH server”

myuser@srv:~$ sudo tasksel install openssh-server

Here is what is going to see after the above command:

main menu
tasksel installs openssh-sftp-server

main menu
tasksel installs openssh-server

* Throubleshooting – no tasksel packet!

Just DO NOT skip STEP 1) – update your package lists!!!

myuser@srv:~$ sudo apt install tasksel
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package tasksel

* All of the output

Install Ubuntu Desktop 18.04 LTS on a PC with existing windows 10 and linux

This tutorial will show you the simple steps of installing a modern Linux Distribution – Ubuntu Desktop 18.04 LTS. Here we present the more advanced setup installation, when you have already had installed operating systems, so this installation will add Ubuntu 18.04 LTS to our two existing ones – Microsoft Windows 10 Professional and Fedora Workstation 28. So we have 3 hard disks – one is NVME, the other two are SSDs and we want to install our Ubuntu 18.04 to the first disk – “sda” in this case. Our first SSD has two partitions, which we will remove and make new disk layout for the Ubuntu installation with three partitions.
Ubuntu Desktop 18.04 LTS comes with the following software:

  • Xorg X server – 1.19.6
  • GNOME (the GUI) – 3.28.1
  • linux kernel – 4.15.0
  • linux-firmware – 1.173
  • QT – 5.9.5
  • libc – 2.27
  • gnu gcc – 7.3.0
  • coreutils – 8.28
  • python2.7 (default) – 2.7.15
  • python3 – 3.6.5
  • perl – 5.26.1
  • apt – 1.6.1
  • cups – 2.2.7

We used the following ISO for the installation process – Ubuntu 18.04 LTS (Bionic Beaver):

http://releases.ubuntu.com/18.04/ubuntu-18.04-desktop-amd64.iso

It is a LIVE image so you can try it before installing. The easiest way is just to download the image and burn it to a DVD disk and then follow the installation below:

STEP 1) Change to “Install Ubuntu” and hit enter.

To install Ubuntu from your DVD or USB you must boot from it, so change your BIOS accordingly – first boot devide should be the DVD or USB drive with Ubunto installation. If you do it successfully you would see the screenshot below.

main menu
Install Ubuntu grub option

Keep on reading!