I found the KMLib on the internet and I found it very interesting. But when running the sample application an error appears: "GASS.CUDA.CUDAException" "Error Invalid Source".
The exception occurs in the method:
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);
}
I'm using GTX770, Visual Studio 2010 Ultimate, Cuda SDK 5.5 and Windows 7 64-bit.
What can be causing the error?
I've had to go through some of the same issues that you went through, but I got it working on my GTX 650 + CUDA 6.5 setup.
I'll describe the changes I had to make into the build/dependencies of KMLIB:
The specific GASS.CUDA.CUDAException you've encountered is something that is actually documented on KMLib's web-page, albeit somewhat obscurely:
So the issue you are experiencing has to do with the architecture of the GFX card (Fermi/Kepler/Maxwell) not being in line with the nvcc command-line in the post-build step. I don't know if the sm_30 as the author specifies is correct for the 770 card, but I ended up using the following command line, changing the compute-model, shader-moderl, and the visual-studio path (since CUDA 6.5 usus VS 2013, as was I):
You will need to change the port-build to reflect your build system.