AWS Thinkbox Discussion Forums

Custom Vrayspawnerplugin for c4d question

Hi
Im trying to modify the Vray spawner plugin to start the vray standalone that comes with Vray for c4D. Vrayc4d is now at version 1.8 (Vray 2.4) and now supports DR. As there is no spawner app (osx) included with the Vrayc4d, i usually start the server with this argument to use DR with Cinema: “/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray -server”. But if i use that as a predefined executable in my custom Vray spawner plugin, i get this error:

Error in RenderExecutable: Cinema4D VRay Spawner executable was not found in the semicolon separated list "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray -server".

If i just point to ./vray without the “-server” argument, the job starts but the server is not started on the slave.

Any suggestions?

Cheers
Bonsak
VraySpawner-custom.zip (3.06 KB)

In VraySpawner.py, you need to add a callback for RenderArgument, and then return “-server” as your render argument. See the code below.

Cheers,
Ryan

from System.IO import *

from Deadline.Scripting import *
from Deadline.Plugins import *

def GetDeadlinePlugin():
    return VraySpawnerPlugin()

def CleanupDeadlinePlugin( deadlinePlugin ):
    deadlinePlugin.Cleanup()

class VraySpawnerPlugin(DeadlinePlugin):
    
    def __init__(self):
        self.InitializeProcessCallback += self.InitializeProcess
        self.RenderExecutableCallback += self.RenderExecutable
        self.RenderArgumentCallback += self.RenderArgument
    
    def Cleanup(self):
        for stdoutHandler in self.StdoutHandlers:
            del stdoutHandler.HandleCallback
        
        del self.InitializeProcessCallback
        del self.RenderExecutableCallback
        del self.RenderArgumentCallback
    
    def InitializeProcess(self):
        self.SingleFramesOnly=False
        self.StdoutHandling=False
        
    def RenderExecutable(self):
        version = self.GetPluginInfoEntry( "Version" )
        vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
        vrayExe = FileUtils.SearchFileList( vrayExeList )
        if( vrayExe == "" ):
            self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )

        return vrayExe

    def RenderArgument(self):
        return "-server"

Hi
Thanks, thats great!
Should Deadline automatically quit the Vray standalone when i set the job to complete? As it is now the vray.bin process i still running after the jobs is set to complete.

Cheers
Bonsak

It should be. Has the slave dropped the job and is now idle, or is it still “rendering” the spawner job?

Yes the slaves are idle but the vray.bin is still running on the machines. It might have something to do with the way Vray is started. The executable on osx is:

/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray -server

But the "“vray” executable just points to another executable called vray.bin like this:

#!/bin/bash export DYLD_LIBRARY_PATH=/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/lib/snow_leopard_x64/gcc-4.2 export PYTHONHOME=/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/Python export PYTHONPATH=/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/Python/lib/python2.6/site-packages:$PYTHONPATH /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray.bin $*
If i set the executable to vray.bin in Deadline it errors out because it cant find the gcc-4.2 lib

So it might be that Deadline only has control of the first executable and has no notion of the vray.bin process.

Cheers
Bonsak

Strange… Deadline should be aware of the entire process tree.

Can you post the log from the slave when it was working on this job? From the Slave menu, just select Help -> Explore Log Folder, and find the corresponding slave log.

Thanks!

My bad, its looking for “libcgauth.dylib” Here’s the log:

=======================================================
Error
=======================================================
Error in CheckExitCode: Renderer returned non-zero error code, 133. Check the log for more information.
  at Deadline.Plugins.ScriptPlugin.RenderTasks (System.String taskId, Int32 startFrame, Int32 endFrame, System.String& outMessage, FranticX.Processes.AbortLevel& abortLevel) [0x00000] in <filename unknown>:0 

=======================================================
Type
=======================================================
RenderPluginException

=======================================================
Stack Trace
=======================================================
  at Deadline.Plugins.Plugin.RenderTask (System.String taskId, Int32 startFrame, Int32 endFrame) [0x00000] in <filename unknown>:0 
  at Deadline.Slaves.SlaveRenderThread.RenderCurrentTask (Deadline.IO.TaskLogWriter tlw) [0x00000] in <filename unknown>:0 

=======================================================
Full Log
=======================================================
0: Task timeout is disabled.
0: Loaded job: Untitled (52ced50ebd659398979fdc8f)
0: INFO: Executing plugin script /Users/bonsak/Library/Application Support/Thinkbox/Deadline6/slave/Bonsak-work/plugins/52ced50ebd659398979fdc8f/VraySpawner.py
0: INFO: About: VRay Spawner Plugin for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 0
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray.bin"
0: INFO: Argument: -server -verboseLevel=3
0: INFO: Startup Directory: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2"
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: dyld: Library not loaded: @executable_path/libcgauth.dylib
0: STDOUT:   Referenced from: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray.bin
0: STDOUT:   Reason: image not found
0: INFO: Process exit code: 133


