Tag Archives: Blockchain related

Installation and use of XmR stak CPU

XMR stak – CPU install

xmr-stak-cpu is an open source software used for calculation of CPU , the following is recorded in the installation process

under ubuntu17.04

sudo apt-get -y install git
git clone https://github.com/fireice-uk/xmr-stak-cpu.git
sudo apt-get -y install libmicrohttpd-dev libssl-dev cmake build-essential
cd xmr-stak-cpu/

at this point you can select the proportion of contributors to donate
edit donate-level. H

After the

changes are complete, compile and install

cmake -DHWLOC_ENABLE=OFF .
make install

XMR stak – CPU use

edit XMR - stak - CPU/bin/config. TXT

cat /proc/cpuinfo | grep processor view total number of threads n

change cpu_threads_conf into the following content, threads quantity is about CPU total number of threads 2/3,
to use e5-2665 for example, a total of 0 161 threads, using 2 103 threads with the highest efficiency.

"cpu_threads_conf" :
[
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 0 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 1 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 2 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 3 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 4 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 5 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 6 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 7 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 8 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 9 },
],

if using nicehash, it is recommended to set "nicehash_nonce" : true,

change address and other information (nicehash for example)

"pool_address" : "cryptonight.hk.nicehash.com:3355",
"wallet_address" : "your-bitcoin-wallet-address.any-name-you-like",
"pool_password" : "x",

then, under xmr-stak-cpu/bin folder execute ./xmr-stak-cpu is ready to calculate
press h key display rate (the first few seconds may be 0, don't worry)

MEMORY ALLOC FAILED: mmap failed

may show that MEMORY ALLOC FAILED: mmap FAILED
problem does not need to be solved, because the measurement on the author's machine has no effect, but the following solution is still provided.
solution:

sudo sysctl -w vm.nr_hugepages=128

in addition, the /etc/security/limits the conf add

* soft memlock 262144
* hard memlock 262144

exit and log back in

background run

everything is in place, let the program run in the background
nohup./xmr-stak-cpu &
and then CTRL c exit

run top to see

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
25706 svr       20   0 1044224  20616   7136 S 998.7  0.3   8:42.80 xmr-stak-cpu
25720 svr       20   0   46076   4224   3464 R   0.3  0.1   0:00.23 top         
    1 root      20   0  205088   7436   5436 S   0.0  0.1   0:05.40 systemd  

The

program is running correctly in the background.