OpenCL errors on long running tasks

风格不统一 提交于 2019-12-13 03:56:07

问题


I'm running a long-running kernel on a nVidia Quattro 6000 device. The kernel involves a loop with tens of thousands of iterations.

When I ran the kernel, after 2 seconds the screen went black, Windows restarted GPU drivers and clFinish returned an error. So I got myself a second GPU card just for displaying and now the 2 seconds timeout does not apply.

The kernel computed for 50 seconds and then there were these errors (lines prefixed by "GPU ERROR" are errors printed by clCreateContext error callback):

GPU ERROR:
CL_OUT_OF_RESOURCES error executing clFinish on Quadro 6000 (Device 0).

Computation finished, took 50 seconds (00:00:50)
GPU ERROR:
CL_OUT_OF_RESOURCES error waiting for idle on Quadro 6000 (Device 0).

clFinish() returned CL_OUT_OF_RESOURCES
GPU ERROR:
CL_OUT_OF_RESOURCES error waiting for idle on Quadro 6000 (Device 0).

What can I do about it?

For the sake of simplicity, this is a stripped down version of this kernel. In reality it performs integration over a curved surface, that's why I need a loop - but this simple version crashes too, for large enough n.

__kernel void integrate(
                 __global float *input,
                 __global float *output,
                 unsigned int n,
         float c)
{
  size_t kernel_idx = (get_global_id(1)*get_global_size(0) + get_global_id(0));
  if(kernel_idx < inputWidth*inputHeight*inputDepth)
  {
    int j;
    ...
    float sum = 0.0;

    for(j = 0; j < n; j++) // y
    {
      sum += input[j];
    }

    output[kernel_idx] = sum;
    }
}

回答1:


Check your TDR registry key and adjust accordingly

http://msdn.microsoft.com/en-us/library/windows/hardware/ff569918%28v=vs.85%29.aspx



来源:https://stackoverflow.com/questions/11796156/opencl-errors-on-long-running-tasks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!