=======================================================
Details
=======================================================
Date: 01/09/2014 17:58:26
Frames: 0
Elapsed Time: 00:00:00:04
Job Submit Date: 01/09/2014 17:57:52
Job User: bonsak
Average RAM Usage: 10977750016 (32%)
Peak RAM Usage: 10982965248 (32%)
Average CPU Usage: 7%
Peak CPU Usage: 12%

=======================================================
Slave Information
=======================================================
Slave Name: Bonsak-work
Version: v6.1.0.54343 R
Operating System: Mac OS X 10.8.3
Machine User: bonsak
IP Address: 10.0.0.2
MAC Address: 00:23:df:df:27:1b
CPU Architecture: x86_64
CPUs: 16
CPU Usage: 3%
Memory Usage: 10.2 GB / 32.0 GB (31%)
Free Disk Space: 2.457 GB 
Video Card: ATI Radeon HD 4870

So just to confirm, after this error occurs, vray.bin is still running? Or was that maybe an existing instance that is continuing to run?

Also, which version of Deadline 6.1 are you running? It seems to be a Python-related issue, and we’ve resolved some general issues like these during the beta. If you’re on the RC1, you may need to make some additional changes to the plugin.

Cheers,
Ryan

No the previous log is what happens if i use “vray.bin” as executable instead of just “vray”.
Heres the slave log when using “vray -server” as executable. Deadline is RC1. After this job is set to complete and the slave is idle, the vray.bin process is still running:

Scheduler Thread - Synchronizing job auxiliary files from /Volumes/DeadlineRepository6/jobs/52cedbefbd659398979fdc92 Scheduler Thread - All job files are already synchronized Scheduler Thread - Synchronizing plugin files from /Volumes/DeadlineRepository6/custom/plugins/VraySpawner Scheduler Thread - Synchronization time for plugin files: 21.024 ms Constructor: VraySpawner 0: Task timeout is disabled. 0: Loaded job: Untitled (52cedbefbd659398979fdc92) 0: INFO: Executing plugin script /Users/bonsak/Library/Application Support/Thinkbox/Deadline6/slave/Bonsak-work/plugins/52cedbefbd659398979fdc92/VraySpawner.py 0: INFO: About: VRay Spawner Plugin for Deadline 0: INFO: The current environment will be used for rendering 0: Plugin rendering frame(s): 0 0: INFO: Stdout Handling Enabled: False 0: INFO: Popup Handling Enabled: False 0: INFO: Using Process Tree: True 0: INFO: Hiding DOS Window: True 0: INFO: Creating New Console: False 0: INFO: Executable: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray" 0: INFO: Argument: -server -verboseLevel=3 0: INFO: Startup Directory: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2" 0: INFO: Process Priority: BelowNormal 0: INFO: Process Affinity: default 0: INFO: Process is now running 0: STDOUT: [2014/Jan/9|18:27:59] Reading configuration from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2//vrayconfig.xml" 0: STDOUT: [2014/Jan/9|18:27:59] =============================================== 0: STDOUT: [2014/Jan/9|18:27:59] V-Ray Standalone, version 2.25.01 for x64 0: STDOUT: [2014/Jan/9|18:27:59] Copyright (C) 2000-2012 Chaos Group Ltd. All rights reserved. 0: STDOUT: [2014/Jan/9|18:27:59] Use -credits option for additional third-party copyright notices. 0: STDOUT: [2014/Jan/9|18:27:59] 0: STDOUT: [2014/Jan/9|18:27:59] Build from Oct 7 2013, 18:16:04 0: STDOUT: [2014/Jan/9|18:27:59] Compiled with GCC-compatible compiler, version 4.2 0: STDOUT: [2014/Jan/9|18:27:59] Operating system is Mac OS X 0: STDOUT: [2014/Jan/9|18:27:59] 0: STDOUT: [2014/Jan/9|18:27:59] V-Ray core version is 2.00.02 0: STDOUT: [2014/Jan/9|18:27:59] =============================================== 0: STDOUT: [2014/Jan/9|18:27:59] 0: STDOUT: [2014/Jan/9|18:27:59] Loading plugins from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_*.so" 0: STDOUT: [2014/Jan/9|18:27:59] warning: Open of shared library `/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so' failed because: 0: STDOUT: [2014/Jan/9|18:27:59] warning: dlopen(/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so, 5): Library not loaded: ./lib/snow_leopard_x64/gcc-4.2/libglslang.dylib 0: STDOUT: Referenced from: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so 0: STDOUT: Reason: image not found 0: STDOUT: [2014/Jan/9|18:27:59] warning: Duplicate plugin IDs: MtlVismat and MtlVRmat ---- 2014/01/09 18:28 ---- 0: STDOUT: [2014/Jan/9|18:27:59] 132 plugin(s) loaded successfully 0: STDOUT: [2014/Jan/9|18:27:59] Loading plugins from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libstd_*.so" 0: STDOUT: [2014/Jan/9|18:27:59] Finished loading plugins. 0: STDOUT: [2014/Jan/9|18:27:59] Entering server mode - waiting for render requests on port 20207. Press Ctrl+C to exit. Connecting to slave log: Bonsak-work Scheduler Thread - Task "0_0-0" could not be found because task has been modified: current status = Rendering, new status = Completed current slave = Bonsak-work, new slave = Bonsak-work current frames = 0-0, new frames = 0-0 Scheduler Thread - Cancelling task... 0: In the process of canceling current task: ignoring exception thrown by PluginLoader Scheduler Thread - In the process of canceling current tasks: ignoring exception thrown by render thread 0

