Local and remote ZeroConf service discovery for hardware resources.
HW-SD is a library and daemon for the discovery and announcement of hardware resources using ZeroConf. It enables auto-configuration of ad-hoc GPU clusters and multi-GPU machines.
The HW-SD library uses modules which implement discovery using different protocols. Each module is a separate library, which can be selectively linked by applications, which limits dependencies. Currently available are:
When an application is run through VirtualGL, hwsd detects this and sets the FLAG_VIRTUALGL on all local GPUs, and additionally FLAG_VIRTUALGL_DISPLAY on the GPU used by VirtualGL for redirection. This is only implemented for GLX so far (more info).
The daemon uses all available local modules to query local GPUs and network interfaces to announce them using ZeroConf to the local network. The service type name is "_gpu-sd" and "_net_sd". The dns_sd discovery module gathers the information announced by all daemons on the local network. The following protocol is used by the daemon:
HWSD is a cross-platform library, designed to run on any modern operating system, including all Unix variants and the Windows operating system. Zeroconf support in Lunchbox is required for the DNS_SD module and applications. The following platforms and build environments are tested:
The build system is using CMake, with the standard CMake build process:
git clone https://github.com/Eyescale/hwsd.git cd hwsd mkdir build cd build cmake .. make
A ZeroConf implementation is required for the dns_sd module and the daemon. On Mac OS X it is part of the operating system, on Linux AVAHI is tested ('sudo apt-get install libavahi-compat-libdnssd-dev' on Ubuntu), on Windows use the Bonjour SDK. If no ZeroConf implementation is found, HW-SD is only compiled with local discovery modules.
No bugs were known at release time. Please file a Bug Report if you find any issue with this release.
An application can use the discovery by linking the relevant module libraries, instantiating the modules in the code and then quering the instantiated modules. The following will find all remote and local GPUs and local network interfaces on Windows:
#include <hwsd/hwsd.h> hwsd::gpu::wgl::Module::use(); hwsd::gpu::dns_sd::Module::use(); const hwsd::GPUInfos& gpus = hwsd::discoverGPUInfos(); hwsd::net::sys::Module::use(); const hwsd::NetInfos& nets = hwsd::discoverNetInfos();
Filters are chainable functors which can be passed to the query function to discard information. The following filters are provided: