Vray Distributed Rendering and RT

We’re looking to utilize deadline to launch the Vray Spawners for Distributed Rendering and Vray Realtime.

My initial thought is to just do a command line job submission as I just need to execute the spawner.exe’s.

I was curious if this is best approach, or perhaps if there is a ‘job script’ out there already for this task, or if writing a job script for this task is the best way to go…

Thanks in Advance

Keith R Morrison
focus360.com

Hey Keith,

The command line job submission should work well, since it will “reserve” the slave machines, and you don’t have to worry about them picking up another Deadline job while they’re doing a DR job.

Another option, which is along the same idea, is to write a custom plugin that starts the spawners on the slaves. The minor benefit is that you can wrap the spawner process stuff in the plugin so you don’t need to worry about it at submission, but of course there is the extra work of writing the plugin, which in your case probably isn’t necessary. :wink:

Cheers,

  • Ryan

Thanks for the input…

If I did write a job script, can I easily monitor the process from the slave machine? I’ve not looked at job scripting at all yet… Ideally I’d like to end the whole job after a period of process inactivity… some artist are forgetful… :slight_smile:

Yup, you could have your custom plugin monitor the process on the slave machine. For your other question about ending the whole job after a periodic inactivity, I’m pretty sure you could do this in Deadline 6 (which is currently in beta). In Deadline 6, we’ve added a new AbortRender function to the plugin API that accepts an AbortLevel value. One of the values will mark the job’s task as complete. So what you could do is design a plugin that launches the vray process, and then monitors the cpu usage of the process (I’m sure there are python modules for this). After it becomes inactive, it would then stop the spawner process, and call the abort function to mark the task as complete.

I know this is all pretty hand-wavy, but I think the idea should work. For Deadline 5, I can’t really think of a good way to deal with the method of properly stopping a job from the plugin.

If you are interested in the v6 beta, shoot an email to beta@thinkboxsoftware.com and they’ll get you on the beta board.

Cheers,

  • Ryan

Keith, i’d be very interested in how you did this in 5.2 if you do. would you be prepared to share your script?

We run V-Ray for Rhino this way. The spawners can be configured as Windows services using Microsoft’s srvany utility. They run when invoked (below) but don’t display to a user on the machine. A Deadline Event script plug-in runs on job start up with this kind of pattern:

def OnJobStarted( self, job ):
RunProcess(“C:\Wolcmd.exe”,’ “” ‘+’ “” ‘+’ “” ‘+’ “9” ', “C:\”, -1)
etc. for the number of machines running the render slaves. “Wolcmd” is a Wake on LAN applet that takes command
line parameters and, hence, fits well with this Event plug-in approach. This lets machines sleep when not in use.

    RunProcess( "C:\\PsService.exe", ' "\\\\<machinename>" '+' "restart" '+'  "<renderservicename>" ',  "C:\\" , -1)
    etc. for the same machines.  This uses Microsoft's PsTools suite to start the service that launches the spawners.

At the end of this you have the machines awake and the spawners running. The Deadline Slave machine then gets the job. We’ve configured the Deadline Rhino plug-in, which provides the commands to start Rhino rendering, with a couple of Rhinoscript parameters that tell the Slave where to find the material library, inject a dummy material into the file (which then allows V-Ray to search the entire library* for any missing materials that came from it), and call a .rvb file that allows us to lock in some V-Ray parameters (e.g. SetDistributedRenderingOn…). The Slave’s copy of V-Ray for Rhino is configured with the addresses of the servers running the spawners, so when the job hits it knows where to find them. When the job is finished, in the normal Deadline fashion, the rendered file is saved and Rhino closes. There’s then a custom “onJobFinished” Event plug-in that stops the spawners, e.g.:

def OnJobFinished( self, job ):
RunProcess( “C:\PsService.exe”,’ “\\” ‘+’ “stop” ‘+’ “” ', “c:\”, -1)
etc.

We’ve found that it’s good to start and stop the spawners with each job, in terms of quality, and this does it.

We have other bells and whistles for our purposes, taking advantage of some Deadline features, like sending out mail to the user when their job starts. With this we’ve put in a free screen scraper app that’s web-accessible (ScreenStream) and include the URL in this e-mail notification, so a user can click on that link and watch the live progress of their job. We configured some of the Deadline scripts so the user can choose to run either Rhino 4 (V-Ray 1.029) or Rhino 5 (V-Ray 1.5) and the appropriate spawners are started. Deadline’s quite flexible for this and, combined with some of these other third-party tools, can let you manage the process without intervention.