Cheers
Bonsak

Thanks! Let’s try one thing before we attempt using vray.bin directly. Here is some updated plugin code:

from System.IO import *

from Deadline.Scripting import *
from Deadline.Plugins import *

def GetDeadlinePlugin():
    return VraySpawnerPlugin()

def CleanupDeadlinePlugin( deadlinePlugin ):
    deadlinePlugin.Cleanup()

class VraySpawnerPlugin(DeadlinePlugin):
    
    def __init__(self):
        self.InitializeProcessCallback += self.InitializeProcess
        self.RenderExecutableCallback += self.RenderExecutable
        self.RenderArgumentCallback += self.RenderArgument
    
    def Cleanup(self):
        for stdoutHandler in self.StdoutHandlers:
            del stdoutHandler.HandleCallback
        
        del self.InitializeProcessCallback
        del self.RenderExecutableCallback
        del self.RenderArgumentCallback
    
    def InitializeProcess(self):
        self.SingleFramesOnly=False
        self.StdoutHandling=False
        
        self.AddStdoutHandlerCallback(".*Entering server mode.*").HandleCallback += self.Testing
        
    def RenderExecutable(self):
        version = self.GetPluginInfoEntry( "Version" )
        vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
        vrayExe = FileUtils.SearchFileList( vrayExeList )
        if( vrayExe == "" ):
            self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )

        return vrayExe

    def RenderArgument(self):
        return "-server"
        
    def Testing(self):
        self.LogInfo( "PROCESS IDS:" )
        for pid in self.GetProcessIDs():
            self.LogInfo( "  " + str(pid) )

It should print the IDs for the processes that Deadline is aware of. You can then run ps -A in a terminal to compare them to all currently running processes and see if the vray.bin one is one of the processes that Deadline is aware of.

Thanks!
Ryan

Thank you!
The slave log doesn’t print any “PROCESS IDS:” statements with the updated code though, but the “vray.bin” is being started when running the script. And its still running after job is completed. ps -A only lists one vray process (vray.bin)

