intel / beignet

Beignet is an open source implementation of the OpenCL specification - a generic compute oriented API. Here is Beignet Source Code Mirror in github- This is a publish-only repository and all pull requests are ignored. Please follow https://wiki.freedesktop.org/www/Software/Beignet/ for any of your improvements
GNU Lesser General Public License v2.1
95 stars 40 forks source link

Corrupted cl_mem after soak-test map/unmap from different threads on CL_MEM_ALLOC_HOST_PTR #14

Open smlehbleh opened 5 years ago

smlehbleh commented 5 years ago

Hi, I'm developing camera software which gets cam frames in a thread and copies the data into a cl_mem mapped (created with CL_MEM_ALLOC_HOST_PTR).

If I soak test the code, after 2-5 hours, the cl_mem becomes corrupt and doesn't appear to read/write properly anymore. There are no errors generated and kernels appear to run fine - just the cl_mem contents are corrupted.

When I create the cl_mem without CL_MEM_ALLOC_HOST_PTR, there aren’t any issues - the soak test successfully ran indefinately. But this disables zero-copy increasing the latency.

From what I've researched, could there be a cache coherence issue/bug present?

We are using Beignet 1.3.2 - the issue also occurs in 1.3.1. We can’t try the NEO Compute Runtime at this time as we are utilising the cl_gl sharing feature supported in Beignet to visualise the camera feed - when its supported in NEO we will try that.

Target machine is: Ubuntu 18.04 - Intel NUC i7DNBE