Remote rendering?

ok, a bit a strange title, but i didn’t know how to label this otherwise. what i’m after is the question, if there is a way to run yafray on a remote host for rendering through blender? i have here my server which is console-only and running 24h. that would be a nice and fast machine to do rendering jobs while i do other work on my desktop machines. now i have been curious to know if blender already supports a sort of remote rendering or if i have to do it myself. if so is there a kind of packed format ( xml or alike ) that yafray understands and that contains all the data required for rendering?

I think there might be some render managers that support yafray, but I’m not quite sure if you can get them, as they are used by big render farm companys, and I guess also self-written by them…

You will at least have to ship textures with the scene file, but everything else is stored in xml’s, it is also possible to store different data in different xml’s…

I guess best you can do for now is put the textures with folders/subfolders and the xml file into a main folder and copy it to your machine…

rendering from command line will be easy then…

ah i guess you just missed the xml button in render options in blender?

when you press that blender exports a xml scene. all you need to do than is to stop blender to render and copy that xml to your server pc.
you only have to set the export path in the pref. panel.

than drap and drop that file one a shortcut to yafray and yafray will start rendering.

i am not sure if your server has a script function which checks a folder for incoming files and thansend the file to an application to execute it.

i used that with yellowdog linux and 3delight. we just had a watch folder.
we copied the rib files into it and YDL just send them directly to 3delight to render.

claas

i can not use the render-to-xml and stop rendering as blender looks up on it and i need to xkill it. another way to get data into the xml file?

arg that problem. well that seemed to be an issue with the builds.

did you try out new builds from yafray and blender? i dont have that
problem anymore.

i think there are also still some export script for yafray into xml.
yable and exporter are scripts i remember.

claas

i have unmasked gentoo builds of both… i assume that should be fairly current ;).

Just run blender from command line. I remote render all the time this way.

You just need to install blender on your remote though.

so you can run blender via the command line and let it use yafray as the engine? sweet.

how do you than save the rendering when you dont have the interface (GUI) to enter names and select the path???

so you can run blender via the command line and let it use yafray as the engine? sweet.

how do you than save the rendering when you dont have the interface (GUI) to enter names and select the path???

yep, select yafray as the renderer in the Blend file. If you specify a jpg, Blender defaults to some name like 0001.jpg. BTW, this is exactly how I’m (shell) scripting Blender on my cluster. I’m sure most render farms use the same kind of thing. I had a post over in the developer’s forum that Blender needs more command line commands so one could override the file settings…it’s very tedious checking that the blend files have the right settings to do what you want it to do.

uh…you obviously need to install yafray on the remote if you’re going to use that renderer.

i could try this out… not sure if i get things installed without X getting dragged into play. mind to post what command line args you fiddle around with?

All options:
Blender -h

Animation frames 1 to 100:
blender -b yourblenderfile.blend -s 1 -e 100 -a

Pic of frame 10:
blender -b yourblenderfile.blend -f 10

Online help:
http://download.blender.org/documentation/html/a19823.html

If you use Linux on both PCs you can use my little hack for yafray rendering. I renamed the regular yafray binary in /usr/bin/yafray to yafray.bin and I created a script /usr/bin/yafray


#!/bin/sh
rsync /tmp/YBtest.xml user@renderfarm:~/
(ssh user@renderfarm "nohup yafray -c 1 ~/YBtest.xml" ; rsync user@renderfarm:/tmp/YBtest.tga /tmp/YBtest.tga ; firefox /tmp/YBtest.tga ) &

If you select XML, it will render on the renderfarm, if you unselect it, it will render locally.

Of course, you need to set up a passwordless authentificaton link
and renderfarm must have sshd server running.

later one looks interesting. i’ve to definitly check this out. thanks people.

That is interesting with the XML. You could probably get that to work in windows too. But I don’t use yafray too much, I wonder if you could use the XML output and renderfarm with blender internal via command line?

I wonder if you could use the XML output and renderfarm with blender internal via command line?

No, since blender can’t parse the yafray xml back and render that. But with blender internal you can create a script with will work the same way. Only it won’t be possible (without python scripting) to execute it from blender. You will write on command line something like ./renderfarm.sh test.blend, which will work the same way, rsync, ssh, rsync. I haven’t looked into it, since my renderfarm doesn’t have xorg-x11 installed, so I’m waiting for standalone blender renderer :wink:

