KMLib在GTX 770 GPU中崩溃

时间:2014-07-18 20:23:00

标签: machine-learning gpu svm cuda.net

我在互联网上找到了KMLib,我发现它非常有趣。但是在运行示例应用程序时会出现错误:“GASS.CUDA.CUDAException”“Error Invalid Source”。

方法中发生异常:

protected void InitCudaModule () 
     {
         deviceNr int = 0; 
         cuda = new CUDA (deviceNr, true); 
         cuCtx = cuda.CreateContext (deviceNr, CUCtxFlags.MapHost); 
         / / cuda.SetCurrentContext (cuCtx); 

         / / var ctx = cuda.PopCurrentContext (); 
         / / var CTX2 cuda.PopCurrentContext = (); 
         / / var ctx3 cuda.PopCurrentContext = (); 

         modluePath String = Path.Combine (Environment.CurrentDirectory, cudaModuleName); 
         if (! File.Exists (modluePath)) 
             throw new ArgumentException ("Failed to access cuda module" + modluePath); 

         cuModule = cuda.LoadModule (modluePath); / / ERROR! 

         cuFunc = cuda.GetModuleFunction (cudaProductKernelName); 
     } 

我正在使用GTX770,Visual Studio 2010 Ultimate,Cuda SDK 5.5和Windows 7 64位。

可能导致错误的原因是什么?

1 个答案:

答案 0 :(得分:0)

我不得不经历一些你经历过的相同问题,但我的工作在我的GTX 650 + CUDA 6.5设置上。

我将描述我必须对KMLIB的构建/依赖项所做的更改:

  1. CUDAfy不适用于CUDA 6.5:我不确定KMLib如何使用CUDAfy。除了访问CUDA.NET API(这是一个与CUDAfy合并的独立项目)之外,它实际上可能不会用于任何事情。我不得不对CUDAfy进行多次更改,以减少脑损伤,但我建议您尝试用CUDA.NET替换引用,看看它是否真的需要CUDAfy。如果这对您不起作用,请告诉我,我会找到一种方法与您分享我的CUDAfy / 6.5版本
  2. 您遇到的具体GASS.CUDA.CUDAException实际记录在KMLib's web-page上,虽然有点模糊:

      -arch=sm_21 or -arch=sm_30 – indicates compute capability, former if for Fermi
      cards(e.g Geforce 470), latter is for Kepler cards (e.g. GeForce 690), it 
      is very important to set this switch depending on yours card compute capability
    

    因此,您遇到的问题与GFX卡的架构(Fermi / Kepler / Maxwell)在构建后步骤中与nvcc命令行不一致。我不知道作者指定的sm_30是否适用于770卡,但我最终使用了以下命令行,更改了计算模型,shader-moderl和visual-studio路径(因为CUDA 6.5 usus) VS 2013,和我一样):

    nvcc -I./ KernelsEllpackCol2.cu KernelsCSR.cu KernelsEllpack.cu KernelsSlicedEllpack.cu gpuFanSmoSolver.cu gpuFOSmoSolver.cu -ccbin "%VS120COMNTOOLS%../../VC/bin" -m64  -cubin -gencode=arch=compute_30,code=sm_30  -Xptxas="-v"
    

    您需要更改port-build以反映您的构建系统。