Monero CPU Mining in Docker

Patrick

Administrator
Staff member
Dec 21, 2010
11,971
4,932
113
Interesting stuff @Patrick so the Docker image uses which version of Ubuntu ? and uses the console apps i.e for minergate Smart multicurrency mining pool & 1-click GUI miner ? That's a deb package. Is there a source tarball version ? Something you could make compile using Intel optimised flags for more performance ?
I did not use icc for this, however, it is using the Wolf's CPU miner which is, by far, better than the Minergate one. It is using Ubuntu Xenial.

The other difference is that these images are made to be pushed over a swarm. For example, I have 20-30 nodes running and it uses a single command.
 
  • Like
Reactions: eva2000

Panamax

New Member
Nov 27, 2016
23
2
3
32
Good day everybody... Sorry to bother, but i have some noob questions...

i downloaded and installed docker now, it is running and i have the little whale in the bottom...
i understood that all i need to do is enter the modified code

Code:
docker run -d -e username=example@example.com servethehome/monero_cpu_minergate

somewhere into docker?
Where and how do i do this?

Thanks ;)
Max
 

Panamax

New Member
Nov 27, 2016
23
2
3
32
UPDATE:

i´ve run the "docker run -d -e username=example@example.com servethehome/monero_cpu_minergate" in the CMD, it started to download and started the miner...

however it tops out at exactly 74% of CPU load, with hash rates according to the miner gate dashboard between 480 and 920 H/s, while the CPU load stays stable... i have dedicated all 40 CPUs to docker in the settings
 

Patrick

Administrator
Staff member
Dec 21, 2010
11,971
4,932
113
@Panamax That sounds a bit low but OK. It takes the amount of L3 cache you have and divides it by 2MB to get threads.

What OS?
 
  • Like
Reactions: Panamax

Panamax

New Member
Nov 27, 2016
23
2
3
32
i have windows 10, so my 50mb L3 available would give 25 threads? this would result in 62% of CPU usage?

Keep in mind i have a ES, running max. 2,3ghz on all cores
 

modder man

Active Member
Jan 19, 2015
644
70
28
29
I installed the minergate version on an ubuntu docker host and it pulled the image successfully but stops as soon as it starts. Pretty new to docker, any thoughts?
 

Patrick

Administrator
Staff member
Dec 21, 2010
11,971
4,932
113
I installed the minergate version on an ubuntu docker host and it pulled the image successfully but stops as soon as it starts. Pretty new to docker, any thoughts?
Usually when this happens it is a lack of the -e username=example@example.com line.

Can you try using -it instead of -d in the command line?

Code:
docker run -it -e username=example@example.com servethehome/monero_cpu_minergate
Note - if it runs, and you want to leave it running Ctrl+P and Ctrl+Q to detach from the container. If you hit Ctrl+C it will quit and stop the miner.
 

Marsh

Moderator
May 12, 2013
2,294
1,109
113
Your CPU should work.

try : docker ps or docker attach containerID

If this is newly fresh docker installation,
Try running "docker run hello-world" to verify your installation.
 

modder man

Active Member
Jan 19, 2015
644
70
28
29
changing it to -it did get it further along in attempting to start but I ran into this.

[2017-03-17 20:22:50] Using JSON-RPC 2.0
[2017-03-17 20:22:50] Starting Stratum on stratum+tcp://xmr.pool.minergate.com:45560
[2017-03-17 20:22:51] Pool set diff to 1063
[2017-03-17 20:22:51] Stratum detected new block
[2017-03-17 20:22:51] 320 miner threads started, using 'cryptonight' algorithm.
/usr/local/bin/moneroCPU.sh: line 41: 1750 Segmentation fault (core dumped) ./minerd -a cryptonight -o stratum+tcp://xmr.pool.minergate.com:45560 -u $username -p x -t $numthreads
root@xmr:/home/virtadmin#
 

Patrick

