Following ybeltukov's excellent answers (see here and here) about how to access the CUDA library functions and interact with Mathematica through CUDAMemory, I tried to compile the code given in ybeltukov's first post. The reason behind that is that I would like to implement a wave-propagation ODE solver (split-step method) on the GPU. My goal was to modify ybeltukov's code to get a 1D FFT of a 2D array (batch mode of cuFFT). I am rather a beginner in C and CUDA and I'm looking for some help.

I use Mathematica 10 under Win8.1 with the system installation of CUDA 5.0 and VS 2012. The GPU is a Quadro K600. I checked the installation with some basic compilation examples. Everything seems ok (CUDAQ[], CUDACCompiler etc).

I encounter two troubles:

  • the "CUDAArchitecture->" option for CreateLibrary is not recognized. It seems that my GPU supports 3.0. I tried "CUDAArchitecture"->"sm_30" and others (->"30" etc) but none worked
  • I get the following compilation errors: "unresolved external symbol" for cufftPLan1d, cufftExecC2C and cufftDestroy. I tried to add #include <cufft.h> in the header of the C code but it failed. It seems that some library path is missing somewhere.

Compared to ybeltukov's first post the only modification I've done is to change "Libraries" -> FileNameJoin@{$CUDALinkLibraryPath, "libCUDALink_Single.so"} into "Libraries" -> FileNameJoin@{$CUDALinkLibraryPath, "libCUDALink_Single.lib"} (there was no *.so in my $CUDALinkLibraryPath).

Thanks in advance to anyone who can help.

  • $\begingroup$ Sorry, I missed your question. Actually "CUDAArchitecture" -> "sm_30" works, but CreateLibrary emits superfluous "Unknown option" error. The second question can be Win-specific (see also this question) $\endgroup$ – ybeltukov Apr 11 '16 at 18:26
  • $\begingroup$ @Nicolas Did you find a working solution to this? $\endgroup$ – Jose Enrique Calderon Jun 28 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.