AWS Thinkbox Discussion Forums

VrayBenchmark 5 Plugin Issues

Trying to modify the current VrayBenchmark plugin to work with Vray5 version.
Unfortunately chaos group has modified the cli executable to ask for a EULA with a requisite user input. The workaround from them was to run the executable with an echo y | in front so the command line would look something like this:
echo y | \path\to\vraybenchmark.exe --args --args

trying to use the ModifyCommandLineCallback doesn’t seem to achieve the desired results:

	#!/usr/bin/env python3
from __future__ import absolute_import
from Deadline.Plugins import DeadlinePlugin, PluginType
from Deadline.Scripting import SystemUtils
import os

def GetDeadlinePlugin():
	return VrayBenchmarkPlugin()

def CleanupDeadlinePlugin(deadline_plugin):

class VrayBenchmarkPlugin(DeadlinePlugin):
	def __init__(self):
		self.SingleFramesOnly = None
		self.StdoutHandling = None
		self.PopupHandling = None
		self.InitializeProcessCallback += self.InitializeProcess
		self.RenderExecutableCallback += self.RenderExecutable
		self.RenderArgumentCallback += self.RenderArgument
		self.ModifyCommandLineCallback += self.ModifyCommand
	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 = True
		self.StdoutHandling = False
		self.PopupHandling = False
	def RenderExecutable(self):
		version = self.GetPluginInfoEntryWithDefault('Version', '4')
		vray_benchmark_exe_param = 'VRayBenchmark_RenderExecutable_{0}'.format(version)
		vray_benchmark_exe = self.GetRenderExecutable(vray_benchmark_exe_param, 'V-Ray Benchmark')

		if SystemUtils.IsRunningOnWindows():
			# This is required otherwise The V-Ray Benchmark will be unable to locate it's resources folder.
			vray_benchmark_exe = vray_benchmark_exe.replace('/', '\\')
			vray_benchmark_exe = vray_benchmark_exe.replace('\\', '/')

		return vray_benchmark_exe

	def RenderArgument(self):
		filePath, fileNameExt = os.path.split(str(self.RenderExecutable()))
		args = '--dump --output ' + os.path.join(filePath, '%COMPUTERNAME%.json')
		arguments = [args]
		return ' '.join(arguments)

	def get_mode_arguments(self):
		"""returns the V-Ray render mode to use for the benchmark as a list of command-line args"""
		do_cpu = self.GetBooleanPluginInfoEntryWithDefault('CPUTest', False)
		do_gpu = self.GetBooleanPluginInfoEntryWithDefault('GPUTest', False)

		mode = 'both'
		if do_cpu and not do_gpu:
			mode = 'vray'
		elif not do_cpu and do_gpu:
			mode = 'vray-gpu'

		return ['--mode', mode]

	def ModifyCommand(self, exe_path, args, startUpDir):
		_dir, _exec = os.path.split(exe_path)
		if SystemUtils.IsRunningOnWindows():
			exe_path = 'echo y | ' + _exec

		result = (exe_path, args, startUpDir)
		return result

Any help would be appreciated.

Did you put a ticket in with Chaos to request a --accept-eula or similar switch?

I guess the way the script is written is loses the echo y part, I’m not sure of the way to get around that.

other option would be to use an older version of the benchmark?

when i contacted them they said to use the echo y | option and it seems like they dropped the --quiet switch from their previous version. I doubt they will fix it anytime soon. The workaround is to run this is as a Command Script job instead, but would’ve been nice to have it work as the VrayBenchmark job. I used this command and since we are windows only shop anyway and I didn’t need os checking logic, but the job script for VrayBenchmark 5 needs to be rewritten to accommodate the new version.

echo y | "\\path\to\vray-benchmark-5.02.00-cli.exe" --output \\path\to\outut\%COMPUTERNAME%.json --mode vray
Privacy | Site terms | Cookie preferences