CUDA未知错误

扫码查看
本文介绍了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;
}

我已经读过这个问题看起来有点相似,但我不明白解决方案意味着或如何使用它为我的问题。

I've read already this question that seems somewhat similar, but I don't understand what the solution means or how to use it for my problem.

为什么会出现错误?

推荐答案

有不支持你的GPU(纹理对象)的功能。我有点惊讶,编译器不会在编译期间生成错误,但这是另一个问题。

The error occurs because you are running code which has features which are not supported on your GPU (texture objects). I am a little surprised that the compiler doesn't generate an error during compilation, but that is another question.

除了使用支持的硬件,没有解决方案,重写代码。

There is no solution except to use supported hardware, or to rewrite the code.

[此回答由评论组成,并添加为社区Wiki条目,以获取CUDA标记的未回答列表中的此答案]

[This answer assembled from comments and added as a community wiki entry to get this answer off the unanswered list for the CUDA tag]

这篇关于CUDA未知错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

查看更多