Administrator
Staff member
Dec 21, 2010
11,971
4,932
113
Whoa! 320 threads. Is this running in a VM or bare metal?

Can you post lscpu output? Also, at the very start (should be just after the command) there should be a few lines spitting out debug numbers.
 

modder man

Active Member
Jan 19, 2015
644
70
28
29
That is an ubuntu VM on esxi. I didnt see debug numbers as I rolled through the output.

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 32
NUMA node(s): 4
Vendor ID: GenuineIntel
CPU family: 6
Model: 45
Model name: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz
Stepping: 6
CPU MHz: 2593.750
BogoMIPS: 5187.50
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 20480K
NUMA node0 CPU(s): 0-7
NUMA node1 CPU(s): 8-15
NUMA node2 CPU(s): 16-23
NUMA node3 CPU(s): 24-31
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm epb tsc_adjust dtherm ida arat pln pts
 

Patrick

Administrator
Staff member
Dec 21, 2010
11,971
4,932
113
@modder man OK this is a somewhat simple fix.

Code:
Socket(s): 32
Did you give the VM 32 sockets with 1 core per socket? Try 2 sockets and 16 cores and it should work.

The problem is that the script is taking 32 sockets * 20MB L3 cache per CPU and giving 640MB L3 cache / 2 = 320 threads.

Here is an example of how you can check use logs:

Code:
docker logs <containerID or container Name>
Here is sample output from one of mine that started with 7ad:
Code:
patrick@Ryzen03:~$ docker logs a7d
16 Threads
8192 L3 Cache KB per CPU
8 L3 Cache MB per CPU
1 Sockets
4 Monero Threads
 

modder man

Active Member
Jan 19, 2015
644
70
28
29
Thanks Patrick I didnt even realize when I built the VM it did that....hashing at 520H/s now. odd that I see 650 Hashes on the box but minergate shows 450.
 
Last edited:
  • Like
Reactions: Patrick

iris

New Member
Mar 28, 2017
2
0
1
40
hi, i was wondering if you could make a docker cpu xmr mining image for nanopool? also, i was wondering what your experiences were with moneropool.com (since that's the default/first image you list)? i just read a major dismantling of them with many negative experiences listed, but i'd rather not disparage them further if you thought the negativity was unfounded.

For those who want an easy way to mine Monero (XMR) using Docker here is a simple way to run a fairly optimized miner in Docker:
Code:
docker run -d -e username=example@example.com servethehome/monero_cpu_minergate
Replace example@example.com with your minergate username.

This Docker image will compile and run Wolf's CPU miner, automatically detect L3 cache size and launch miners using L3 cache / 2 for threads.

The advantage of using this method is that you can use this to easily launch Monero CPU mining on a Docker swarm cluster.

Note, there are no fees for using this image. If you do want to sign up using our minergate affiliate link (this would be appreciated), here it is:
Smart multicurrency mining pool & 1-click GUI miner

This Docker image seems to be working well on 1-4 socket Intel systems:

View attachment 4349

Alternative pool miners (use your wallet address instead of example@example.com)
Alternative 1: Moneropool
Code:
docker run -d -e username=example@example.com servethehome/monero_cpu_moneropool
Alternative 2: xmrpool.net
Code:
docker run -d -e username=example@example.com servethehome/monero_cpu_xmrpooldotnet
Feedback is welcome. NVIDIA mining Docker image coming this week.
 

Patrick

Administrator
Staff member
Dec 21, 2010
11,971
4,932
113
Hi @iris

I just added this to my list for the next day or so to get one made for nanopool.

On the moneropool: I used it for awhile, then switched. We received a lot of requests for them.
 

Patrick

Administrator
Staff member
Dec 21, 2010
11,971
4,932
113
@iris the following are uploaded now:

servethehome/monero_nanopool:latest
servethehome/monero_nanopool:nproc
servethehome/monero_nanopool:zen