Greetings,
I am new to CUDA and I just started to use it because I am using k-Neares Neighbors algorithms and someone told me that I could achieve the same results I have achieved with simple Matlab functions if I used the CUDA programmes compiled in Matlab.
So a manage to find an algorithm written in CUDA that does exactly what I wanted, I just have to compile it in Matlab. It came with a readme file that had simple instructions to get it to work.
The instructions are the following:
MATLAB
1. Set the global variable MATLAB_CODE to 1 in file knn_cublas_with_indexes.cu
2. Compile the CUDA file with the Matlab command line:
nvmex -f nvmexopts.bat knn_cublas_with_indexes.cu -I’C:\CUDA\include’ -L’C:\CUDA\lib’ -lcufft -lcudart -lcuda -lcublas -D_CRT_SECURE_NO_DEPRECATE
3. Execute the run_matlab.m script
It also listed the following system requirements:
REQUIREMENTS
- The computer must have a CUDA-enabled graphic card (c.f. NVIDIA website)
- CUDA has to be installed (CUDA drivers and CUDA toolkit)
- A C compiler has to be installed
- For using the CUDA code in Matlab, please refer to the CUDA Matlab plug-in webpage for requirements.
My computer has a Nvidia GeForce GTS 360M. I installed the CUDA toolkit and SDK (even performed the tests in order to check if the system is comunicating with the hardware). I have Microsoft Visual Studio 2010 Ultimate installed. I also installed the latest Matlab CUDA plug-in.
I am using WIndows 7 Professional 64bit and Matlab R2010b 64bit.
So my system apparently is ready for CUDA.
What happens is when I try to compile using " nvmex -f nvmexopts.bat knn_cublas_with_indexes.cu -I’C:\CUDA\include’ -L’C:\CUDA\lib’ -lcufft -lcudart -lcuda -lcublas -D_CRT_SECURE_NO_DEPRECATE" (of course with the proper directory set) I get the following message:
nvmex -f nvmexopts.bat knn_cublas_without_indexes.cu -IC:\CUDA\include -LC:\CUDA\lib\x64 -lcufft -lcudart -lcuda -lcublas
Undefined subroutine &main::uuidgen called at C:\Program Files\MATLAB\R2010b\bin\nvmex.pl line 728.
??? Error using ==> nvmex at 206
Unable to complete successfully.
I don’t know if is possible for you to provide any help but I would be grateful if I could get just some pointers to the right direction.
Best regards.