Constructor: VraySpawner 0: Task timeout is disabled. 0: Loaded job: Untitled (52cf30538147e1de16a3d904) 0: INFO: Executing plugin script /Users/bonsak/Library/Application Support/Thinkbox/Deadline6/slave/Bondes/plugins/52cf30538147e1de16a3d904/VraySpawner.py 0: INFO: About: VRay Spawner Plugin for Deadline 0: INFO: The current environment will be used for rendering 0: Plugin rendering frame(s): 0 0: INFO: Stdout Handling Enabled: False 0: INFO: Popup Handling Enabled: False 0: INFO: Using Process Tree: True 0: INFO: Hiding DOS Window: True 0: INFO: Creating New Console: False 0: INFO: Executable: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray" 0: INFO: Argument: -server 0: INFO: Startup Directory: "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2" 0: INFO: Process Priority: BelowNormal 0: INFO: Process Affinity: default 0: INFO: Process is now running 0: STDOUT: [2014/Jan/10|00:27:43] Reading configuration from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2//vrayconfig.xml" 0: STDOUT: [2014/Jan/10|00:27:43] =============================================== 0: STDOUT: [2014/Jan/10|00:27:43] V-Ray Standalone, version 2.25.01 for x64 0: STDOUT: [2014/Jan/10|00:27:43] Copyright (C) 2000-2012 Chaos Group Ltd. All rights reserved. 0: STDOUT: [2014/Jan/10|00:27:43] Use -credits option for additional third-party copyright notices. 0: STDOUT: [2014/Jan/10|00:27:43] 0: STDOUT: [2014/Jan/10|00:27:43] Build from Oct 7 2013, 18:16:04 0: STDOUT: [2014/Jan/10|00:27:43] Compiled with GCC-compatible compiler, version 4.2 0: STDOUT: [2014/Jan/10|00:27:43] Operating system is Mac OS X 0: STDOUT: [2014/Jan/10|00:27:43] 0: STDOUT: [2014/Jan/10|00:27:43] V-Ray core version is 2.00.02 0: STDOUT: [2014/Jan/10|00:27:43] =============================================== 0: STDOUT: [2014/Jan/10|00:27:43] 0: STDOUT: [2014/Jan/10|00:27:43] Loading plugins from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_*.so" 0: STDOUT: [2014/Jan/10|00:27:43] warning: Open of shared library `/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so' failed because: 0: STDOUT: [2014/Jan/10|00:27:43] warning: dlopen(/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so, 5): Library not loaded: ./lib/snow_leopard_x64/gcc-4.2/libglslang.dylib 0: STDOUT: Referenced from: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libvray_MtlGLSL.so 0: STDOUT: Reason: image not found 0: STDOUT: [2014/Jan/10|00:27:44] warning: Duplicate plugin IDs: MtlVismat and MtlVRmat 0: STDOUT: [2014/Jan/10|00:27:44] 132 plugin(s) loaded successfully 0: STDOUT: [2014/Jan/10|00:27:44] Loading plugins from "/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/plugins/libstd_*.so" 0: STDOUT: [2014/Jan/10|00:27:44] Finished loading plugins. 0: STDOUT: [2014/Jan/10|00:27:44] Entering server mode - waiting for render requests on port 20207. Press Ctrl+C to exit. ---- 2014/01/10 00:29 ---- 0: STDOUT: [2014/Jan/10|00:29:24] Starting DR session from 127.0.0.1 0: STDOUT: [2014/Jan/10|00:29:24] Receiving DR scene from 127.0.0.1 0: STDOUT: [2014/Jan/10|00:29:24] Reading scene file "/tmp/vrscene_20207.txt" 0: STDOUT: [2014/Jan/10|00:29:24] /tmp/vrscene_20207.txt: done [ 0h 0m 0.0s] 0: STDOUT: [2014/Jan/10|00:29:24] Scene file parsed successfully in 0.0 s. 0: STDOUT: [2014/Jan/10|00:29:24] Scene created successfully. 0: STDOUT: [2014/Jan/10|00:29:24] Objects in scene: 34 0: STDOUT: [2014/Jan/10|00:29:24] Starting render sequence. 0: STDOUT: [2014/Jan/10|00:29:24] Preparing renderer... 0: STDOUT: Preparing scene for rendering...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est] [2014/Jan/10|00:29:24] Preparing scene for rendering...: done [ 0h 0m 0.0s] 0: STDOUT: [2014/Jan/10|00:29:24] warning: Subpixel color mapping is on: rendered result may have incorrect brightness. 0: STDOUT: [2014/Jan/10|00:29:24] warning: The 'linear workflow' option is deprecated and will be removed. Consider turning it off. 0: STDOUT: [2014/Jan/10|00:29:24] ======================== 0: STDOUT: [2014/Jan/10|00:29:24] Starting frame 0. 0: STDOUT: Preparing scene for frame...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est] [2014/Jan/10|00:29:24] Preparing scene for frame...: done [ 0h 0m 0.0s] 0: STDOUT: Compiling geometry...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est] [2014/Jan/10|00:29:24] Compiling geometry...: done [ 0h 0m 0.0s] 0: STDOUT: Building static raycast accelerator...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est] [2014/Jan/10|00:29:24] Building static raycast accelerator...: done [ 0h 0m 0.0s] 0: STDOUT: [2014/Jan/10|00:29:24] SDTree statistics: 0: STDOUT: [2014/Jan/10|00:29:24] Total number of faces stored: 812 0: STDOUT: [2014/Jan/10|00:29:24] Max tree depth: 13 0: STDOUT: [2014/Jan/10|00:29:24] Average tree depth: 9.18412 0: STDOUT: [2014/Jan/10|00:29:24] Number of tree nodes: 553 0: STDOUT: [2014/Jan/10|00:29:24] Number of tree faces: 2060 0: STDOUT: [2014/Jan/10|00:29:24] Number of tree leafs: 277 0: STDOUT: [2014/Jan/10|00:29:24] Average faces/leaf: 7.43682 0: STDOUT: [2014/Jan/10|00:29:24] Memory usage: 1.70 MB 0: STDOUT: Rendering image...: 0.00% [ 0h 1m 40.3s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 0.2s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 0.4s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 0.6s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 0.8s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 1.0s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 1.2s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 1.4s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 1.6s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 1.8s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 2.0s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 2.2s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 2.4s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 2.6s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 2.8s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 3.0s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 3.2s] [ 0h 0m 0.0s est] Rendering image...: 0.00% [ 0h 0m 3.4s] [ 0h 0m 0.0s est] [2014/Jan/10|00:29:27] Rendering image...: done [ 0h 0m 3.5s] 0: STDOUT: [2014/Jan/10|00:29:27] Number of raycasts: 421960 0: STDOUT: [2014/Jan/10|00:29:27] Camera rays: 299603 0: STDOUT: [2014/Jan/10|00:29:27] Shadow rays: 122357 0: STDOUT: [2014/Jan/10|00:29:27] GI rays: 0 0: STDOUT: [2014/Jan/10|00:29:27] Reflection rays: 0 0: STDOUT: [2014/Jan/10|00:29:27] Refraction rays: 0 0: STDOUT: [2014/Jan/10|00:29:27] Unshaded rays: 0 0: STDOUT: [2014/Jan/10|00:29:27] Number of intersectable primitives: 812 0: STDOUT: [2014/Jan/10|00:29:27] SD triangles: 812 0: STDOUT: [2014/Jan/10|00:29:27] MB triangles: 0 0: STDOUT: [2014/Jan/10|00:29:27] Static primitives: 0 0: STDOUT: [2014/Jan/10|00:29:27] Moving primitives: 0 0: STDOUT: [2014/Jan/10|00:29:27] Infinite primitives: 0 0: STDOUT: [2014/Jan/10|00:29:27] Closing DR session from 127.0.0.1 ---- 2014/01/10 00:30 ---- Connecting to slave log: Bondes Scheduler Thread - Task "0_0-0" could not be found because task has been modified: current status = Rendering, new status = Completed current slave = Bondes, new slave = Bondes current frames = 0-0, new frames = 0-0 Scheduler Thread - Cancelling task... 0: In the process of canceling current task: ignoring exception thrown by PluginLoader Scheduler Thread - In the process of canceling current tasks: ignoring exception thrown by render thread 0 Update timeout has been set to 300 seconds Stdout Handling Enabled: False Popup Handling Enabled: False Using Process Tree: True Hiding DOS Window: True Creating New Console: False Executable: "/Applications/Thinkbox/Deadline6/Resources/deadlinecommand"

