CUDA_ERROR_NOT_FOUND

Hello,

I’ve been looking for a solution to this for ~3hrs with no success, so I am posting my problem here:

I’m trying to run a Matlab code on my GPU. Matlab parallel processing toolbox seems properly installed (all files there), but when I run anything CUDA related, Matlab returns:

“An unexpected error occurred during CUDA execution. The CUDA error was:
Runtime encountered unexpected driver error: CUDA_ERROR_NOT_FOUND.”

I am using Matlab R2012a 64bit on Windows 8, have a GeForce GT 750M (compute capability 3.0) and have all the latest NVIDIA drivers installed (9.18.13.3182). I have tried to install the CUDA 5.5 toolbox, but it seems to require a full version of MS Visual Studio.

=> Do I need to install MS Visual Studio to use CUDA in Matlab?
=> If not, what could be the source of this “CUDA_ERROR_NOT_FOUND”? How do I diagnose that?

Thanks for any advice!

OrangeOwl solutions has great guides on how to configure MATLAB/VisualStudio 2010:

http://www.orangeowlsolutions.com/archives/498

Just make sure in VS use do NOT use the -G flag (which annoyingly is set by default, and makes the GPU code run 10x slower). Also make sure to set correctly the compute capability in VS.

That OrangeOwl site has all kinds of good info, so if that did not answer your specific question search the site.

Also be aware that calling GPU code from MATLAB does have some overhead when compared to a stand alone executable. This is especially true upon initialization.

Download the trial version of VS 2010 or VS 2012, which will be good for testing. Then try to get a cheap student version (or search online for a serial code).

Thanks for the tips, but my problem is even more basic.

Runnning something as simple as “gpuDevice.m” returns this “unexpected driver error”. So does all the other overloaded Matlab CUDA functions.

So, after a day of tweaking, I managed to solve the issue… however I’m not quite sure of how I did it. In case anyone else has such problem, here were my critical steps:

=> Installed a trial of MS Visual Studio 2012 (+ power off/on cycle)
=> Installed NVIDIA CUDA toolkit (+ power off/on cycle)

At that point, the error turned from “CUDA_ERROR_NOT_FOUND” to “cudaErrorInvalidKernelImage”… well.

=> Flushed MATLAB (+ power off/on cycle)
=> Erased all traces of MATLAB
=> Re-installed MATLAB + parallel processing toolbox

Now, calling something like “gpuDevice” is very slow at first (~4mins), but takes ~4ms subsequently and I can exchange data with the GPU.

Maybe the first time I ran “gpuDevice” I interrupted it after <4min and somehow corrupted something in MATLAB. Anyhow, hope this helps.