Monero CPU Mining in Docker

possum

New Member
Nov 24, 2015
2
0
1
I also had the problem where the docker image starts and then stops. I am running it in a Ubuntu 16.04 VM using KVM on an Ubuntu host.

The first reason was because I had the CPU in the guest / VM set to hypervisor default (which was QEMU) which meant no AES as previously mentioned. Setting it to copy host CPU configuration solved that problem.

The second reason was because the hypervisor does not present any L3 Cache to the guest / VM so was failing when trying to start the miner and asking for the -t option to be set (for number of threads). I used the nproc versions of moneropool and nanopool to get around that.

By setting the --cpus="0.2" option in the docker run command, I was able to set it to only use a maximum of 20% of the CPU in the VM / guest (since I only gave the VM one CPU core) which means that I was able to keep the host CPU idling. It only hashes at 6.6H/s but has not increased the power consumption of my server based on the UPS load since it spends most of its time idling.
 

mo mmcv

New Member
May 9, 2017
4
0
1
61
I'm absolutly new to docker and mining
I tried on one box your minergate docker image and it did work perfect - this is a i7 only
But as I tried to run it on my E5-2686-v3 it failed.
OS on both is Debian 8.

Main error message I think is the last line f the log below:
"./minerd: unsupported non-option argument 'x' " !?

Here the message as I started with -it option and it started to show more than ok output:

