Public bug reported: I'm using ubuntu 18.04 amd64. The following code eats up the system memory and after the 22000th iteration the clEnqueueNDRangeKernel fails with error -5 (CL_OUT_OF_RESOURCES):
cl_int errorcode; cl_event event; size_t global_item_size = biases.row; for(int i = 0; i < 50000; i++) { errorcode = clSetKernelArg(this->testkernel, 0, sizeof(int), (void*)&input.row); errorcode |= clSetKernelArg(this->testkernel, 1, sizeof(cl_mem), (void *)&(weights.cl_mem_obj)); errorcode |= clSetKernelArg(this->testkernel, 2, sizeof(cl_mem), (void *)&(input.cl_mem_obj)); errorcode |= clSetKernelArg(this->testkernel, 3, sizeof(cl_mem), (void *)&(biases.cl_mem_obj)); errorcode |= clSetKernelArg(this->testkernel, 4, sizeof(cl_mem), (void *)&(output.cl_mem_obj)); errorcode |= clEnqueueNDRangeKernel(this->command_queue, this->testkernel, 1, NULL, &global_item_size, NULL, 0, NULL, &event); if(errorcode != CL_SUCCESS) { cerr << "failed to lauch the kernel " << errorcode << endl; throw exception(); } //clFlush(this->command_queue); //clFinish(this->command_queue); clWaitForEvents(1, &event); cout << i << endl; } The opencl kernel is: __kernel void test(const int InpRow, const __global float* weights, const __global float* input, const __global float* biases, __global float *output) { const int globalRow = get_global_id(0); float acc = 0.0f; for (int k=0; k<InpRow; k++) { acc += weights[globalRow*InpRow + k] * input[k]; } output[globalRow] = acc + biases[globalRow]; } 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-opencl-icd:amd64 1.3.2-2 Thank You in advance, Andrej ** Affects: ubuntu Importance: Undecided Status: New ** Tags: beignet opencl ubuntu18.04 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1776867 Title: OpenCL-beignet EnqueueNDRangeKernel fails after multiple execution with error -5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+bug/1776867/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs