CUDA Double Precision in MATLAB Using double CUDA precision numbers in MATLAB

I have MATLAB plug-in 1.1 and CUDA 2.0 on my machine. Nvmex compiler in MATLAB does not recognize --arch or --gpu_name flags to enable double precision computations.

I assume that nVidia is supposed to release a new plugin for MATLAB to go with their 2.0 toolkit. When will they do it? Any ideas?

In the meantime, does anybody know how to make double precision work in MATLAB? It appears that it requires some modifications to nvmexopts.bat or nvmex.pl files.

I appreciate your help.

I edited the mexopts.sh file on linux, so I guess just add it to the NVCCOPTIONS in the nvmexopts.bat file.

Thanks for some ideas.

Modyfing nvmexopts.bat alone under Windows is not enough to enable double precision in MATLAB, it still says that it does not recognize --gpu_name option.

I have seen it working under Linux after adding --gpu_name sm_13 to compiler options in mexopts.sh and nvmex shell files.

So, analogously, I assume that I should also add this compiler option somewhere in nvmex.pl perl file. I just cannot figure out where exactly.

I appreciate any help.

I believe the only thing needed is --arch sm_13 in the mexopts file, nvmex uses the mexopts file for the compiler options. There is normally a line like NVCCOPTIONS = …, I just added --arch sm_13 to that line I believe. I am currently on holiday, so unable to check it unfortunately.

Thanks for help E.D. Riedijk, I finally have the solution.

Instead of adding flag in the compiler line in MATLAB (to enable double precision), which MATLAB script does not recognize in the current version, the flag should be permanently added to nvmexopts.bat file. The flag should be added to COMPFLAGS line in the file. Any of the following combinations of flags should work:
-arch sm_13
-arch compute_13
–gpu-name sm_13
–gpu-name compute_13

Hi,

I have exact same problem, but even after adding flags to the COMPFLAGS line of the nvmexopts.bat, I still get error saying it does not recognize the flag or some other error. May I ask if it would be possible for you to post the modified nvmexopts.bat file? or may be just copy the contents of the file here? I am not a programming expert by any stretch of imagination So I might be doing something wrong.

The main problem I am looking at is pasted below. Just copying from other post that I made before.

"I am using CUDA code to speedup my matlab (version R2008a) computations and I am getting speedups of over 200. The trouble is that, I am using the code for an optimization technique where even though my CUDA results match within first 7 decimal places of accuracy for every element of my matrix (4 million entries), my code doesnt converge.

So, I moved to a double precision supporting card (GTX280) and now I am having troubles getting the GPU to do double precision computations. The kernel returns my matrices with garbage values. I browsed internet for solutions and some people talked about adding flags to the COMPFLAGS line of the nvmexopts.bat file but it didnt really work for me"

So Yeah, if would be wonderful if you can help me any way you can.

Thanks a lot