Blender Git Commit Log

Git Commits -> Revision fa3d50a

Revision fa3d50a by Lukas Stockner (master)
November 30, 2017, 06:37 (GMT)
Cycles: Improve denoising speed on GPUs with small tile sizes

Previously, the NLM kernels would be launched once per offset with one thread per pixel.
However, with the smaller tile sizes that are now feasible, there wasn't enough work to fully occupy GPUs which results in a significant slowdown.

Therefore, the kernels are now launched in a single call that handles all offsets at once.
This has two downsides: Memory accesses to accumulating buffers are now atomic, and more importantly, the temporary memory now has to be allocated for every shift at once, increasing the required memory.
On the other hand, of course, the smaller tiles significantly reduce the size of the memory.

The main bottleneck right now is the construction of the transformation - there is nothing to be parallelized there, one thread per pixel is the maximum.
I tried to parallelize the SVD implementation by storing the matrix in shared memory and launching one block per pixel, but that wasn't really going anywhere.

To make the new code somewhat readable, the handling of rectangular regions was cleaned up a bit and commented, it should be easier to understand what's going on now.
Also, some variables have been renamed to make the difference between buffer width and stride more apparent, in addition to some general style cleanup.

Commit Details:

Full Hash: fa3d50af95fde76ef08590d2f86444f2f9fdca95
Parent Commit: df7b9fa
Lines Changed: +664, -437

1 Added Path:

/intern/cycles/util/util_rect.h (+73, -0) (View)

17 Modified Paths:

/intern/cycles/device/device_cpu.cpp (+9, -12) (Diff)
/intern/cycles/device/device_cuda.cpp (+126, -118) (Diff)
/intern/cycles/device/device_denoising.cpp (+13, -11) (Diff)
/intern/cycles/device/device_denoising.h (+3, -2) (Diff)
/intern/cycles/device/opencl/opencl.h (+3, -1) (Diff)
/intern/cycles/device/opencl/opencl_base.cpp (+117, -108) (Diff)
/intern/cycles/kernel/CMakeLists.txt (+1, -0) (Diff)
/intern/cycles/kernel/filter/filter_nlm_cpu.h (+27, -27) (Diff)
/intern/cycles/kernel/filter/filter_nlm_gpu.h (+85, -27) (Diff)
/intern/cycles/kernel/filter/filter_reconstruction.h (+4, -4) (Diff)
/intern/cycles/kernel/kernels/cpu/filter_cpu.h (+7, -10) (Diff)
/intern/cycles/kernel/kernels/cpu/filter_cpu_impl.h (+14, -17) (Diff)
/intern/cycles/kernel/kernels/cuda/filter.cu (+99, -49) (Diff)
/intern/cycles/kernel/kernels/opencl/filter.cl (+75, -49) (Diff)
/intern/cycles/util/CMakeLists.txt (+1, -0) (Diff)
/intern/cycles/util/util_math.h (+2, -0) (Diff)
/intern/cycles/util/util_math_matrix.h (+5, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021