Page MenuHome

Cycles X: Initial support of multi-GPU and GPU+CPU rendering
ClosedPublic

Authored by Sergey Sharybin (sergey) on Jun 28 2021, 4:25 PM.
Tags
None
Subscribers
None
Tokens
"Like" token, awarded by YAFU."Love" token, awarded by Alaska."Like" token, awarded by xxtioo.

Details

Summary

This change makes it possible to render single frame on multiple GPUs
and/or GPU(s)+CPU. (as configured in the User Preferences).

Work is split equally along the height of the big tile.
In the future this will be looked into to perform better initial guess
based on devices performance, dynamic re-scheduling, and interleaving
scanlines across devices.

The main idea is to move render buffers to per-work basis, so that the
ender buffers are always associated with the device work is being done
by. And then upon access delegate the read/write to the work, so that
it operates with a specific slice in the source/destination,

There are some multiple memory and performance improvements possible,
like:

  • Copy render result to GPUDisplay from multiple threads (now when it is clear graphics inetrop can not be mixed in with naive update).
  • Avoid denoiser buffer re-allocation.
  • Avoid creation of temporary buffers in the denoisers when we know that we have a copy of real buffers.
  • Only copy passes needed for denoiser, and results of denoiser.

The current state of the PathTrace::denoise() is not entirely ideal:
it could be split up, and memory usage could be improved. But think it
is good enough for the initial implementation. The further improvements
would require changes in the Denoiser API.

Diff Detail

Repository
rB Blender
Branch
cycles-x_multi (branched from master)
Build Status
Buildable 15463
Build 15463: arc lint + arc unit

Event Timeline

Sergey Sharybin (sergey) requested review of this revision.Jun 28 2021, 4:25 PM
Sergey Sharybin (sergey) created this revision.
Sergey Sharybin (sergey) retitled this revision from Cycles X: Initial support of multi-GPU and GPU=CPU rendering to Cycles X: Initial support of multi-GPU and GPU+CPU rendering.Jun 28 2021, 5:06 PM

Looks fine overall, I couldn't spot issues from reading the code.

intern/cycles/integrator/path_trace.cpp
403

bu -> by

intern/cycles/integrator/path_trace_work.cpp
118

Already an issue in the existing code, but are we copying the full buffer with all passes, for every individual pass we read?

This revision is now accepted and ready to land.Jun 28 2021, 5:28 PM

Update with typo fix.

intern/cycles/integrator/path_trace_work.cpp
118

Good point! Lets fix it in a separate patch!