Containerized, hardware accelerated, and virtualized!
Don’t you want to do something more useful with your silicon and electricity than producing low entropy outputs of hash functions?
There is a way. From Wikipedia:
The Berkeley Open Infrastructure for Network Computing (BOINC, pronounced /bɔɪŋk/ – rhymes with “oink”) is an open-source middleware system for volunteer computing and grid computing.
From the official BOINC website:
BOINC lets you help cutting-edge science research using your computer. The BOINC app, running on your computer, downloads scientific computing jobs and runs them invisibly in the background. It’s easy and safe.
Needless to say, the security conscientious among us will raise one or even two eyebrows when they read that some maybe non-Open Source binary blobs are automatically downloaded from somewhere in the internet and then executed on your machine. But not to worry! One of the purposes of containers was exactly to solve that; to isolate software. Again from Wikipedia:
OS-level virtualization is an operating system paradigm in which the kernel allows the existence of multiple isolated user space instances. Such instances, called containers […] may look like real computers from the point of view of programs running in them. A computer program running on an ordinary operating system can see all resources (connected devices, files and folders, network shares, CPU power, quantifiable hardware capabilities) of that computer. However, programs running inside of a container can only see the container’s contents and devices assigned to the container.
So I set out to develop a Docker Container image which allows running BOINC with full hardware power (GPU computing via OpenCL, virtualization via VirtualBox), but in complete isolation of the host system.
For AMD GPUs, this was a bit more straightforward than for NVIDIA GPUs.
For AMD GPUs, I just published this small but sweet Dockerfile project on Github which sets up a minimal image with software only from the official Debian repository. See https://github.com/michaelfranzl/container-boinc
For NVIDIA, the host system needs additional software from non-Debian repositories to be able to ‘forward’ the GPU into containers. This will be the topic of a future blog post.
Meanwhile, happy number crunching!