CUDA on Vista 32bit and Matlab 2011a

Hello there,

for a couple of days I am trying to compile .cu files in Matlab R2011a executing the nvmex command but unfortunately with no success. I followed all the available tutorials that I managed to find online (eg Matlab_CUDA_1.1, Tutorials & How To’s With CUDA, Matlab, & Visual Studio etc) but I end up with the following error:

nvmex -f nvmexopts.bat Szeta.cu -IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include -LC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\lib -lcufft -lcudart

C:\PROGRA~1\MATLAB\R2011A\BIN\NVMEX.PL: Error: ‘Files\NVIDIA’ not found.

??? Error using ==> nvmex at 206
Unable to complete successfully.

I updated the files nvmex.pl and nvmexopts.bat that I found online for Matlab R2008a but I still get the same error. I assume that there is something wrong with these 2 files and the version of Matlab that I use.

This is very crucial for my project and although I managed to use mex command successfully for C files in Matlab, I cannot do the same for nvmex and .cu files.

I would really appreciate any suggestion or solution!

Thanks in advance,
Christos

I would like also to add to my previous post that I get the same error when I am trying to use the nvmex command in the Matlab 2007a release. What should I do with this error?

Looks like this reply is about a year late (and possibly many dollars short) but the error you’re getting stems from the fact that your path names the includes (-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include) have spaces in them. The command line interprets this space as a new command line argument, not the continuation of a path. You need to wrap the path name (not the agrument flag, -I) with double quotes to ensure the whole path name makes it into the include, like this:

nvmex -f nvmexopts.bat Szeta.cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include" -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\lib" -lcufft -lcudart

Unfortunately, since the install defaults to a space in the pathname, nearly every installation will have this problem.