Is there a way for me to force Blender to render a .blend file with the CPU? or Force it to render with the GPU? Either a command line switch or some sort of python script (even though I am not super familiar with python).
We have a renderfarm with 9 machines. Three of them have high end GPUs for rendering. The problem I have, is that with our renderfarm management software (or any software). is that when sending a job to the farm, it will choose CPU or GPU, whichever is selected in the .blend file. That is great for the 3 machines that have good GPUs, but it renders 10x slower on the other machines with fast CPUs but slow GPUs. So I need a way to force blender to render on the CPU or GPU via a command line switch that can be integrated into the renderfarm management software, or possibly a python script. or maybe there is another way?
Any help would be much appreciated!
We’re running OSX on all machines.
UPDATE:
I was able to force GPU or CPU rendering via this script in a gpurender.py file:
import bpy
bpy.context.scene.cycles.device = ‘GPU’
bpy.ops.render.render(True)
But now the issue is the tile sizes. I need to be able to specify my tile sizes for CPU rendering to 64x64 and GPU renders need to be 512 by 512, otherwise render times are still very inefficient.
I attempted to implement tile sizes into my gpurender.py script by adding the following, but it didnt work. Render times were unchanged:
import bpy
bpy.context.scene.cycles.device = ‘CPU’
bpy.ops.render.render(True)
for scene in bpy.data.scenes:
scene.render.tile_x = 64
scene.render.tile_y = 64