Now Reading
Monero NVIDIA GPU Mining with Docker and nvidia-docker
6

Monero NVIDIA GPU Mining with Docker and nvidia-docker

by Patrick KennedyFebruary 15, 2017

This is a quick guide to mining Monero, a popular cryptocurrency, on a NVIDIA GPU using nvidia-docker. The benefit of this method is that you can use spare GPU cycles on a machine learning server without having to deal with differing CUDA dependencies. Our CPU mining Docker image has tens of thousands of pulls so we are adding a NVIDIA GPU miner.

Quick NVIDIA GPU Monero Mining Performance

Here are a few quick reference points in terms of performance using ccminer-cryptonight, a popular open source Monero NVIDIA GPU miner:

NVIDIA Monero Performance

NVIDIA Monero Performance

We highlighted the NVIDIA GRID M40 extensively. You can also find the ASUS GTX 1060 6GB Dual-Fan we are using here in Deeplearning01 and the PNY GTX 1050 Ti in Deeplearning02.

These are not the most efficient GPUs to mine Monero on, however, if you are looking for something to run when you are not running AI algorithms, this can be a decent option. They can also run while CPUs are running in the background.

Getting Started with Monero NVIDIA GPU Mining with Docker and nvidia-docker

We are going to assume that you have Docker, NVIDIA drivers and nvidia-docker installed. You will also need a free Minergate account. We are also going to use example@example.com as our account name at Minergate to use in the following examples. You will want to change that to a real address.

If you have a single GPU you can simply use the following one line launch command:

nvidia-docker run -d -e username=example@example.com servethehome/monero_gpu_nv_minergate

This downloads and runs a GPU miner on your NVIDIA GPU.

If you have multiple NVIDIA GPUs you need to target one container per GPU. Luckily, with nvidia-docker it is easy to target different GPUs with a container. Here is the example for a dual GPU system:

NV_GPU=0 nvidia-docker run -d -e username=example@example.com --name GPU0_monero servethehome/monero_gpu_nv_minergate
NV_GPU=1 nvidia-docker run -d -e username=example@example.com --name GPU1_monero servethehome/monero_gpu_nv_minergate
.... and etc.

We have successfully used this method with up to 8 GPUs in a single system. On the same system, we have also used our CPU mining Docker image to run a total of 9 miners.

ASUS GeForce GTX 1060 6GB OC Dual Fa

ASUS GeForce GTX 1060 6GB OC Dual Fa

Again, in the above replace example@example.com with your minergate username. We are tagging each GPU using NV_GPU and naming each of the miners so you can see which miner attaches to which GPU. That is an important trick when you have multiple GPUs in a system. For example, you can have GPU1 running Tensorflow, GPU2 running NVIDIA DIGITS and GPU3 running Monero mining.

Note, there are no fees for using our nvidia-docker mining image. The mining software is open source, however, minergate does have a low 1% fee. That is lower than other pools we had tried so we are using it in our Docker image.

The advantage of using this method is that you can use this to easily launch Monero GPU mining on NVIDIA GPUs without having to worry about CUDA dependencies.

Final Words

NVIDIA GPUs are not well known for excellent cryptocurrency mining. On the other hand, NVIDIA GPUs are the most commonly deployed GPUs for machine learning/ AI. As a result, many GPUs are deployed in servers and underutilized. This is an interesting way to make a few dollars while learning to use nvidia-docker.

While it was relatively straightforward to get this nice setup working for NVIDIA, for AMD GPUs it is *significantly* harder. The AMD GPU compute ecosystem is still a long way from where NVIDIA’s maturity level is. We have been testing a few images and the AMD GPUs are actually faster, but harder to orchestrate.

We did receive comments from an engineer at a large streaming video “flix” service that our NVIDIA GPU setup can be made more Docker Swarm friendly by not using nvidia-docker. We will be providing a Docker Swarm friendly option soon unless NVIDIA’s team can make this work in the meantime.

This is also a great opportunity to join the STH forums. We have a number of members actively using our Docker images and it is a great community to get involved with if you want to start using spare CPU and GPU cycles in your servers.

About The Author
Patrick Kennedy
Patrick has been running ServeTheHome since 2009 and covers a wide variety of home and small business IT topics. For his day job, Patrick is a management consultant focused in the technology industry and has worked with numerous large hardware and storage vendors in the Silicon Valley. The goal of STH is simply to help users find some information about basic server building blocks. If you have any helpful information please feel free to post on the forums.
6 Comments

Leave a Response