I have an ssh access to a remote windows machine, which I can use for rendering. It has OpenSSH and Yafray installed, without Blender. I am logging in from a Linux box.
It works and this is how I do it:
I do the modeling on my local Linux box in Blender. In the user preferences I have set the “default directory for Yafray xml export” and the button called “xml” (F10 - Render buttons - Yafray tab) is pushed (“on”).
After pressing F12 I wait a little for Blender to write the xml file and then from the console I kill yafray.
Then I open the xml file called YBtest.xml in a text editor and change the path to the image textures (jpg files) I have used in the scene (you should know their names and find them easilly in the text). I change the path so that it will corespond to the actual path on the remote machine where I will put these textures.
Then I scp the textures and the YBtest.xml file on the desired location on the remote computer, log in via ssh and type on the prompt something like:
“c:\program files\yafray\yafray” c:\YBtest.xml

I then check the output from yafray to see if everything is O.K. to the line “Fake pass”.

Because I dont know and couldn’t find a better way to detach yafray from the terminal under DOS, so I could close the connection and shut down my computer without interrupting the render process, I then just close the terminal window with the x-button.
I found that this doesn’t terminate the rendering, but closes the connection.

Now I am very happy, because I can use that machine to do some rendering during the night :wink:

Happy blending!!!

Hey, I just posted a feature request on the blender dev site that will greatly aid in remote rending. Like you guys mention you can run blender from a console, but it doesn’t give you many options, and the addition of many options would be cumbersome for the coders.

The render options are made available via python for scripting inside of blender, my suggestion was the ablity to run a python script on a given blender file, as if you had a script open in the text-editor inside of blender and pressed “Alt-P”. This would allow you to simply modify a config file that a python script would load to set render options (and anything else that python can access withen blender for that matter.)

My suggested syntax is a coupling of existing commands:
blender -b my_blender_file.blend -P my_python_script.py arg_to_python_script another_arg_to_script

If anyone is interested I can go into more detial into how this would solve the issues with remote rendering, just ask.

The feature request can be see here:
http://www.blender.org/forum/viewtopic.php?p=52268#52268

Well, I guess I should try all possiblities, like the obvious, duh, before saying something can’t be done.:rolleyes:



blender -B your_artwork.blend -P your_render_script.py

Does what you would hope, it loads the blender file, the executes the script on it. For example, I made the following test script:



import Blender
from Blender import *

scene = Scene.GetCurrent()

render_dat = scene.getRenderingContext()
render_dat.setRenderPath('/tmp/')
render_dat.enableRayTracing(1)
render_dat.enableShadow(1)
render_dat.imageSizeX(320)
render_dat.imageSizeY(240)
render_dat.enableOversampling(0)
render_dat.render()
render_dat.saveRenderedImage('/my_test_render.png')

Note (VERY IMPORTANT): saveRenderedImage() is relative to the renderpath even when you start with the root dir (atleast on linux) ie:


render_dat.setRenderPath('/tmp/tmp_blender/')
render_dat.saveRenderedImage('/home/bobshome/blender/my_pic.png')

Would save the image to:
‘/tmp/tmp_blender/home/bobshome/blender/my_pic.png’:confused:

But there is what you’d need for doing remote rendering based on a python script. However, I can’t seem to find anyway to pass arguements into the python script. But give me a couple of days and I’ll stumble on it and feel like a dimwit. :smiley:

I really should do my homework before I post, when the python script gets executed it gets all the arguements that you passed to blender, even ones that blender doesn’t understand. I.e.:



blender -B /tmp/rcv/test.blend -P TestBlender.py "an arg for py"

Gives:



Using Python version 2.4
0: /home/ntroutman/blender
1: -B
2: /tmp/rcv/test.blend
3: -P
4: TestBlender.py
5: an arg for py

Where the TestBlender.py has:



import Blender, sys

i=0
for arg in sys.argv:
        print "%i: %s" % (i, arg)
        i+=1

So now you have it, you can do all forms of remote rendering by using python as your link between your remote rendering program and blender.