stop out of core bottleneck by specifiying thread limit for cpu rendering
Ok , so I've tested on a scene that needs out of core rendering, and a scene that doesnt. The one that needs to go out of core is much slower with both cpu and gpu rendering compared to just GPU.
A scene that doesnt need to go out of core is actually faster when using both cpu and gpu.
I guess this is because when it needs to go out of core, the cpu needs to be available to send data to the GPU during rendering, but if the cpu is tied up rendering, then it cant send data to the gpu.....leaving the gpu doing much less than it could be doing.
I though perhaps if I limited the number of threads to 4 rather than 8, then the cpu might have sufficient capacity to keep the gpu rendering at full speed. It seems if you lower the thread count though, the GPU doesnt get used at all, and all threads are cpu only ( I guess the thread limits are counting towards gpu's too...and that the cpu is getting first dibs. So if you have an 8 thread machine, and choose 4 thread limit, the cpu gets all 4 for rendering and the gpu gets none. Also the 4 threads are being assigned to both rendering and communication with the gpu)
If this is the case, then I guess a resolution would be to exclude gpu's from the thread limit, and make the thread limit only applicable to cpu rendering rather than cpu communication with GPU. ie setting the thread limit to 4 on an 8 thread machine with one gpu, should use 4 threads for rendering, 4 threads for gpu communication, and still allow the gpu to render.
3 Comments
I'm not sure I understand. We can already specify the number of threads to use for CPU rendering from the Performance panel in Render Properties. Is this different than that?
* @Jason van Gumster * it's not different, but that's the problem. For example, if you're rendering in cpu + gpu mode, and your machine has a 4 core 8 thread processor and one gpu, then setting the thread count to 4 gives all 4 threads to the cpu, and the GPU doesnt get involved at all...at least that was the behaviour when I tried earlier (only 4 tiles appeared in the render view). Also, the issue with cpu + gpu mode (when out of core), is that the cpu is so busy rendering that it has insufficient resources to feed data to the GPU (which it needs to do continuously when out of core). The resolution is the ability to specify number of cpu threads for rendering, and seperately specify number of threads for data transfer to the GPU. Additionally the GPU should always be used regardless of the number of CPU threads specified.
Ideally you should just be able to specify the number of threads, and based on the amount of data kept out of core, cycles would work out how many of the specified threads to leave free for data transfer. So for example less cores/threads would be set aside for data transfer if only 50mb of data couldnt fit into VRAM, compared to more cores being left available for data transfer (excluded from cpu rendering) if there was say 10GB of data that couldn't fit into VRAM (because the data would need to be sent more frequently).
* @tibbyninja * as i found, if i have 4 threads for CPU+GPU, Cucles use 3CPU + 1 GPU. It is obvious by speed of buckets.