How to compile xmr-stak (2.4.5) under Fedora 28 for CPU mining cryptocurrencies

Thanks to xmr-stak we can have one application capable of mining many different cryptocurrencies based on different algorithms. XMR-STAK is GPU and CPU miner, here we present only the CPU ability under Fedora 28, not all setups have a good video GPU, but you can have a decent CPU, which could be used to mine! For example AMD Ryzen Threadripper 1950X has a good performance on my crypto algorithms, even a better performance than the GPU mining.
Here we use AMD Ryzen Threadripper 1950X, which has 12 cores and 32 threads. Our setup is ASUS ROG ZENITH EXTREME (X399 Chipset) motherboard with 32G (4x8G CROSSHAIR VI HERO) DIMM DDR4 Synchronous Unbuffered (Unregistered) 2133 MHz (0.5 ns) and AMD Ryzen Threadripper 1950X. It can do 1253.5 cryptonight_v7 hashes per second.
Here are the steps you should do to install (in fact install dependencies and compile the miner) and to begin CPU mining:

Update your system and install the needed dependencies

[myuser@localhost ~]$ sudo dnf -y update
[sudo] password for myuser: 
Fedora 28 - x86_64 - Updates                                                                                                        9.5 MB/s |  18 MB     00:01    
Last metadata expiration check: 0:00:04 ago on  2.07.2018 (Mon) 16:52:23 UTC.
Dependencies resolved.                                                    
....
....
Complete!
[myuser@localhost ~]$ sudo reboot
[myuser@localhost ~]$ sudo dnf -y install gcc gcc-c++ hwloc-devel libmicrohttpd-devel libstdc++-static make openssl-devel cmake git screen
....
....
Installed:
  cmake.x86_64 3.11.2-1.fc28            gcc-c++.x86_64 8.1.1-1.fc28           hwloc-devel.x86_64 1.11.9-1.fc28         libmicrohttpd-devel.x86_64 1:0.9.59-2.fc28
  libstdc++-static.x86_64 8.1.1-1.fc28  openssl-devel.x86_64 1:1.1.0h-3.fc28  screen.x86_64 4.6.2-3.fc28               cmake-data.noarch 3.11.2-1.fc28           
  cmake-filesystem.x86_64 3.11.2-1.fc28 cmake-rpm-macros.noarch 3.11.2-1.fc28 gmp-c++.x86_64 1:6.1.2-7.fc28            gmp-devel.x86_64 1:6.1.2-7.fc28           
  gnutls-c++.x86_64 3.6.2-3.fc28        gnutls-dane.x86_64 3.6.2-3.fc28       gnutls-devel.x86_64 3.6.2-3.fc28         hwloc-libs.x86_64 1.11.9-1.fc28           
  ibacm.x86_64 16.2-3.fc28              jsoncpp.x86_64 1.8.4-3.fc28           keyutils-libs-devel.x86_64 1.5.10-6.fc28 krb5-devel.x86_64 1.16.1-7.fc28           
  libcom_err-devel.x86_64 1.43.8-2.fc28 libibcm.x86_64 16.2-3.fc28            libibumad.x86_64 16.2-3.fc28             libkadm5.x86_64 1.16.1-7.fc28             
  libmicrohttpd.x86_64 1:0.9.59-2.fc28  libselinux-devel.x86_64 2.8-1.fc28    libsepol-devel.x86_64 2.8-1.fc28         libstdc++-devel.x86_64 8.1.1-1.fc28       
  libtasn1-devel.x86_64 4.13-2.fc28     libuv.x86_64 1:1.20.3-1.fc28          libverto-devel.x86_64 0.3.0-5.fc28       nettle-devel.x86_64 3.4-2.fc28            
  p11-kit-devel.x86_64 0.23.12-1.fc28   pcre2-devel.x86_64 10.31-4.fc28       pcre2-utf32.x86_64 10.31-4.fc28          rdma-core-devel.x86_64 16.2-3.fc28        
  rhash.x86_64 1.3.5-2.fc28             unbound-libs.x86_64 1.7.3-1.fc28      zlib-devel.x86_64 1.2.11-8.fc28

STEP 2) Compile the mining program xmr-stak

