diff options
author | Patrick Mours <pmours@nvidia.com> | 2022-08-12 16:49:30 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2022-08-12 17:00:54 +0300 |
commit | 79787bf8e1e1d766e34dc6f8c5eda2efcceaa6cc (patch) | |
tree | 95255c7ae7c5075abc07995126efc76701882050 /intern/cycles/device | |
parent | 27105af938b14c48fb498a292e2b371cbd8faf31 (diff) |
Cycles: Improve denoiser update performance when rendering with multiple GPUs
This patch causes the render buffers to be copied to the denoiser
device only once before denoising and output/display is then fed
from that single buffer on the denoiser device. That way usually all
but one copy (from all the render devices to the denoiser device)
can be eliminated, provided that the denoiser device is also the
display device (in which case interop is used to update the display).
As such this patch also adds some logic that tries to ensure the
chosen denoiser device is the same as the display device.
Differential Revision: https://developer.blender.org/D15657
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/cuda/device_impl.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/device/optix/device_impl.cpp | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/intern/cycles/device/cuda/device_impl.cpp b/intern/cycles/device/cuda/device_impl.cpp index 00851a8e91c..01c021551f3 100644 --- a/intern/cycles/device/cuda/device_impl.cpp +++ b/intern/cycles/device/cuda/device_impl.cpp @@ -1202,11 +1202,11 @@ bool CUDADevice::should_use_graphics_interop() } vector<CUdevice> gl_devices(num_all_devices); - uint num_gl_devices; + uint num_gl_devices = 0; cuGLGetDevices(&num_gl_devices, gl_devices.data(), num_all_devices, CU_GL_DEVICE_LIST_ALL); - for (CUdevice gl_device : gl_devices) { - if (gl_device == cuDevice) { + for (uint i = 0; i < num_gl_devices; ++i) { + if (gl_devices[i] == cuDevice) { return true; } } diff --git a/intern/cycles/device/optix/device_impl.cpp b/intern/cycles/device/optix/device_impl.cpp index 151983667c0..94a46acaf18 100644 --- a/intern/cycles/device/optix/device_impl.cpp +++ b/intern/cycles/device/optix/device_impl.cpp @@ -39,6 +39,9 @@ CCL_NAMESPACE_BEGIN // The original code is Copyright NVIDIA Corporation, BSD-3-Clause. namespace { +# if OPTIX_ABI_VERSION >= 60 +using ::optixUtilDenoiserInvokeTiled; +# else static OptixResult optixUtilDenoiserSplitImage(const OptixImage2D &input, const OptixImage2D &output, unsigned int overlapWindowSizeInPixels, @@ -215,6 +218,7 @@ static OptixResult optixUtilDenoiserInvokeTiled(OptixDenoiser denoiser, } return OPTIX_SUCCESS; } +# endif # if OPTIX_ABI_VERSION >= 55 static void execute_optix_task(TaskPool &pool, OptixTask task, OptixResult &failure_reason) |