Feature suggestion :Getting more out of gpu+cpu rendering
Hi folks,
Background
I'm sure most of you have tried to make your renders faster. In theory, the more computing power you can throw at a render, the quicker it will finish yep? Not necessarily. Let me give you an example. I have a 1060 and a 1660 GPU and a Ryzen 3700x. Reasonably sweet.
Choosing all three to output the render should be quicker than "only" using the GPUs.
However, If the CPU threads get caught rendering a more complex part of a scene - lets say the tile being rendered is showing reflection,refraction and a colour dispersion node group, it's going to take longer than a tile with just a bit of HDRI background and the CPU likely gets caught up with rendering complex parts of the scene and the GPU flies through rendering simple parts.
So the render is down to the last several tiles and the GPUs have finished doing their thing and are sat there at the finish line looking at the CPU threads saying "Hey folks! Hurry the hell up! I wanna get on with the next frame!"
I have several blend files where this happens and yes I could mess around with tile sizes and choosing left to right or top to bottom or Hilbert etc, but that all takes time. And if you're rendering an animation, this might not be effective for a changing view.
I have a donut tutorial animation and this is a frame from that sequence.
GPUs only with 256px tiles - 1m18s GPUs and CPU with 128px tiles 1m16s GPUs and CPU with 64px tiles 1m07 GPUs and CPU with 32px tiles 1m32s.
The 128px and 64px with all compute power is a little quicker, but CPU threads are much much slower when computing the more complex tiles and the render is delayed at the end by CPU threads completing complex tiles.
The 32px is only really included to show that the GPUs are pretty much neutralised by the small tile size and the overheads involved in transferring small tiles.
Finally the suggestion!
Is there an efficient way examining each tile to make a best guess on the rendering time and allocating GPUs to the more complex tiles and have the CPU threads take the easier stuff?
I realise that this would mean the render appearing in a patchy fashion, and it will cause delays with some denoising, but there would be less delay at the end of a render while the CPUs are still jogging to the finish line. Once you're creating a final render, you don't normally care how the tiles appear you just want it done ASAP
Any thoughts anyone?
{media z7WY}
1 Comment
I dont think that the current implementation of CPU + GPU rendering is the best thing to do. As far as I understand it, both, CPU and GPU are calculating the exact same things. So right now, they can only do buckets repartition which is clearly not ideal.. They should only calculate data that they are good at!
I really hope that Cycles devs will look into XPU tech form RenderMan at some point! renderman.pixar.com/news/renderman-xpu-development-update