Cheers
Bonsak

Thanks for trying that. Give this plugin code a try with vray.bin as the executable:

from System import *
from System.IO import *

from Deadline.Scripting import *
from Deadline.Plugins import *

def GetDeadlinePlugin():
    return VraySpawnerPlugin()

def CleanupDeadlinePlugin( deadlinePlugin ):
    deadlinePlugin.Cleanup()

class VraySpawnerPlugin(DeadlinePlugin):
    
    def __init__(self):
        self.InitializeProcessCallback += self.InitializeProcess
        self.RenderExecutableCallback += self.RenderExecutable
        self.RenderArgumentCallback += self.RenderArgument
    
    def Cleanup(self):
        for stdoutHandler in self.StdoutHandlers:
            del stdoutHandler.HandleCallback
        
        del self.InitializeProcessCallback
        del self.RenderExecutableCallback
        del self.RenderArgumentCallback
    
    def InitializeProcess(self):
        self.SingleFramesOnly=False
        self.StdoutHandling=False
        
    def RenderExecutable(self):
        version = self.GetPluginInfoEntry( "Version" )
        vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
        vrayExe = FileUtils.SearchFileList( vrayExeList )
        if( vrayExe == "" ):
            self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )
        
        vrayPath = Path.GetDirectoryName( vrayExe )
        pythonHome = Path.Combine( vrayPath, "Python" )
        pythonSitePackages = Path.Combine( pythonHome, "lib/python2.6/site-packages" )
        
        self.SetEnvironmentVariable( "DYLD_LIBRARY_PATH", vrayPath )
        self.SetEnvironmentVariable( "PYTHONHOME", pythonHome )
        
        pythonPath = Environment.GetEnvironmentVariable( "PYTHONPATH" )
        if pythonPath != None and pythonPath != "":
            self.SetEnvironmentVariable( "PYTHONPATH", pythonSitePackages + Path.PathSeparator + pythonPath )
        else:
            self.SetEnvironmentVariable( "PYTHONPATH", pythonSitePackages )

        return vrayExe

    def RenderArgument(self):
        return "-server"

Note that I haven’t tested this, so hopefully there aren’t any syntax errors. :slight_smile:

What we’re doing is setting up the environment in the same way that the “vray” shell script was. So in theory, this should fix those errors about missing libraries that you were getting before.

Cheers,
Ryan

Thanks!
This one errors out right after submission with this message. Vray.bin process starts and then goes down:

