GPU "Takes Over," CPU tiles during rendering
Even after all of the progress of using both the GPU and CPU in cycles, no matter what CPU / GPU combo I test, it always seems like the GPU finishes all of it's work, and there are still 6-8 CPU tiles rendering, slowing it down.
The worst part is, if I just did GPU render, the single GPU tile could do the remaining 8 in the time it took for the CPU to finish.
I propose that if the GPU is out of tiles to render, that the GPU can "Take Over," CPU tiles, either continuing the work of an in progress CPU tile (don't know how hard this would be to implement), or re-rendering the tile from scratch which still might be faster in a lot of cases.
12 Comments
Great idea. I thought about it the first time CPU+GPU rendering was implemented but I have forgotten about it. It would be a great time saver
+++
Nice one. That is exactly why I do not use my CPU when rendering right now and I'm glad I'm not the only one who would like to prioritize GPU over CPU when all remaining tiles occupied by CPU.
Using CPU really helpfull when half of your render is quickly processed because of it's just sky or simple background and CPU might render it a lot faster together with GPU, but might actually tightly stick to some very last tile which have more complex content.
This has been implemented now: developer.blender.org/D9324
* @wouterstomp * youtu.be/JslAkritYPQ
I have older hardware, so rendering with both definitely makes a difference. Sometimes just rendering with CPU is faster.
I think, at least for me, the bottleneck is that the tile size is not dynamic. CPU renders faster with small tiles and GPU with bigger tiles. So, I have to find a middle ground for both CPU and GPU. If there were some way to have a dynamic bucket size, that would be great as well.
I wonder: if (say) 64 tiles are to be rendered and the CPU has 8 cores for 8 simultaneous tiles and the GPU runs 1 tile at a time... then after (say) 32 tiles the scheduler that assigns tiles to CPU and/or GPU should have gathered enough information to estimate the time that each device would take to finish the remaining tiles - and choose the fastest one for the remaining tile(s).
Or just render GPU only because you're not getting any performance gain from using both.
* @Jason van Gumster * if it worked correctly the gain would be there, especially if you have strong CPUs
* @Jason van Gumster * The gain should still be there. You are right, in that the worst case scenario is the CPU literally doesn't finish a single tile before the GPU takes over and finishes them all, there would be no gain.
However, even in close to worst case, were the CPU only finished 1 tile, it still saved the GPU 5 seconds or whatever. It really would be the best of both worlds. In my test cases I found that's far from the case, and the CPU actually does a fair bit of it's own lifting.
Doing a few tests and estimating a bit, I found that my CPU actually helps a lot, and would finish about 10 seconds faster than GPU only (on a 30 second render), it just get's stuck on the last 8 tiles.
* @Jason van Gumster * I have 16 core 32 threads CPU and using both my cpu and my gpu to render makes it about 1.7x faster so the speedup is there but with this option it would be even faster sometimes
* @Michal Wieczorek * I've been running Blender on some beastly machines with dual 14-core machines and using GPU+CPU hasn't provided a really significant performance gain. Granted, these machines also have 4 GPUs, so perhaps that's the differentiating factor.
* @Jason van Gumster * My machine have just one RTX 2080 but the processor has 3.8Ghz on every thread so that 2 factors makes a difference. On some Xeon CPU's even with high core counts rendering is much slower as I tested. And of course the difference with 4 GPU's and a CPU will be insignificant as you experienced.
But for many people this function will be helpful