Monero Mining with xmr-stak-cpu on Centos 7

  • 26
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    26
    Shares

My previous article showed how to mine Monero using cpuminer-multi. This article will take a look at xmr-stak-cpu, which in my testing, performs much better for Monero than cpuminer-multi does.

yum -y install epel-release
yum -y install centos-release-scl cmake3 hwloc-devel libmicrohttpd-devel openssl-devel git screen nano
yum -y install devtoolset-4-gcc*
scl enable devtoolset-4 bash
git clone https://github.com/fireice-uk/xmr-stak-cpu.git
cd xmr-stak-cpu
cmake3 .
make install

After make install runs you will need to change directories:

cd bin/

Then you will run xmr-stak-cpu for the first time

chmod +x xmr-stak-cpu
./xmr-stak-cpu

You will notice that after the first run you are given a notice to edit your config.txt. Follow the instructions provided and also make sure to edit the following lines in bin/config.txt:

"pool_address" : "pool.usxmrpool.com:3333",
"wallet_address" : "46dpA9N1KDE9yERcSGASXPUyA4ga1GrPq5sDXqwwjQL2dAmf5kvgpNQUWdvyT1r55pfwfvuBn2h7YQPhZFYdWtjWUVUTobh",
"pool_password" : "x",

After you have the config.txt edited correctly simply run xmr-stak-cpu once more.

If you run into issues related to mmap this means you need to enable hugepages. To do this type the following commands:

sysctl -w vm.nr_hugepages=128
nano /etc/sysctl.conf

At the end of the sysctl.conf file add:

vm.nr_hugepages=128

If you found this helpful, consider a donation!


  • 26
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    26
    Shares

Leave a Reply

31 Comments on "Monero Mining with xmr-stak-cpu on Centos 7"

avatar
  Subscribe  
newest oldest most voted
Notify of
Iberminer
Guest

Iยดm using CentOS 7 minimal installation. I followed all the steps to configure the TXT and I get an error saying : JSON config parse error(offset 1721): Missing a name for object member.

What can I do to solve the error?

Mustafa
Guest
After running the mining… this is what I got: ./xmr-stak-cpu [[email protected] bin]# sysctl -w vm.nr_hugepages=128 vm.nr_hugepages = 128 [[email protected] bin]# pico /etc/sysctl.conf [[email protected] bin]# pico /etc/sysctl.conf [[email protected] bin]# ./xmr-stak-cpu [2017-12-11 15:12:09] : Your CPU doesn’t support hardware AES. Don’t expect high hashrates. ——————————————————————- xmr-stak-cpu 1.3.0-1.5.0 mining software, CPU Version. Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk). Brought to you by fireice_uk and psychocrypt under GPLv3. Configurable dev donation level is set to 2.0 % You can use following keys to display reports: ‘h’ – hashrate ‘r’ – results ‘c’ – connection ——————————————————————- [2017-12-11 15:12:10] : Starting… Read more »
Rohan
Guest

Can anyone tell me that how to use minergate cli if you have webcentos on the dedicated server.

5163858
Guest

I run this on a VPS, and when enable hugepages, it show me :
permission denied on key ‘vm.nr_hugepages’

edu
Guest
[2017-12-01 11:30:33] : Starting single thread, affinity: 0. [2017-12-01 11:30:33] : Starting single thread, affinity: 1. [2017-12-01 11:30:33] : Starting single thread, affinity: 2. [2017-12-01 11:30:33] : Starting single thread, affinity: 3. [2017-12-01 11:30:33] : Connecting to pool pool.usxmrpool.com:3333 … [2017-12-01 11:30:33] : hwloc: memory pinned [2017-12-01 11:30:33] : hwloc: memory pinned [2017-12-01 11:30:33] : MEMORY ALLOC FAILED: mmap failed [2017-12-01 11:30:33] : MEMORY ALLOC FAILED: mmap failed [2017-12-01 11:30:33] : hwloc: memory pinned [2017-12-01 11:30:33] : hwloc: memory pinned [2017-12-01 11:30:33] : MEMORY ALLOC FAILED: mmap failed [2017-12-01 11:30:33] : MEMORY ALLOC FAILED: mmap failed [2017-12-01 11:30:34] : Connected.… Read more »
Alpha
Guest

Hi again. Would you be able to give instructions on how to keep this running? I would like to run it as a service so it can restart automatically if it stops or any other suggestion would be great.

Dave
Guest

Perfect copy and paste tutorial, Thanks! I have it running on 3 machines and wondering does it auto deposit then in to my mnero wallet?

JK R
Guest

# scl enable devtoolset-4 bash
Unable to open /etc/scl/prefixes/devtoolset-4!

JK R
Guest
./xmr-stak-cpu The configuration for ‘cpu_threads_conf’ in your config file is ‘null’. The miner evaluates your system and prints a suggestion for the section cpu_threads_conf to the terminal. The values are not optimal, please try to tweak the values based on notes in config.txt. Please copy & paste the block within the asterisks to your config. [2017-12-23 17:20:27] : Autoconf FAILED: The CPU doesn’t seem to have a cache. Printing config for a single thread. Please try to add new ones until the hashrate slows down. **************** FAILURE Copy&Paste BEGIN **************** “cpu_threads_conf” : [ { “low_power_mode” : false, “no_prefetch” : true,… Read more »
Giancarlo
Guest

Great article,

Seemingly easy to follow, and it did but….

I needed to use the new git version:
git clone https://github.com/fireice-uk/xmr-stak.git
As the mentioned is not supported anymore.

Then at make install I got this error:
# make install
make: *** No rule to make target `install’. Stop.

Any help with this?

Giancarlo
Guest

After going through the installation again, I found the issue.
As this is a test setup, on a online VMWare based centos server without real graphic cards, I needed to make a little change:
cmake3 ..
this must be:
cmake3 -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF ..
To not make use of an NVIDIA or AMD graphics card

lord
Guest
I also have the same error as some here: ——————————————————————- xmr-stak-cpu 1.3.0-1.5.0 mining software, CPU Version. Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk). Brought to you by fireice_uk and psychocrypt under GPLv3. Configurable dev donation level is set to 2.0 % You can use following keys to display reports: ‘h’ – hashrate ‘r’ – results ‘c’ – connection ——————————————————————- [2018-01-05 09:14:36] : Starting single thread, affinity: 0. [2018-01-05 09:14:36] : Starting single thread, affinity: 1. [2018-01-05 09:14:36] : Connecting to pool pool.usxmrpool.com:3333 … [2018-01-05 09:14:36] : hwloc: memory pinned [2018-01-05 09:14:36] : hwloc: memory pinned [2018-01-05… Read more »
lord
Guest

Update, this worked after allowing inbound and outbound traffic on firewall. I am mining on pool.supportxmr.com:3333

How do I make ./xmr-stak-cpu run continuosly as a process?

vishal
Guest

How to keep it running as backgroundjob ? sudo ./xmr-stak-cpu & gets killed in like 5 sec