Blender Git Loki

Git Commits -> Revision ecdfb46

Revision ecdfb46 by Sergey Sharybin (master)
September 30, 2020, 14:10 (GMT)
Cycles: Fix usage of memory barriers in split kernel

On user level this fixes dead-lock of OpenCL render on Intel Iris GPUs.
Note that this patch does not include change in the logic which allows
or disallows OpenCL platforms to be used, that will happen after the
kernel fix is known to be fine for the currently officially supported
platforms.

The dead-lock was caused by wrong usage of memory barriers: as per the
OpenCL specification the barrier is to be executed by the entire work
group. This means, that the following code is invalid:

void foo() {
if (some_condition) {
return;
}
barrier(CLK_LOCAL_MEM_FENCE);
}

void bar() {
foo();
}

The Cycles code was mentioning this as an invalid code on CPU, while in
fact this is invalid as per specification. From the implementation side
this change removes the ifdefs around the CPU-only barrier logic, and
is implementing similar logic in the shader setup kernel.

Tested on NUC8i7HVK NUC.

The root cause of the dead-lock was identified by Max Dmitrichenko.

There is no measurable difference in performance of currently supported
OpenCL platforms.

Differential Revision: https://developer.blender.org/D9039

Commit Details:

Full Hash: ecdfb465cc9d992632feec13229fd31666f6b4e8
Parent Commit: 3a7d62c
Lines Changed: +9, -50

3 Modified Paths:

/intern/cycles/kernel/split/kernel_buffer_update.h (+0, -19) (Diff)
/intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h (+0, -19) (Diff)
/intern/cycles/kernel/split/kernel_shader_setup.h (+9, -12) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021