Hi Marcus,
I am doing something similar to you, with loading starting a script, I am submitting the job straight from python, and it looks like this:
Hi Marcus,
I am doing something similar to you, with loading starting a script, I am submitting the job straight from python, and it looks like this:
added a comment below, not sure if you will get notified without me replying
for some reason GPU rendering worked for me Out of the box on 2 windows machines running 3.1 with optix, just macOS not doing what I want, they just started supporting METAL anyone got this running? got some dual vega cards doing nothing.
I’ve been searching whether it’s possible to submit Blender GPU Cycles, there are plenty of old threads then I finally found this one! Thanks for sorting this
Can confirm this works on multi-gpu boxes and without it the jobs revert to CPU, will this be rolled out as a standard?
Thanks
Ant
I can confirm that it works! the only option is to make 2 files to switch between CUDA and OPTIX ?
Also it works with multigraphics!!
Hello again, I have edited the script to automatically fill in the path \ for the user, but when I call it I get one and I don’t know how to solve it.
Hello @Sergic
Apologies for late reply here.
It’s Python escaping slashes. Try to use it like this \\192.168… and then two slashes instead of one in the whole path.
He Ant
I know this reply is super late sorry about that. I do not think this can be added to standard submission scripts because these arguments are optional. Any command line argument can be passed here.
The actually functionality should be built to add support for GPU natively in the submission script. We already have a feature request for that.
If just that, I have it on the left side I call that line of code but it comes back with a / when I run the blender submit, I would like it to appear directly with //
Hello!
I have cleaned up the patch we had posted above, it was not working for me as well. The patch still has the same BlenderForceGPUScript.py file, but not is hardcoded to add the “-P” while rendering.
Attaching the zip file here, and the steps used to force GPU rendering with Blender:
Replace your Blender application plugin files.
Copy the Blender folder from the Step 1 folder into DeadlineRepository10\custom\plugins
Replace the Blender submitter in the Monitor
Copy the BlenderSubmission.py file from the Step 2 folder into DeadlineRepository10\custom\scripts\Submission
When you’re submitting your job that needs to have GPU rendering enforced, add path to the “BlenderForceGPUScript.py” at the bottom of the submitter “Path to BlenderForceGPU Script” option.
Just make sure the Worker will be able to run BlenderForceGPUScript.py (included in the Step 3 folder) from wherever you’ve chosen to store it.
Updated Blender plugin files and it works fine with Deadline 10.3.0.x.
BlenderGPU Steps.zip (9.9 KB)
Hello, I had some questions about the installation of the scripts
When we move the step 1 and step 2 files, how does deadline know that it will look for the blender custom plug-in ? I had a last question to automate the addition of the force script BlenderForceGPUScript.py
thank you in advance for your answer
thank you very much for sharing the resources
For me it seems to work straight away, or am I missing anything?
Setup: Sending from Mac (Metal) to a PC with dual 3090 Tis using OptiX, both using Blender 3.4.
Does your code make it so we can’t add any other additional arguments anymore?
@Orage_studio, the custom folder gets the priority over the actual plugin/scripts folder in the Repository. So any customization stored under the custom folder would be pulled first and also survive the upgrade.
@sirhaffy, did you spend sometime on setting up the Blender as explained in the above threads? Share the logs or the error you ran into while setting up Blender GPU rendering.
@erlan_nephilim, you can add more arguments to Blender command-line using the submitter Additional Arguments. It will append those arguments to the Blender.
Hi,
I’ve followed the steps here but I’m getting the following error. I believe it’s something to do with the python version but I’m not a programmer. Does anyone know now to resolve this?
(for context, I’m trying to render with Blender 3.6 using GPU on Deadline)
Here’s the error:
2023-10-09 21:36:06: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023-10-09 21:36:06: Exception Details
2023-10-09 21:36:06: RenderPluginException – The Deadline Plugin was not properly initialized. Application plugins must explicitly call super().__init__()
in the Python constructor: def __init__()
.
2023-10-09 21:36:06: RenderPluginException.Cause: JobError (2)
2023-10-09 21:36:06: RenderPluginException.Level: Major (1)
2023-10-09 21:36:06: RenderPluginException.HasSlaveLog: True
2023-10-09 21:36:06: RenderPluginException.SlaveLogFileName: C:\ProgramData\Thinkbox\Deadline10\logs\deadlineslave_renderthread_0-DA-0000.log
2023-10-09 21:36:06: Exception.TargetSite: Deadline.Slaves.Messaging.PluginResponseMemento d(Deadline.Net.DeadlineMessage, System.Threading.CancellationToken)
2023-10-09 21:36:06: Exception.Data: ( )
2023-10-09 21:36:06: Exception.Source: deadline
2023-10-09 21:36:06: Exception.HResult: -2146233088
2023-10-09 21:36:06: Exception.StackTrace:
2023-10-09 21:36:06: at Deadline.Plugins.SandboxedPlugin.d(DeadlineMessage bgq, CancellationToken bgr)
2023-10-09 21:36:06: at Deadline.Plugins.SandboxedPlugin.Initialize(Job job, CancellationToken cancellationToken)
2023-10-09 21:36:06: at Deadline.Slaves.SlaveRenderThread.e(String ajx, Job ajy, CancellationToken ajz)
2023-10-09 21:36:06: at Deadline.Slaves.SlaveRenderThread.b(TaskLogWriter ajt, CancellationToken aju)
2023-10-09 21:36:06: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
By the look of it you’ve got a 10.2 Blender.py running on a 10.3 Worker. If you’re running the steps and files you downloaded from Karpreet’s post here, grab it again. 3 days ago he fixed it up to be 10.3 compatible, so you may just have an out of date file.
And be sure to either restart the Worker or submit a new job after getting the files in place, or else the old application plugin files will get used, and you’ll get the same error.
To be sure you’ve got files in the right spot, once you’re done there should be a DeadlineRepository10\custom\plugins\Blender\Blender.py that looks like this:
Did you have any joy with Mac OS / GPU on Deadline?
is there a way to hard code this path so we don’t have to fill it in every time? Can’t seem to find the line to add it in the script.
You can add it into the line like below, this way it’ll auto fill
scriptDialog.AddControlToGrid( "AdditionalArgumentsBox", "TextControl", "-P Z:\BlenderForceGPUScript.py", 7, 1, colSpan=2 )
I’m just revisiting this as I’m looking into it for a client. Seems to throw errors and fail this way
"C:\Program Files\Blender Foundation\Blender 4.2\blender.exe" -b "Z:\tests\blender\simple_3.blend" -t 0 -x 1 -o "Z:\tests\blender\####.png" -s 14 -e 14 -a -P Z:\BlenderForceGPUScript.py
If I move the additional args I still get the errors but the render goes through
"C:\Program Files\Blender Foundation\Blender 4.2\blender.exe" -P Z:\BlenderForceGPUScript.py -b "Z:\tests\blender\simple_3.blend" -t 0 -x 1 -o "Z:\tests\blender\####.png" -s 14 -e 14 -a
not sure if this is a 4.2 thing, I find I’m having to manually install the submitter now too
so adding the line before the others in Blender.py (Around line 80) throws an error but forces renders on the GPU
renderArgument += StringUtils.BlankIfEitherIsBlank( " -x 1 -o \"", StringUtils.BlankIfEitherIsBlank( outputFile, "\"" ) )
renderArgument += self.GetPluginInfoEntryWithDefault("AdditionalArguments", " -P Z:\BlenderForceGPUScript.py")
renderArgument += " -s " + str(self.GetStartFrame()) + " -e " + str(self.GetEndFrame()) + " -a "