Deadline does not support GPU rendering for Blender as of today. There’s a hack that has been reported to work, I think it’s worth sharing here.
Add a place in the submission script to inject command line arguments to the job. Then those arguments are passed to Blender’s executable/binary during the render.
To do that you’ll need to backup the existing and replace files from the attached archiveBlenderAdditionalArgs.zip (6.6 KB)
to:
After you’ve added the place to to add additional arguments to the submission script you’ll pass -P flag and provide the location of the script "/path/to/BlenderForceGPUScript.py"BlenderForceGPUScript.py (686 Bytes) and submit the job.
It should just work fine but if it does not repeat the same process and along with above step pass and extra argument after the script with a space in between them –debug-gpu
By the way, I was testing this, as I am searching for a way to pass my own .py script as an argument.
I have found that the attached submission scripts do not work. With or without filling in additional arguments, the error is the same.
=======================================================
Error
=======================================================
Failed after four attempts to copy "Blender.param". Please make sure that the file exists in the plugin directory.
=======================================================
Type
=======================================================
Exception
=======================================================
Stack Trace
=======================================================
at Deadline.Plugins.PluginUtils.a(Job bfr, UserInfo bfs, SlaveSettings bft, DataController bfu)
at Deadline.Plugins.PluginUtils.SyncFilesForJob(Job job, UserInfo jobUser, Boolean cleanup, String& message, SlaveSettings workerSettings, DataController dataController)
at Deadline.Plugins.SandboxedPlugin.SyncFilesForJob(Job job, Boolean cleanup, String& message, CancellationToken cancellationToken)
at Deadline.Slaves.SlaveRenderThread.e(String ajs, Job ajt, CancellationToken aju)
at Deadline.Slaves.SlaveRenderThread.b(TaskLogWriter ajo, CancellationToken ajp)
at Deadline.Slaves.SlaveRenderThread.a()
I tried looking into it myself, but my development knowledge is very limited, I couldn’t find anything.
Ok, after some snooping around, I found that there are 2 files in the standard plugins/Blender folder, called Blender.options and Blender.param, that also need to be copied to the custom/plugins/Blender folder in order for this to work.
Additionally, I have found that blender will only run the python script after rendering the file, because the -P argument is at the end of the command.
It should be placed instead after the .blend path argument.
If anyone else needs this, I have attached the modifier Blender.py script.
Thanks for sharing - I was able to get Deadline to render on GPU with Blender.
But now i want to force deadline to use the OPTIX instead of CUDA.
The Problem is - I don’t know where to put in the -P Flag.
I put it in the additional arguments box but i think it didn’t work.
(also put in the BlenderForceGPUScript.py OPTIX instead of CUDA)
bpy.context.preferences.addons[‘cycles’].preferences.compute_device_type = ‘OPTIX’
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?
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 //
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
@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.