我在nVidia Quattro 6000設備上運行長時間運行的內核。內核涉及數以萬計的迭代循環。長時間運行任務中的OpenCL錯誤
當我運行內核時,2秒後屏幕變黑,Windows重新啓動GPU驅動程序,clFinish返回錯誤。所以我給了自己一張第二張GPU卡用於顯示,現在2秒超時不適用。
內核計算50秒,然後出現了這些錯誤(由「GPU ERROR」被clCreateContext錯誤回調印刷錯誤前綴的行):
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).
我能做些什麼呢?
爲了簡單起見,這是這個內核的一個精簡版本。實際上,它在曲面上執行集成,這就是爲什麼我需要一個循環 - 但是這個簡單的版本也崩潰了,因爲足夠大的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;
}
}
更新:更新驅動程序後,從回調的錯誤是不存在,clFinish()返回CL_INVALID_COMMAND_QUEUE – GDR 2012-08-03 13:30:04