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
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

#1
Posted 04/10/2012 03:04 PM   
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(R) through the Jacket SDK, which [url="http://blog.accelereyes.com/blog/2010/10/29/jacket_sdk_trumps_mex/"]has many advantages[/url] over using nvmex. Good luck!
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(R) through the Jacket SDK, which has many advantages over using nvmex. Good luck!

John Melonakos ([email="john.melonakos@accelereyes.com"]john.melonakos@accelereyes.com[/email])

#2
Posted 04/10/2012 03:08 PM   
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
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

#3
Posted 04/10/2012 03:13 PM   
[quote name='mfatica' date='10 April 2012 - 09:13 AM' timestamp='1334070818' post='1394290']
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
[/quote]


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
[quote name='mfatica' date='10 April 2012 - 09:13 AM' timestamp='1334070818' post='1394290']

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

#4
Posted 04/10/2012 03:30 PM   
Use the full path /usr/local/cuda/bin/nvcc or fix you .bashrc
Use the full path /usr/local/cuda/bin/nvcc or fix you .bashrc

#5
Posted 04/10/2012 03:51 PM   
Scroll To Top