[myuser@localhost ~]$ git clone https://github.com/fireice-uk/xmr-stak.git
Cloning into 'xmr-stak'...
remote: Counting objects: 4931, done.
remote: Total 4931 (delta 0), reused 0 (delta 0), pack-reused 4930
Receiving objects: 100% (4931/4931), 1.45 MiB | 2.07 MiB/s, done.
Resolving deltas: 100% (3515/3515), done.
[myuser@localhost ~]$ mkdir xmr-stak/build
[myuser@localhost ~]$ cd xmr-stak/build
[myuser@localhost build]$ export CFLAGS="-O2 -march=native -msse3 -fomit-frame-pointer -pipe"
[myuser@localhost build]$ export CHOST="x86_64-pc-linux-gnu"
[myuser@localhost build]$ export CXXFLAGS="${CFLAGS}"
[myuser@localhost build]$ export LDFLAGS="-Wl,-O1"
[myuser@localhost build]$ cmake .. -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
-- The C compiler identification is GNU 8.1.1
-- The CXX compiler identification is GNU 8.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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/c++
-- Check for working CXX compiler: /usr/bin/c++ -- 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 OpenSSL: /usr/lib64/libcrypto.so (found version "1.1.0h") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/myuser/xmr-stak/build
[myuser@localhost build]$ make -j 16
Scanning dependencies of target xmr-stak-c
[  3%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_blake256.c.o
[  7%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_groestl.c.o
[ 11%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_skein.c.o
[ 15%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_keccak.c.o
[ 19%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_jh.c.o
[ 23%] Linking C static library bin/libxmr-stak-c.a
[ 23%] Built target xmr-stak-c
Scanning dependencies of target xmr-stak-backend
[ 26%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/version.cpp.o
[ 34%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/hwlocMemory.cpp.o
[ 34%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/globalStates.cpp.o
[ 42%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/jconf.cpp.o
[ 42%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/minethd.cpp.o
[ 46%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/backendConnector.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/httpd.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/crypto/cryptonight_common.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/jconf.cpp.o
[ 61%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/webdesign.cpp.o
[ 65%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/executor.cpp.o
[ 69%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/console.cpp.o
[ 73%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/uac.cpp.o
[ 76%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/utility.cpp.o
[ 80%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/jpsock.cpp.o
[ 84%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/telemetry.cpp.o
[ 88%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/socket.cpp.o
[ 92%] Linking CXX static library bin/libxmr-stak-backend.a
[ 92%] Built target xmr-stak-backend
Scanning dependencies of target xmr-stak
[ 96%] Building CXX object CMakeFiles/xmr-stak.dir/xmrstak/cli/cli-miner.cpp.o
[100%] Linking CXX executable bin/xmr-stak
[100%] Built target xmr-stak

Execute the program to see if everything is OK. With the help output you can see how many algorithms are supported as of version 2.4.5 of xmr-stak.

[myuser@localhost build]$ cd bin
[myuser@localhost 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
  -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
        - croat
        - cryptonight
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v7_stellite
        - edollar
        - electroneum
        - graft
        - haven
        - intense
        - ipbc
        - karbo
        - masari
        - monero7
        - stellite
        - sumokoin
        - turtlecoin

Version: xmr-stak 2.4.5 b3f79de
Brought to by fireice_uk and psychocrypt under GPLv3.

Electroneum CPU mining with XMR-STAK

Using Cryptonote V7 Variant 1 (aka. “monerov7″/”cryptonight_v7”) algorithm. First run.
Couple of important questions to answer:

  • Please enter the currency that you want to mine: cryptonight_v7
  • Username (wallet address or pool login): etnk111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 – this is your address, put here your real public wallet address, DO NOT PUT THIS FALSE ADDRESS
  • Pool address: pool.etn.spacepools.org:3333 – the pool address to use, we use etn.spacepools.org pool
  • Username (wallet address or pool login): your email address
[myuser@localhost bin]$ screen -R mining
[myuser@srv bin]# sudo sysctl -w vm.nr_hugepages=128
[sudo] password for myuser: 
vm.nr_hugepages = 128
[myuser@localhost bin]$ ./xmr-stak 
Please enter:
- Do you want to use the HTTP interface?
Unlike the screen display, 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
        - croat
        - cryptonight
        - cryptonight_masari
        - cryptonight_haven
        - cryptonight_heavy
        - cryptonight_lite
        - cryptonight_lite_v7
        - cryptonight_lite_v7_xor
        - cryptonight_v7
        - cryptonight_v7_stellite
        - edollar
        - electroneum
        - graft
        - haven
        - intense
        - ipbc
        - karbo
        - masari
        - monero7
        - stellite
        - sumokoin
        - turtlecoin

cryptonight_v7
- Pool address: e.g. pool.example.com:3333
pool.etn.spacepools.org:3333
- Username (wallet address or pool login):
etnk111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
- Password (mostly empty or x):
myuser@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.5 b3f79de

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

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-02 17:19:11] : Mining coin: cryptonight_v7
[2018-07-02 17:19:11] : CPU configuration stored in file 'cpu.txt'
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 0.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 1.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 2.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 3.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 4.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 5.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 6.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 7.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 8.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 9.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 10.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 11.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 12.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 13.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 14.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Starting 1x thread, affinity: 15.
[2018-07-02 17:19:11] : hwloc: memory pinned
[2018-07-02 17:19:11] : Fast-connecting to pool.etn.spacepools.org:3333 pool ...
[2018-07-02 17:19:11] : Pool pool.etn.spacepools.org:3333 connected. Logging in...
[2018-07-02 17:19:11] : Difficulty changed. Now: 50000.
[2018-07-02 17:19:11] : Pool logged in.
RESULT REPORT
Difficulty       : 18840
Good results     : 141 / 141 (100.0 %)
Avg result time  : 15.5 sec
Pool-side hashes : 2908063

Top 10 best results found:
|  0 |         16095047 |  1 |          1495311 |
|  2 |          1054682 |  3 |           405522 |
|  4 |           347343 |  5 |           313062 |
|  6 |           311532 |  7 |           298945 |
|  8 |           181473 |  9 |           158732 |

Error details:
Yay! No errors.
HASHRATE REPORT - CPU
| ID |    10s |    60s |    15m | ID |    10s |    60s |    15m |
|  0 |   77.3 |   77.1 |   77.2 |  1 |   77.7 |   77.6 |   77.7 |
|  2 |   77.5 |   77.4 |   77.5 |  3 |   77.6 |   77.6 |   77.7 |
|  4 |   78.5 |   78.5 |   78.4 |  5 |   78.5 |   78.5 |   78.4 |
|  6 |   78.5 |   78.5 |   78.4 |  7 |   78.5 |   78.4 |   78.4 |
|  8 |   78.5 |   78.5 |   78.5 |  9 |   78.5 |   78.5 |   78.5 |
| 10 |   78.6 |   78.5 |   78.5 | 11 |   78.6 |   78.5 |   78.5 |
| 12 |   78.5 |   78.5 |   78.5 | 13 |   78.6 |   78.5 |   78.5 |
| 14 |   78.5 |   78.5 |   78.5 | 15 |   78.5 |   78.5 |   78.5 |
Totals (CPU):  1252.5 1251.7 1252.0 H/s
-----------------------------------------------------------------
Totals (ALL):   1252.5 1251.7 1252.0 H/s
Highest:  1253.5 H/s
-----------------------------------------------------------------

Here is the all and only the commands to execute (in a script):

sudo dnf -y update
sudo reboot
sudo dnf -y install gcc gcc-c++ hwloc-devel libmicrohttpd-devel libstdc++-static make openssl-devel cmake git screen
git clone https://github.com/fireice-uk/xmr-stak.git
mkdir xmr-stak/build
cd xmr-stak/build
export CFLAGS="-O2 -march=native -msse3 -fomit-frame-pointer -pipe"
export CHOST="x86_64-pc-linux-gnu"
export CXXFLAGS="${CFLAGS}"
export LDFLAGS="-Wl,-O1"
cmake .. -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
make -j 16
cd bin
./xmr-stak

Install NVIDIA official drivers on Fedora 28 (x86_64)

Fedora 28 comes with open source driver for NVIDIA cards, so you’ll get a decent and stable driver for your video, but without hardware acceleration and a machine not good for gaming like Steam, not good for scientific usage or crypt mining! In fact in recent open source versions (called nouveau) of the NVIDIA driver some cards got partial hardware acceleration, but most of the latest cards out there still need the proprietary driver!
Our test system is equipped with ASUS ROG Poseidon GeForce® GTX 1080 TI 11GB Platinum Edition by default here is the linux kernel output:

[myuser@localhost ~]$ 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@localhost ~]$ dmesg|grep -i nvidia
[    4.606404] nouveau 0000:0a:00.0: NVIDIA GP102 (132000a1)
[    7.776389] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input14
[    7.776487] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input15
[    7.776548] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input16
[    7.776608] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input17
[myuser@localhost ~]$ cat /proc/modules |grep nouveau
nouveau 2019328 21 - Live 0x0000000000000000
video 45056 2 asus_wmi,nouveau, Live 0x0000000000000000
drm_kms_helper 200704 1 nouveau, Live 0x0000000000000000
mxm_wmi 16384 1 nouveau, Live 0x0000000000000000
ttm 126976 1 nouveau, Live 0x0000000000000000
drm 454656 24 nouveau,drm_kms_helper,ttm, Live 0x0000000000000000
i2c_algo_bit 16384 2 nouveau,igb, Live 0x0000000000000000
wmi 28672 4 asus_wmi,wmi_bmof,nouveau,mxm_wmi, Live 0x0000000000000000

Here are the steps to install NVIDIA proprietary driver on Fedora 28:

STEP 1) Disable UEFI Secure Boot

Check in your BIOS if this feature is enabled. You should disabled it or after a successful installation of the kernel module you must sign it, which is not the goal of this howto. It is probably disabled if you use Linux, but it could be enabled if you use signed kernel, so it is good to check this settings because your driver won’t run if this feature is enabled.

STEP 2) Update your system and reboot. Then install the dependencies for the NVIDIA driver

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. At first best way is to become root with sudo.

[myuser@localhost ~]$ sudo su
[root@localhost ~]$ dnf -y update
[root@localhost ~]$ reboot
[root@localhost ~]$ dnf -y install kernel-devel kernel-headers gcc dkms acpid libglvnd-glx libglvnd-opengl libglvnd-devel pkgconfig

STEP 3) Download the official NVIDIA installer application

Here is the NVIDIA search driver page – https://www.nvidia.com/Download/Find.aspx, just find the card you own and download the driver. Here are the steps we’d past:
So at the end you get a file NVIDIA-Linux-x86_64-390.67.run

[myuser@localhost ~]$ ls -al NVIDIA-Linux-x86_64-390.67.run 
-rw-r--r--. 1 myuser myuser 82272406  2 Jul  2,37 NVIDIA-Linux-x86_64-390.67.run

Select your video card and click on “Search”, we selected GeForce GTX 1080 Ti.

main menu
Select your video card

Click on the top driver, which is not “beta”.
main menu
Click on the driver to download

Infromation for the NVIDIA display driver. The most recent is version 390.67. Click on “Download”.
main menu
Click on download

Click on download again to begin downloading the installation file. You can download NVIDIA End User License Agreement, too.
main menu
Click on download again to begin downloading the installation file.

STEP 4) Disable the open source nouveau.

The driver must be blacklisted on two places, when the initramfs loads and during the fedora 28 systemd booting. So first put the following in

/etc/modprobe.d/blacklist.conf

[root@localhost ~]$ echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf

and in file

/etc/sysconfig/grub

add at the end of the line starting with GRUB_CMDLINE_LINUX the following:

rd.driver.blacklist=nouveau

so in our case we have:

GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora_localhost--live-swap rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap rhgb quiet rd.driver.blacklist=nouveau"

This is just an example, do not copy the whole line, just add at the end before the ending quotes rd.driver.blacklist=nouveau

STEP 5) Update grub configuration and remove the open source driver from x11 and initram

[root@localhost ~]# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg 
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.17.3-200.fc28.x86_64
Found initrd image: /boot/initramfs-4.17.3-200.fc28.x86_64.img
Found linux image: /boot/vmlinuz-4.16.3-301.fc28.x86_64
Found initrd image: /boot/initramfs-4.16.3-301.fc28.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-d11e97619bd242a39cd53700ce473c6c
Found initrd image: /boot/initramfs-0-rescue-d11e97619bd242a39cd53700ce473c6c.img
Found Windows Boot Manager on /dev/nvme0n1p2@/EFI/Microsoft/Boot/bootmgfw.efi
Found Ubuntu 16.04.4 LTS (16.04) on /dev/sda2
done
[root@localhost ~]# #commeted, use only if your BIOS is not in UEFI mode!!!
[root@localhost ~]# #grub2-mkconfig -o /boot/grub2/grub.cfg
[root@localhost ~]# dnf remove xorg-x11-drv-nouveau
Dependencies resolved.
=======================================================================================================================================================================
 Package                                        Arch                             Version                                     Repository                           Size
=======================================================================================================================================================================
Removing:
 xorg-x11-drv-nouveau                           x86_64                           1:1.0.15-4.fc28                             @anaconda                           229 k

Transaction Summary
=======================================================================================================================================================================
Remove  1 Package

Freed space: 229 k
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                               1/1 
  Erasing          : xorg-x11-drv-nouveau-1:1.0.15-4.fc28.x86_64                                                                                                   1/1 
  Running scriptlet: xorg-x11-drv-nouveau-1:1.0.15-4.fc28.x86_64                                                                                                   1/1 
  Verifying        : xorg-x11-drv-nouveau-1:1.0.15-4.fc28.x86_64                                                                                                   1/1 

Removed:
  xorg-x11-drv-nouveau.x86_64 1:1.0.15-4.fc28                                                                                                                          

Complete!
[root@localhost ~]# mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
[root@localhost ~]# dracut /boot/initramfs-$(uname -r).img $(uname -r)
[root@localhost ~]# systemctl set-default multi-user.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/multi-user.target.
[root@localhost ~]# reboot

As you can see the grub configuration tool found two more operating systems Microsoft Windows 10 and Ubuntu 16 and they are saved in the new configuration, so it is safe to make the new configuration it will preserve the other grub configuration and you’ll be able to boot them if you choose it from the grub menu.
We removed the unnecessary package xorg-x11-drv-nouveau.x86_64, regenerated the initramfs for our kernel and instructed the system to set the default console login – you do not need GUI and you won’t have it (you’ve just removed the GPU driver!) the next time you boot your machine.

STEP 6) Run the NVIDIA installation file from root user

After the restart your system won’t boot in GUI, there will be the login console prompt:

main menu
Console login

Login with your user and then become root, the installation need to be executed by the root user. Then execute NVIDIA-Linux-x86_64-390.67.run, but before you must change the permissions to executable.

[myuser@localhost myuser]# chmod 755 ./NVIDIA-Linux-x86_64-390.67.run
[myuser@localhost myuser]# sudo su
[root@localhost myuser]# ./NVIDIA-Linux-x86_64-390.67.run 
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 390.67.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Select “Yes” using tab key and hit enter.

                        NVIDIA Accelerated Graphics Driver for Linux-x86_64 (390.67)
 
  Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build 
  a new module, if you install a different kernel later.

                                    Yes                                 No   

  NVIDIA Software Installer for Unix/Linux                                                     www.nvidia.com
main menu
This will allow DKMS to automatically build a new module, if you install a different kernel later.

Select “Yes” using tab key and hit enter.

                        NVIDIA Accelerated Graphics Driver for Linux-x86_64 (390.67)

  Install NVIDIA's 32-bit compatibility libraries?
                                                                                                              
                                    Yes                                 No   
 
  NVIDIA Software Installer for Unix/Linux                                                     www.nvidia.com 
main menu
Install NVIDIA’s 32-bit compatibility libraries

Select “Yes” using tab key and hit enter.

                       NVIDIA Accelerated Graphics Driver for Linux-x86_64 (390.67)

  Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that
  the NVIDIA X driver will be used when you restart X?  Any pre-existing X configuration file will be backed  
  up.     
                                                                                                              
                                    Yes                                 No   


  NVIDIA Software Installer for Unix/Linux                                                     www.nvidia.com
main menu
Would you like to run the nvidia-xconfig utility to automatically update your X configuration file.

Hit enter to continue. Your NVIDIA driver is isntalled successfully.

                        NVIDIA Accelerated Graphics Driver for Linux-x86_64 (390.67)
 
  Your X configuration file has been successfully updated.  Installation of the NVIDIA Accelerated Graphics   
  Driver for Linux-x86_64 (version: 390.67) is now complete.

                                                      OK  

  NVIDIA Software Installer for Unix/Linux                                                     www.nvidia.com 
main menu
Installation of the NVIDIA Accelerated Graphics Driver for Linux-x86_64 (version: 390.67) is now complete.

STEP 7) Return the default login to be GUI and reboot your machine.

Do not forget you must be root user or execute the commands with sudo.

[root@localhost myuser]# systemctl set-default graphical.target
Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/graphical.target.
[root@localhost myuser]# reboot

You should be back in GNOME login after the reboot.
Here is the NVIDIA driver loaded successfully:

[myuser@localhost ~]$ dmesg|grep -i nvidia
[    8.806266] nvidia: loading out-of-tree module taints kernel.
[    8.806277] nvidia: module license 'NVIDIA' taints kernel.
[    8.812252] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[    8.821344] nvidia-nvlink: Nvlink Core is being initialized, major device number 234
[    8.821805] nvidia 0000:0a:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[    8.821994] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  390.67  Fri Jun  1 04:04:27 PDT 2018 (using threaded interrupts)
[    8.833388] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  390.67  Fri Jun  1 03:15:43 PDT 2018
[    8.856187] [drm] [nvidia-drm] [GPU ID 0x00000a00] Loading driver
[    8.856190] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:0a:00.0 on minor 0
[    8.860227] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input14
[    8.860404] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input15
[    8.860665] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input16
[    8.861126] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.1/0000:0a:00.1/sound/card0/input17
[   14.388205] caller _nv001169rm+0xe3/0x1d0 [nvidia] mapping multiple BARs
[   14.821065] nvidia-modeset: Allocated GPU:0 (GPU-3bad60bf-8ff7-4cba-8b51-a931299a56d8) @ PCI:0000:0a:00.0
[myuser@localhost ~]$ cat /proc/modules |grep -i nvidia
nvidia_drm 45056 2 - Live 0x0000000000000000 (POE)
nvidia_modeset 1110016 11 nvidia_drm, Live 0x0000000000000000 (POE)
nvidia 14389248 480 nvidia_modeset, Live 0x0000000000000000 (POE)
drm_kms_helper 196608 1 nvidia_drm, Live 0x0000000000000000
drm 458752 5 nvidia_drm,drm_kms_helper, Live 0x0000000000000000
ipmi_msghandler 57344 2 nvidia,ipmi_devintf, Live 0x0000000000000000

STEP 8) Enable video acceleration support

[myuser@localhost ~]$ sudo dnf -y install vdpauinfo libva-vdpau-driver libva-utils

nvidia settings and nvidia-smi

NVIDIA X server settings – X Server Information.

main menu
NVIDIA X server settings

NVIDIA X server settings – GPU 0 – (GeForce GTX 1080 Ti) infromation tab. You can see the BIOS version, CUDA cores of 3584, Total Memory 11264 MB, current GPU utilization and more.
main menu

[myuser@localhost ~]$ nvidia-smi 
Mon Jul  2 03:43:33 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.67                 Driver Version: 390.67                    |
|-------------------------------+----------------------+----------------------+
| 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%   51C    P8    14W / 275W |    244MiB / 11175MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1843      G   /usr/libexec/Xorg                             12MiB |
|    0      2110      G   /usr/bin/gnome-shell                          49MiB |
|    0      2400      G   /usr/libexec/Xorg                             61MiB |
|    0      2489      G   /usr/bin/gnome-shell                         118MiB |
+-----------------------------------------------------------------------------+

vainfo – VA-API driver, the video acceleration API driver

Here is the nouveau – as you can see no acceleration supported:

[myuser@localhost ~]$ vainfo 
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/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

And here is after installing the NVIDIA proprietary driver, you get video acceleration for your video player!

[myuser@localhost ~]$ vainfo 
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG4Simple            : VAEntrypointVLD
      VAProfileMPEG4AdvancedSimple    : VAEntrypointVLD
      <unknown profile>               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD