CUDA computing with Matlab

Hello everyone,
I would like to use the Matlab CUDA plug-in to compile my CU file in Matlab. The operating system is Ubuntu 10.10 and the Matlab version is 2011a. When I finish programming the cu file and compile it in Matlab, it encounter the following problem:

nvmex -f nvmexopts64.bat my.cu \home\lys\cuda\include \home\lys\cuda\lib\x64 -lcudart -lcufft
.: 1341: nvmexopts64.bat: not found

What should I do next ? I do put the nvmex.m nvmex_help.m and nvmexopts64.bat into the same folder of the my.cu file.

Thanks a lot

You may have to hack at the various scripts to force them to be able to locate the .bat file properly. Those scripts are really old and not really maintained very well.

Of course, you always have the option to get better integration of your CUDA code into MATLABĀ® through the Jacket SDK, which has many advantages over using nvmex. Good luck!

There is another way of building mex files with CUDA support.

From inside Matlab:

!nvcc -c my.cu -Xcompiler -fPIC -I /usr/local/matlab/extern/include

mex my.o -L /usr/local/cuda/lib64 -lcudart -lcufft

Thanks for your help. When I use the commend !nvcc -c my.cu -Xcompiler -fPIC -I /usr/local/matlab/extern/include in my Matlab commend window, it encounters:

/bin/bash: nvcc: command not found

Use the full path /usr/local/cuda/bin/nvcc or fix you .bashrc