Help With CUDA/MatLab Plugin undefined reference to '_cudaMalloc@8'

I am very new to CUDA. I am attempting to follow along with the readme file included the the MatLab Plug In. When I enter

mex fft2_cuda.c -IC:\CUDA\include -LC:\CUDA\lib -lcudart -lcufft

I get the following error message.

Writing library for fft2_cuda.mexw32
c:\docume~1\ndpeters\locals~1\temp\fft2_cuda.obj .text: undefined reference to ‘_cudaMalloc@8’
c:\docume~1\ndpeters\locals~1\temp\fft2_cuda.obj .text: undefined reference to ‘_cudaMemcpy@16’
c:\docume~1\ndpeters\locals~1\temp\fft2_cuda.obj .text: undefined reference to ‘_cufftPlan2d@16’
c:\docume~1\ndpeters\locals~1\temp\fft2_cuda.obj .text: undefined reference to ‘_cufftExecC2C@16’
c:\docume~1\ndpeters\locals~1\temp\fft2_cuda.obj .text: undefined reference to ‘_cufftDestroy@4’
c:\docume~1\ndpeters\locals~1\temp\fft2_cuda.obj .text: undefined reference to ‘_cudaFree@4’

C:\PROGRAM FILES\MATLAB2006A\BIN\MEX.PL: Error: Link of ‘fft2_cuda.mexw32’ failed.

Any help would be greatly appreciated.

I am running MatLab 7.20.232 (R2006a)
I am compiling with Lcc C 2.4.1
My GPU is a Ge-Force 8800 GT

Thanks,
Nick

hmm, for CUDA you need visual studio 2005.

Thank you.

I downloaded VS 2005 and I seem to be getting closer. Now when I execute this line:

nvmex -f nvmexopts.bat Szeta.cu -IC:\CUDA\include -LC:\CUDA\lib -lcufft -lcudart

I get the following error:

Undefined subroutine &main::mexCatdir called at C:\Program
Files\Matlab2006a\bin\nvmex.pl line 1373.
??? Error using ==> nvmex
Unable to complete successfully.

Any ideas? Thank you.

Hi,

I also need help with using the CUDA Matlab plugin. Basically I want to “nvmex” compile my .cu code using Matlab but I am having a tough time doing that. My system specs are:

OS: 32-bits Windows XP Professional

Matlab: ver. 7.2 (i.e. R2006a)

Visual Studio: ver. 8.0 (i.e. 2005)

CUDA: 2.0

GPU: 9800GTX+ (compute capability 1.2)

I downloaded the plug-in from the link http://developer.nvidia.com/object/matlab_cuda.html.

I think the current version there in is meant for CUDA 1.1. Also, it is tested for Matlab 7.3.0 (R2006b). When I try to compile and test the CUFFT interface, I get the following error: -IC:\CUDA\include: unknown option .

Can someone tell me what should I do to be able to use the suitable matlab plug-in?

Also, I wanted to verify the locations of the following files: nvmex.pl & nvmexopts.bat? What are the other “nvmex” files required? Isn’t it C:\Program Files\MATLAB\R2006a\bin? Are the CUFFT files also to be placed in the same location?

Thanks & regards,

Aditi