OpenCL-beignet EnqueueNDRangeKernel fails after multiple execution with error -5
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
beignet (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I'm using ubuntu 18.04 amd64. The following code eats up the system memory and after the 22000th iteration the clEnqueueNDRang
cl_int errorcode;
cl_event event;
size_t global_item_size = biases.row;
for(int i = 0; i < 50000; i++)
{
errorcode = clSetKernelArg(
errorcode |= clSetKernelArg(
errorcode |= clSetKernelArg(
errorcode |= clSetKernelArg(
errorcode |= clSetKernelArg(
errorcode |= clEnqueueNDRang
{
cerr << "failed to lauch the kernel " << errorcode << endl;
throw exception();
}
cout << i << endl;
}
The opencl kernel is:
__kernel void test(const int InpRow, const __global float* weights,
{
const int globalRow = get_global_id(0);
float acc = 0.0f;
for (int k=0; k<InpRow; k++) {
acc += weights[
}
output[
}
This problem was not present in ubuntu 16.04.
CPU: i7-4790K
GPU: Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller
OpenCL lib: beignet-
Thank You in advance,
Andrej
affects: | ubuntu → beignet (Ubuntu) |
tags: |
added: bionic removed: ubuntu18.04 |
Memory consumption rises over a run, by ~2GB by the failure point. The exact number of iterations before failure depends on the beignet version but not the matrix size.
git bisect finds that this was introduced by
https:/ /cgit.freedeskt op.org/ beignet/ commit/ ?id=7ae1517cfc3 73847f168ffb3e4 1b635861af19c7
(between 1.2.x and 1.3.x). However, this is a large commit and trying to revert it on 1.3.2 fails with conflicts, so this doesn't provide an immediate way to fix the problem.
As a workaround, it is probably possible to compile beignet 1.2.x from source in Ubuntu 16.04 (use LLVM/Clang 3.8), but I haven't tried this.