[code]<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Scheduler Thread - Synchronizing job auxiliary files from /Volumes/DeadlineRepository6/jobs/52d017afbd6593303dcc2e51
Scheduler Thread - All job files are already synchronized
Constructor: VraySpawner
0: Task timeout is disabled.
0: Loaded job: Untitled (52d017afbd6593303dcc2e51)
0: INFO: Executing plugin script /Users/bonsak/Library/Application Support/Thinkbox/Deadline6/slave/Bonsak-work/plugins/52d017afbd6593303dcc2e51/VraySpawner.py
0: INFO: About: VRay Spawner Plugin for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 0
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: “/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray.bin”
0: INFO: Argument: -server
0: INFO: Startup Directory: “/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2”
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: dyld: Library not loaded: @executable_path/libcgauth.dylib
0: STDOUT: Referenced from: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray.bin
0: STDOUT: Reason: image not found
0: INFO: Process exit code: 133
Scheduler Thread - Render Thread 0 threw a major error:

Exception Details
RenderPluginException – Error in CheckExitCode: Renderer returned non-zero error code, 133. Check the log for more information.
at Deadline.Plugins.ScriptPlugin.RenderTasks (System.String taskId, Int32 startFrame, Int32 endFrame, System.String& outMessage, FranticX.Processes.AbortLevel& abortLevel) [0x00000] in :0
RenderPluginException.Cause: JobError (2)
RenderPluginException.Level: Major (1)
RenderPluginException.HasSlaveLog: True
Exception.Source: deadline
Exception.TargetSite: Void RenderTask(System.String, Int32, Int32)
Exception.Data: ( )
Exception.StackTrace:
at Deadline.Plugins.Plugin.RenderTask (System.String taskId, Int32 startFrame, Int32 endFrame) [0x00000] in :0
at Deadline.Slaves.SlaveRenderThread.RenderCurrentTask (Deadline.IO.TaskLogWriter tlw) [0x00000] in :0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[/code]

Cheers
Bonsak

Here’s another attempt:

from System import *
from System.IO import *

from Deadline.Scripting import *
from Deadline.Plugins import *

def GetDeadlinePlugin():
    return VraySpawnerPlugin()

def CleanupDeadlinePlugin( deadlinePlugin ):
    deadlinePlugin.Cleanup()

class VraySpawnerPlugin(DeadlinePlugin):
    
    def __init__(self):
        self.InitializeProcessCallback += self.InitializeProcess
        self.PreRenderTasksCallback += self.PreRenderTasks
        self.RenderExecutableCallback += self.RenderExecutable
        self.RenderArgumentCallback += self.RenderArgument
    
    def Cleanup(self):
        for stdoutHandler in self.StdoutHandlers:
            del stdoutHandler.HandleCallback
        
        del self.InitializeProcessCallback
        del self.PreRenderTasksCallback
        del self.RenderExecutableCallback
        del self.RenderArgumentCallback
    
    def InitializeProcess(self):
        self.SingleFramesOnly=False
        self.StdoutHandling=False
        
    def PreRenderTasks( self ):
        vrayExe = self.RenderExecutable()
        vrayPath = Path.GetDirectoryName( vrayExe )
        pythonHome = Path.Combine( vrayPath, "Python" )
        pythonSitePackages = Path.Combine( pythonHome, "lib/python2.6/site-packages" )
        
        self.LogInfo( "Setting DYLD_LIBRARY_PATH to: " + vrayPath )
        self.SetEnvironmentVariable( "DYLD_LIBRARY_PATH", vrayPath )
        
        self.LogInfo( "Setting PYTHONHOME to: " + pythonHome )
        self.SetEnvironmentVariable( "PYTHONHOME", pythonHome )
        
        pythonPath = Environment.GetEnvironmentVariable( "PYTHONPATH" )
        if pythonPath != None and pythonPath != "":
            newPythonPath = pythonSitePackages + Path.PathSeparator + pythonPath
            self.LogInfo( "Setting PYTHONPATH to: " + newPythonPath )
            self.SetEnvironmentVariable( "PYTHONPATH", newPythonPath )
        else:
            self.LogInfo( "Setting PYTHONPATH to: " + pythonSitePackages )
            self.SetEnvironmentVariable( "PYTHONPATH", pythonSitePackages )
        
    def RenderExecutable(self):
        version = self.GetPluginInfoEntry( "Version" )
        vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
        vrayExe = FileUtils.SearchFileList( vrayExeList )
        if( vrayExe == "" ):
            self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )

        return vrayExe

    def RenderArgument(self):
        return "-server"

I moved the environment setting into the PreRenderTasks callback, because it looks like it wasn’t getting applied from the RenderExecutable callback. I also added some debug logging so we can see what’s happening.

Give it a try and send us the new log if it fails again.

Thanks!
Ryan

