XMR-Stak is a universal Stratum pool miner. This miner supports CPUs, AMD, and NVIDIA GPUs and can be used to mine the cryptocurrencies Monero, Aeon and many more Cryptonight coins. Also, the latest version supports the Monero hard fork protocol CryptoNight v8/9.
XMR-Stak. The definitive Monero miner for Linux and Windows
XMR-Stak supports all common backends (CPU/x86, AMD-GPU, and NVIDIA-GPU), supports all common OS (Linux, Windows, and macOS), supports algorithm cryptonight for Monero (XMR) and cryptonight-light (AEON). XMR-Stak is easy to use and has a guided start (no need to edit a config file for the first start) with auto-configuration for each backend. Last, but not least, XMR-Stak is completely an open source software released under GPLv3 license. It has also TLS support, HTML statistics and JSON API for monitoring. Do you need more?
So, let’s see how to compile it under Linux. In this case, we are testing the Ubuntu flavor. Different distros have little commands and procedure. But, you can also find the latest releases and precompiled binaries on GitHub under Releases.
$ sudo apt install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev
$ git clone https://github.com/fireice-uk/xmr-stak.git
$ mkdir xmr-stak/build
$ cd xmr-stak/build
$ cmake ..
$ make install
For different distro of Linux, take a look at official documentation here.
In my case, with AMD gpus and no Nvidia gpus, I did this:
$ cmake .. -DCUDA_ENABLE=OFF -DOpenCL_INCLUDE_DIR=/opt/amdgpu-pro/lib/x86_64-linux-gnu/ -DOpenCL_LIBRARY=/opt/amdgpu-pro/lib/libOpenCL.so
Also, after some errors, I made this symbolic link:
$ sudo ln -s '/opt/amdgpu-pro/lib/x86_64-linux-gnu/libOpenCL.so' '/opt/amdgpu-pro/lib/libOpenCL.so'
Unfortunately, the latest AMD driver for Linux (the 18.30 one) produces ‘Invalid shares’. I got something like this:
Difficulty : 15795
Good results : 26 / 145 (17.9 %)
Avg result time : 45.8 sec
Pool-side hashes : 566952
Top 10 best results found:
| 0 | 2196014 | 1 | 751566 |
| 2 | 268266 | 3 | 217209 |
| 4 | 131803 | 5 | 71680 |
| 6 | 69194 | 7 | 61406 |
| 8 | 60096 | 9 | 58388 |
| Count | Error text | Last seen |
| 39 | AMD Invalid Result GPU ID 1 | 2018-10-18 10:54:04 |
| 35 | AMD Invalid Result GPU ID 2 | 2018-10-18 10:54:00 |
| 45 | AMD Invalid Result GPU ID 0 | 2018-10-18 10:53:35 |
To solve this issue, as explained in the official documentation, you must downgrade the driver or use instead the ROCm.