本文介绍了CUDA未知错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从在Nvidia Tesla M2090上。首先,如问题中所述,我有从 sm_35
更改为 sm_20
CMakeLists.txt
。
I'm trying to run mainSift.cpp
from CudaSift on a Nvidia Tesla M2090. First of all, as explained in this question, I had to change from sm_35
to sm_20
the CMakeLists.txt
.
Unfortunatley现在返回此错误:
Unfortunatley now this error is returned:
checkMsg() CUDA error: LaplaceMulti() execution failed
in file </ghome/rzhengac/Downloads/CudaSift/cudaSiftH.cu>, line 318 : unknown error.
这是 LaplaceMulti
代码: / p>
And this is the LaplaceMulti
code:
double LaplaceMulti(cudaTextureObject_t texObj, CudaImage *results, float baseBlur, float diffScale, float initBlur)
{
float kernel[12*16];
float scale = baseBlur;
for (int i=0;i<NUM_SCALES+3;i++) {
float kernelSum = 0.0f;
float var = scale*scale - initBlur*initBlur;
for (int j=-LAPLACE_R;j<=LAPLACE_R;j++) {
kernel[16*i+j+LAPLACE_R] = (float)expf(-(double)j*j/2.0/var);
kernelSum += kernel[16*i+j+LAPLACE_R];
}
for (int j=-LAPLACE_R;j<=LAPLACE_R;j++)
kernel[16*i+j+LAPLACE_R] /= kernelSum;
scale *= diffScale;
}
safeCall(cudaMemcpyToSymbol(d_Kernel2, kernel, 12*16*sizeof(float)));
int width = results[0].width;
int pitch = results[0].pitch;
int height = results[0].height;
dim3 blocks(iDivUp(width+2*LAPLACE_R, LAPLACE_W), height);
dim3 threads(LAPLACE_W+2*LAPLACE_R, LAPLACE_S);
LaplaceMulti<<<blocks, threads>>>(texObj, results[0].d_data, width, pitch, height);
checkMsg("LaplaceMulti() execution failed\n");
return 0.0;
}
我已经读过这个问题看起来有点相似,但我不明白解决方案意味着或如何使用它为我的问题。
推荐答案
有不支持你的GPU(纹理对象)的功能。我有点惊讶,编译器不会在编译期间生成错误,但这是另一个问题。
There is no solution except to use supported hardware, or to rewrite the code.
[此回答由评论组成,并添加为社区Wiki条目,以获取CUDA标记的未回答列表中的此答案]
这篇关于CUDA未知错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!