PovPool

A simplistic rendering farm hack for POVRay

Thomas Munro
Back to my software page

Introduction

It has become quite a trend amongst my geek friends to buy a cheap PC, set it up running Linux and attach it to a permanent internet connection, stick it in the cupboard and use it as the house-hold mail server, back-up server, internet gateway, fileserver and jukebox.

As an experiment, I made a rendering-farm controller, so I could render POVRay animations on all of my friends' computers at once. It is pre-alpha-quality code, and doesn't handle errors at all well, but if you follow the instructions it works. I assume that you know how to render animations in pov.

If you are seriously interested in real parallel processing with POVRay, check out the pvmpov patch - it uses PVMs to render different patches of each frame on each peer. 'Povpool' is really just a toy.

Downloading and compiling

The source is here: povpool0.1.tgz and it should build on any common garden Unix machine, it's just C.

How to use PovPool

Let's call your own machine the controller (and potentially also a peer), and call all of your friends' machines the peers. Make sure you have the following things set up:

then you just need to create a file in your home directory called .povpool where you list the accounts you can access on other machines. Here is an example:

munro@spitfire:~$ cat ~/.povpool
munro@hog
munro@slob
munro@localhost


It is important to test that ssh is able to log into all of these machines without needing you to type any passphrase or password. To test, you could try sshing into each of the machines in your ~/.povpool file to check if this gives you a shell at the other machine straight away.

The next step is to make sure that your pov scene can be rendered without any errors (because povpool won't tell you what went wrong if povray refuses to render an scene). Here is an example normal povray animation command line (see man povray for an explanation of the options):

$ povray +W320 +H240 +p +x -v +Ihouse.pov +a +KFI0 +KFF50 +KI0 +KF6.283

If this works then you can simple replace povray with povpool and you will be spreading the rendering out evenly over the rendering farm. Here is an example session:

$ povpool +W320 +H240 +p +x -v +Ihouse.pov +a +KFI0 +KFF50 +KI0 +KF6.283
PovPool v0.1 27/01/2002 (c) Thomas Munro http://ip9.org/munro/povpool
Rendering 50 frames.

 munro@localhost                Sending scene          
 munro@slob                     Sending scene          
 munro@hog                      Sending scene          
 munro@localhost                Finished frame       0 in 25s at 3072pps
 munro@localhost                Finished frame       1 in 28s at 2742pps
 munro@slob                     Finished frame       3 in 20s at 3840pps
 munro@localhost                Finished frame       4 in 22s at 3490pps
 munro@hog                      Finished frame       2 in 38s at 2021pps
 munro@slob                     Finished frame       5 in 23s at 3339pps
 munro@slob                     Finished frame       8 in 18s at 4266pps
 munro@hog                      Finished frame       7 in 27s at 2844pps
 munro@localhost                Finished frame       6 in 42s at 1828pps
 munro@slob                     Finished frame       9 in 21s at 3657pps
 munro@slob                     Finished frame      12 in 19s at 4042pps
 munro@hog                      Finished frame      10 in 38s at 2021pps
 munro@localhost                Finished frame      11 in 28s at 2742pps
 munro@slob                     Finished frame      13 in 21s at 3657pps
 munro@hog                      Finished frame      14 in 37s at 2075pps
 munro@slob                     Finished frame      16 in 18s at 4266pps
 munro@localhost                Finished frame      15 in 43s at 1786pps
 munro@hog                      Finished frame      17 in 26s at 2953pps
 munro@slob                     Finished frame      18 in 34s at 2258pps
 munro@localhost                Finished frame      19 in 33s at 2327pps
 munro@hog                      Finished frame      20 in 28s at 2742pps
 munro@slob                     Finished frame      21 in 21s at 3657pps
 munro@localhost                Finished frame      22 in 34s at 2258pps
 munro@slob                     Finished frame      24 in 19s at 4042pps
 munro@hog                      Finished frame      23 in 38s at 2021pps
 munro@localhost                Finished frame      25 in 22s at 3490pps
 munro@slob                     Finished frame      26 in 34s at 2258pps
 munro@hog                      Finished frame      27 in 22s at 3490pps
 munro@localhost                Finished frame      28 in 33s at 2327pps
 munro@slob                     Finished frame      29 in 22s at 3490pps
 munro@hog                      Finished frame      30 in 25s at 3072pps
 munro@slob                     Finished frame      32 in 19s at 4042pps
 munro@localhost                Finished frame      31 in 34s at 2258pps
 munro@slob                     Finished frame      34 in 19s at 4042pps
 munro@hog                      Finished frame      33 in 38s at 2021pps
 munro@slob                     Finished frame      36 in 22s at 3490pps
 munro@localhost                Finished frame      35 in 34s at 2258pps
 munro@hog                      Finished frame      37 in 28s at 2742pps
 munro@localhost                Finished frame      39 in 25s at 3072pps
 munro@slob                     Finished frame      38 in 37s at 2075pps
 munro@hog                      Finished frame      40 in 31s at 2477pps
 munro@slob                     Finished frame      42 in 24s at 3200pps
 munro@localhost                Finished frame      41 in 41s at 1873pps
 munro@hog                      Finished frame      43 in 27s at 2844pps
 munro@slob                     Finished frame      44 in 31s at 2477pps
 munro@localhost                Finished frame      45 in 25s at 3072pps
 munro@hog                      Finished frame      46 in 29s at 2648pps
 munro@localhost                Finished frame      48 in 21s at 3657pps
 munro@slob                     Finished frame      47 in 26s at 2953pps
 munro@hog                      Finished frame      49 in 27s at 2844pps
                                                                            
 munro@localhost                rendered 16 frames
 munro@slob                     rendered 19 frames
 munro@hog                      rendered 15 frames
Totals: Rendered 50 frames in 511s at 7514pps

Note that the pps measurement (pixels per second) includes the transfer overhead, which means that you will get a lower pps if the link is slow (but see the planned pipelining improvement below which will decrease the impact of slow links).

All of the images should now be on your local disk in the present working directory.

How does it work?

First, the input file is preprocessed to replace every #include statement with the contents of the file, if the file can be found in the current working directory. If it cannot be found, the #include statement is left intact. This means that your own include files will be directly included into the scene file, whereas the pov standard libraries (color.inc etc) will be left as #include statements, since these files are available on each peer. This preprocessed single source file is sent by scp to each peer. Each frame is rendered remotely via ssh and the resulting image is copied back to the controller by scp. When each peer finishes a frame, it takes the next available frame and starts on it. This is why the frame numbers overlap sometimes.

Improvements to be made

The following things need to be improved:

In other words it's still a cheap hack.

Remarks

As you can see PovPool is not yet a polished program, but it quite usable. I would like to point out that in my test example, slob is in Gisborne, New Zealand, hog is in London, UK and localhost is in Paris, France. This rendering farm is très global village. Still, these machines are all rather gutless... Hmm I wonder if my boss would notice if I slipped some of our big work servers into my .povpool file...

Comments?

If you have any question or comments please do drop me a line, a patch, or an insult.

Thomas Munro <munro at ip9.org>

$Id: index.html,v 1.5 2002/07/21 22:43:24 munro Exp $