make[2]: Entering directory `/cpuminer-multi'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT minerd-cpu-miner.o -MD -MP -MF .deps/minerd-cpu-miner.Tpo -c -o minerd-cpu-miner.o `test -f 'cpu-miner.c' || echo './'`cpu-miner.c
mv -f .deps/minerd-cpu-miner.Tpo .deps/minerd-cpu-miner.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT minerd-util.o -MD -MP -MF .deps/minerd-util.Tpo -c -o minerd-util.o `test -f 'util.c' || echo './'`util.c
mv -f .deps/minerd-util.Tpo .deps/minerd-util.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT minerd-cryptonight_common.o -MD -MP -MF .deps/minerd-cryptonight_common.Tpo -c -o minerd-cryptonight_common.o `test -f 'cryptonight_common.c' || echo './'`cryptonight_common.c
mv -f .deps/minerd-cryptonight_common.Tpo .deps/minerd-cryptonight_common.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT crypto/minerd-c_keccak.o -MD -MP -MF crypto/.deps/minerd-c_keccak.Tpo -c -o crypto/minerd-c_keccak.o `test -f 'crypto/c_keccak.c' || echo './'`crypto/c_keccak.c
crypto/c_keccak.c: In function 'keccak':
crypto/c_keccak.c:102:5: warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
memset(st, 0, sizeof(st));
^
crypto/c_keccak.c:102:5: warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]
crypto/c_keccak.c:111:5: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
memcpy(temp, in, inlen);
^
crypto/c_keccak.c:111:5: warning: incompatible implicit declaration of built-in function 'memcpy' [enabled by default]
mv -f crypto/.deps/minerd-c_keccak.Tpo crypto/.deps/minerd-c_keccak.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT crypto/minerd-c_groestl.o -MD -MP -MF crypto/.deps/minerd-c_groestl.Tpo -c -o crypto/minerd-c_groestl.o `test -f 'crypto/c_groestl.c' || echo './'`crypto/c_groestl.c
mv -f crypto/.deps/minerd-c_groestl.Tpo crypto/.deps/minerd-c_groestl.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT crypto/minerd-c_blake256.o -MD -MP -MF crypto/.deps/minerd-c_blake256.Tpo -c -o crypto/minerd-c_blake256.o `test -f 'crypto/c_blake256.c' || echo './'`crypto/c_blake256.c
mv -f crypto/.deps/minerd-c_blake256.Tpo crypto/.deps/minerd-c_blake256.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT crypto/minerd-c_jh.o -MD -MP -MF crypto/.deps/minerd-c_jh.Tpo -c -o crypto/minerd-c_jh.o `test -f 'crypto/c_jh.c' || echo './'`crypto/c_jh.c
mv -f crypto/.deps/minerd-c_jh.Tpo crypto/.deps/minerd-c_jh.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT crypto/minerd-c_skein.o -MD -MP -MF crypto/.deps/minerd-c_skein.Tpo -c -o crypto/minerd-c_skein.o `test -f 'crypto/c_skein.c' || echo './'`crypto/c_skein.c
mv -f crypto/.deps/minerd-c_skein.Tpo crypto/.deps/minerd-c_skein.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -pthread -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -MT minerd-cryptonight_aesni.o -MD -MP -MF .deps/minerd-cryptonight_aesni.Tpo -c -o minerd-cryptonight_aesni.o `test -f 'cryptonight_aesni.c' || echo './'`cryptonight_aesni.c
In file included from cryptonight.h:6:0,
from cryptonight_aesni.c:2:
miner.h:188:58: warning: 'struct cryptonight_ctx' declared inside parameter list [enabled by default]
uint32_t max_nonce, unsigned long *hashes_done, struct cryptonight_ctx *persistentctx);
^
miner.h:188:58: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
cryptonight_aesni.c: In function 'cryptonight_hash_ctx':
cryptonight_aesni.c:90:2: warning: passing argument 3 of 'keccak' from incompatible pointer type [enabled by default]
keccak((const uint8_t *)input, 76, &ctx->state.hs, 200);
^
In file included from cryptonight_aesni.c:2:0:
cryptonight.h:64:6: note: expected 'uint8_t *' but argument is of type 'union hash_state *'
void keccak(const uint8_t *in, int inlen, uint8_t *md, int mdlen);
^
cryptonight_aesni.c:94:5: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
memcpy(ctx->text, ctx->state.init, INIT_SIZE_BYTE);
^
cryptonight_aesni.c:94:5: warning: incompatible implicit declaration of built-in function 'memcpy' [enabled by default]
cryptonight_aesni.c:172:18: warning: initialization from incompatible pointer type [enabled by default]
uint64_t *dst = &ctx->long_state[c[0] & 0x1FFFF0];
^
cryptonight_aesni.c:215:2: warning: passing argument 1 of 'keccakf' from incompatible pointer type [enabled by default]
keccakf(&ctx->state.hs, 24);
^
In file included from cryptonight_aesni.c:2:0:
cryptonight.h:65:6: note: expected 'uint64_t *' but argument is of type 'union hash_state *'
void keccakf(uint64_t st[25], int rounds);
^
mv -f .deps/minerd-cryptonight_aesni.Tpo .deps/minerd-cryptonight_aesni.Po
gcc -std=gnu99 -falign-loops=16 -falign-functions=16 -falign-jumps=16 -falign-labels=16 -Ofast -flto -fuse-linker-plugin -funroll-loops -fvariable-expansion-in-unroller -ftree-loop-if-convert-stores -fmerge-all-constants -fbranch-target-load-optimize2 -fsched2-use-superblocks -maes -march=native -o minerd minerd-cpu-miner.o minerd-util.o minerd-cryptonight_common.o crypto/minerd-c_keccak.o crypto/minerd-c_groestl.o crypto/minerd-c_blake256.o crypto/minerd-c_jh.o crypto/minerd-c_skein.o minerd-cryptonight_aesni.o -L/usr/lib/x86_64-linux-gnu -lcurl -ljansson -lpthread
make[2]: Leaving directory `/cpuminer-multi'
make[1]: Leaving directory `/cpuminer-multi'
./minerd: unsupported non-option argument 'x'
Try `minerd --help' for more information.

Maybe you can help me what is to be corrected!?

In addition here the lscpu output:
Architektur: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte-Reihenfolge: Little Endian
CPU(s): 72
On-line CPU(s) list: 0-71
Thread(s) pro Kern: 2
Kern(e) pro Socket: 18
Socket(s): 2
NUMA-Knoten: 2
Anbieterkennung: GenuineIntel
Prozessorfamilie: 6
Modell: 63
Modellname: Intel(R) Xeon(R) CPU E5-2686 v3 @ 2.00GHz
Stepping: 2
CPU MHz: 2833.046
Maximale Taktfrequenz der CPU:3500,0000
Minimale Taktfrequenz der CPU:1200,0000
BogoMIPS: 3991.96
Virtualisierung: VT-x
L1d Cache: 32K
L1i Cache: 32K
L2 Cache: 256K
L3 Cache: 46080K
NUMA-Knoten0 CPU(s): 0-17,36-53
NUMA-Knoten1 CPU(s): 18-35,54-71
 
Last edited:

mo mmcv

New Member
May 9, 2017
4
0
1
61
I had a chance to reboot my server now and did check it again - now it did run w/o any problem - so solved
But many thanks for that good work.
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,010
4,995
113
I know I'm kind of late to the party. But why not create a generic docker image that takes the monero pool URL as a parameter rather than having a separate docker image for each pool?
It is easier to remember the pool name than the pool address/ port number.

Also, each pool has slight variations in how it supports tracking miners (if at all) so even with the same miner there can be different syntax depending on the pool.

The other side is then you have the next layer which is GPU, CPU (by architecture) and etc. The command differences are driving using pool:arch rather than accepting pool as an argument.
 

JustinH

Active Member
Jan 21, 2015
124
76
28
45
Singapore
For some reason I can't sign up - If I try on a desktop - Nothing happens. If I try on my mobile, I get a "forbidden" message.... anyone else having problems?
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,010
4,995
113
@JustinH a lot of the crypto currency stuff is under DDoS.

Get a MyMonero wallet. Use the ID with the dwarfpool image.
 

Klee

Well-Known Member
Jun 2, 2016
1,285
393
83
I have never used Docker, so how easy is it to make a docker image with a new pool?
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,010
4,995
113
I have never used Docker, so how easy is it to make a docker image with a new pool?
Stak - hard.
AMD - very hard.
Wolf's < 3 min if I am logged in and not flying across the Pacific to Computex.

If you need me to add one for a pool, let me know which pool and the pool's FAQ on connecting and this can happen some time after I land Sunday PM/ Monday AM.

The reason it takes so long is that there are different images for mainstream Intel, Ryzen, CUDA, and Xeon Phi/ Atom.
 
  • Like
Reactions: Klee

Klee

Well-Known Member
Jun 2, 2016
1,285
393
83
Stak - hard.
AMD - very hard.
Wolf's < 3 min if I am logged in and not flying across the Pacific to Computex.

If you need me to add one for a pool, let me know which pool and the pool's FAQ on connecting and this can happen some time after I land Sunday PM/ Monday AM.

The reason it takes so long is that there are different images for mainstream Intel, Ryzen, CUDA, and Xeon Phi/ Atom.

It's at the point now that I'm thinking something easier to manage for my new servers and maybe my older machines.

I would like to learn more about Docker, at least enough to make images for my use case.
 
  • Like
Reactions: Patrick

krasnaya

New Member
May 21, 2015
15
0
1
33
I'm trying out the docker image, and doesn't seem to be maxing out my cores/threads. I have 2x E5-2680s. Is there something I can change to increase the utilization?

upload_2017-5-31_13-33-40.png
 

VPS

New Member
Feb 18, 2016
10
2
3
Langley, BC
If using E5-2680-v1 I believe this container is only going to use 10 threads per CPU for mining. For best performance each thread needs 2MB of your L3 cache (20/2=10)

I think using more threads won't increase your H/s
 

MiniKnight

Well-Known Member
Mar 30, 2012
3,000
910
113
NYC
@krasnaya that is expected as @VPS says. The miner works best for each thread using 2MB L3 cache. 10 per CPU is right for your chip. Adding more will decrease performance with memory swapping.

What kind of H/s are you getting?