Hi
Using the last one with “vray.bin” as exec, it doesn’t start the vray standalone process on the slave. I get this error:

[code]Constructor: VraySpawner
0: Task timeout is disabled.
0: Loaded job: Untitled (52d424e18147e152c30cbead)
0: INFO: Executing plugin script /Users/bonsak/Library/Application Support/Thinkbox/Deadline6/slave/Bondes/plugins/52d424e18147e152c30cbead/VraySpawner.py
0: INFO: About: VRay Spawner Plugin for Deadline
0: INFO: The current environment will be used for rendering
0: Plugin rendering frame(s): 0
0: INFO: Setting DYLD_LIBRARY_PATH to: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2
0: INFO: Setting PYTHONHOME to: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/Python
0: INFO: Setting PYTHONPATH to: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/Python/lib/python2.6/site-packages:/Applications/Thinkbox/Deadline6/Resources/Frameworks/Python.framework/Versions/2.6/lib/python2.6:/Applications/Thinkbox/Deadline6/Resources/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload:/Applications/Thinkbox/Deadline6/Resources/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
0: INFO: Stdout Handling Enabled: False
0: INFO: Popup Handling Enabled: False
0: INFO: Using Process Tree: True
0: INFO: Hiding DOS Window: True
0: INFO: Creating New Console: False
0: INFO: Executable: “/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray.bin”
0: INFO: Argument: -server
0: INFO: Startup Directory: “/Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2”
0: INFO: Process Priority: BelowNormal
0: INFO: Process Affinity: default
0: INFO: Process is now running
0: STDOUT: dyld: Library not loaded: @executable_path/libcgauth.dylib
0: STDOUT: Referenced from: /Applications/ChaosGroup/V-Ray/Standalone_for_snow_leopard_x64/bin/snow_leopard_x64/gcc-4.2/vray.bin
0: STDOUT: Reason: image not found
0: INFO: Process exit code: 133
Scheduler Thread - Render Thread 0 threw a major error:

Exception Details
RenderPluginException – Error in CheckExitCode: Renderer returned non-zero error code, 133. Check the log for more information.
at Deadline.Plugins.ScriptPlugin.RenderTasks (System.String taskId, Int32 startFrame, Int32 endFrame, System.String& outMessage, FranticX.Processes.AbortLevel& abortLevel) [0x00000] in :0
RenderPluginException.Cause: JobError (2)
RenderPluginException.Level: Major (1)
RenderPluginException.HasSlaveLog: True
Exception.Source: deadline
Exception.TargetSite: Void RenderTask(System.String, Int32, Int32)
Exception.Data: ( )
Exception.StackTrace:
at Deadline.Plugins.Plugin.RenderTask (System.String taskId, Int32 startFrame, Int32 endFrame) [0x00000] in :0
at Deadline.Slaves.SlaveRenderThread.RenderCurrentTask (Deadline.IO.TaskLogWriter tlw) [0x00000] in :0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[/code]

Cheers
Bonsak

One more test. This time, it only uses the vray python path for PYTHONPATH, instead of prefixing it to the existing PYTHONPATH variable. If this doesn’t work, I’m stumped…

from System import *
from System.IO import *

from Deadline.Scripting import *
from Deadline.Plugins import *

def GetDeadlinePlugin():
    return VraySpawnerPlugin()

def CleanupDeadlinePlugin( deadlinePlugin ):
    deadlinePlugin.Cleanup()

class VraySpawnerPlugin(DeadlinePlugin):
    
    def __init__(self):
        self.InitializeProcessCallback += self.InitializeProcess
        self.PreRenderTasksCallback += self.PreRenderTasks
        self.RenderExecutableCallback += self.RenderExecutable
        self.RenderArgumentCallback += self.RenderArgument
    
    def Cleanup(self):
        for stdoutHandler in self.StdoutHandlers:
            del stdoutHandler.HandleCallback
        
        del self.InitializeProcessCallback
        del self.PreRenderTasksCallback
        del self.RenderExecutableCallback
        del self.RenderArgumentCallback
    
    def InitializeProcess(self):
        self.SingleFramesOnly=False
        self.StdoutHandling=False
        
    def PreRenderTasks( self ):
        vrayExe = self.RenderExecutable()
        vrayPath = Path.GetDirectoryName( vrayExe )
        pythonHome = Path.Combine( vrayPath, "Python" )
        pythonSitePackages = Path.Combine( pythonHome, "lib/python2.6/site-packages" )
        
        self.LogInfo( "Setting DYLD_LIBRARY_PATH to: " + vrayPath )
        self.SetEnvironmentVariable( "DYLD_LIBRARY_PATH", vrayPath )
        
        self.LogInfo( "Setting PYTHONHOME to: " + pythonHome )
        self.SetEnvironmentVariable( "PYTHONHOME", pythonHome )
        
        self.LogInfo( "Setting PYTHONPATH to: " + pythonSitePackages )
        self.SetEnvironmentVariable( "PYTHONPATH", pythonSitePackages )
        
    def RenderExecutable(self):
        version = self.GetPluginInfoEntry( "Version" )
        vrayExeList = self.GetConfigEntry("VRaySpawnerExecutable_" + version)
        vrayExe = FileUtils.SearchFileList( vrayExeList )
        if( vrayExe == "" ):
            self.FailRender( version + " VRay Spawner executable was not found in the semicolon separated list \"" + vrayExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )

        return vrayExe

    def RenderArgument(self):
        return "-server"

