How To Compile .cu files for execution in Matlab

I'm trying now about one month just to find the answer for this question where I can find this file
EDU>> cuda_mex simple.cu
Can't open perl script "C:\Program Files (x86)\MATLAB\R2011a Student\bin\cuda_mex.pl": No such file or directory
??? Error using ==> cuda_mex at 208
Unable to complete successfully.
EDU>>
I looked here but it is not here
C:\Program Files (x86)\MATLAB\R2011a Student\bin
so how can I fix this problem ?
is there is any way to use cuda in MATLAB easier than useing cuda_mex.m that gave you many error and do't know what to do with those files?
Thank you

1 Comment

Parallel Computing Toolbox can help you here:
http://www.mathworks.com/help/releases/R2012a/toolbox/distcomp/bslohnr-1.html

Sign in to comment.

Answers (1)

6 Comments

yes and my comment was the last one
10 Apr 2012 Lahdan alfahian
could you tell me what is wrong with my nvcc ?
I don't understand I'm complin from the compiler not from the path I don't get your point !
What you posted in the comments of the FEX file showed that the setup program fails because it cannot write to the MATLAB path file. The reason it cannot write to the MATLAB path file is as described in the above solution; it is a side effect of you having installed MATLAB on the system path (which Windows 7 does not allow you to write to.)
I did this option Use User Account Control (UAC) to off
then what I did is gearate ptx file in 64 bit in out university machin since I coud't do it by nvcc regarding to many error on Visula studio 2010 and 2008 , I put my file test.cu and my test.ptx in Matlab folder then try to construct the kernel
EDU>> k = parallel.gpu.CUDAKernel('simple.ptx', 'simple.cu' , 'add');
then I got this error
??? Error using ==> iCheckPTXEntryAgainstCProto at 411
Expected pointer type but found .u64
Error in ==> C:\Program Files (x86)\MATLAB\R2011a
Student\toolbox\distcomp\gpu\+parallel\+internal\+gpu\handleKernelArgs.p>handleKernelArgs
at 81
now what ??
this file handleKernelArgs.p I tried to opent it it has @!@$#28 diffrent symole and not reduble
please help me to find the problem ,do you think it is becase the visul studio??
Seems like you compiled it on a 64bit machine and you now try to use it in a 32bit MATLAB which wont work. What happens when you compile that cu file on your machine? Try to follow the example in the doc. Does this work?

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 11 Apr 2012

Edited:

on 2 Aug 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!