Hi
I think using “vray.bin” is a dead end, as the last one also errors out. But thank you very much for all the great suggestions!

I went back to the second version (with vray only and correct render arguments) and modified the Quicktime Event Plugin (KillVraySpawner) to launch after any VraySpawner job is completed and kill the hanging vray.bin process. This is rather brute force but it works :wink:
How can get the slave names that was used in the job that triggers the event plugin? Can i get them from the job object that is passed in to the event plugin? That way i could write a whitelist into the Job Info File and only run the “KillVraySpawner” event plugin on the slaves that needs it?

Cheers
Bonsak

[code]import re

from System.IO import *
from System.Text import *

from Deadline.Events import *
from Deadline.Scripting import *

def GetDeadlineEventListener():
return KillVraySpawner()

class KillVraySpawner ( DeadlineEventListener ):

def __init__( self ):
	self.OnJobFinishedCallback += self.OnJobFinished

def OnJobFinished( self, job ):
	
	if job.JobPlugin != "VraySpawner":
		return
				
	# Write Job info file.
	jobInfoFilename = Path.Combine( ClientUtils.GetDeadlineTempPath(), "python_job_info.job" )
	writer = StreamWriter( jobInfoFilename, False, Encoding.Unicode )
	writer.WriteLine( "Plugin=Python" )
	writer.WriteLine( "Name=Clean-up after %s" % job.Name )
	# writer.WriteLine( "Name=%s" % movieName )
	writer.WriteLine( "Comment=" )
	writer.WriteLine( "Department=%s" % job.JobDepartment )
	writer.WriteLine( "Pool=%s" % job.JobPool )
	writer.WriteLine( "Group=%s" % job.JobGroup )
	writer.WriteLine( "Priority=%s" % job.JobPriority )
	writer.WriteLine( "Whitelist=bonsak-work" )
	writer.WriteLine( "TaskTimeoutMinutes=0" )
	writer.WriteLine( "LimitGroups=" )
	writer.WriteLine( "JobDependencies=" )
	writer.WriteLine( "OnJobComplete=Nothing" )
	writer.WriteLine( "MachineLimit=1" )
	writer.WriteLine( "Frames=1" )

	# Make this a maintenance job
	# MaintenanceJob=True
	# MaintenanceJobStartFrame=0
	# MaintenanceJobEndFrame=40
	
	writer.WriteLine( "ChunkSize=1" )
	
	writer.Close()
		
	# Write plugin info file.
	pluginInfoFilename = Path.Combine( ClientUtils.GetDeadlineTempPath(), "python_plugin_info.job" )
	writer = StreamWriter( pluginInfoFilename, False, Encoding.Unicode )
	writer.WriteLine( "ScriptFile=/Volumes/DeadlineRepository6/custom/scripts/Submission/kill-vray.py" )
	writer.WriteLine( "Arguments=" )
	writer.WriteLine( "Version=2.7" )

	writer.Close()
		
	# Submit
	ClientUtils.ExecuteCommand( ( jobInfoFilename,pluginInfoFilename ) )

[/code]

I don’t think you can. Since (I’m assuming) the job is manually marked as complete when the render is done, the information about the slaves that were rendering the tasks for the job will be lost.

An alternative could be to convert your plugin into an advanced plugin, wrap the vray spawner in a ManagedProcess class, and then start the process in the RenderTasks() callback. Then in the EndJob() callback, you can kill vray.bin because EndJob will always be called.

You can take a look at the Nuke plugin for an example of this. When BatchMode is disabled, all we’re doing in RenderTasks() is starting the Nuke ManagedProcess and waiting for it to complete using RunManagedProcess(). You shouldn’t need to do anything in StartJob(), and in EndJob(), you would simply kill any vray.bin processes kicking around.

It’s still a bit of brute force, but at least it’s all self-contained in the plugin. Less moving parts is always good. :slight_smile:

Cheers,
Ryan

Sweet! I’ll give it a go.

Cheers
BOnsak

That works perfect! Thank you.

-b

Privacy | Site terms | Cookie preferences