3

In Windows 8.1 64bit and Mathematica 10.0.2, I used the latest cuda paclet 10.0.1. However,following the sample code in CUDALink User Guide, the CUDAFunctionLoad returns an error. I can not figure what is not right. Any help?

    Needs["CUDALink`"]
    secondKernelCode = "
  __device__ float f(float x) {
    return tanf(x);
  }

  __global__ void secondKernel(float * diff, float h, mint listSize) {
    int index = threadIdx.x + blockIdx.x * blockDim.x;
      float f_n = f(((float) index) / h);
      float f_n1 = f((index + 1.0) / h);
    if( index < listSize) {
        diff[index] = (f_n1 - f_n) / h;
    }
  }";

secondKernel = 
 CUDAFunctionLoad[secondKernelCode, 
  "secondKernel", {{"Float"}, "Float", _Integer}, 16]

CUDAFunctionLoad::target: "Target system specification \"TargetSystemID\" -> \!\(\"Windows-x86-64\"\) is not available for \!\(\"NVIDIA CUDA Compiler\"\) installation \!\(\"C:\\\\Users\\\\BMP\\\\AppData\\\\Roaming\\\\Mathematica\\\\Paclets\\\\Repository\\\\CUDAResources-Win64-10.0.0.1\\\\CUDAToolkit\\\\bin\\\\\"\). "
sejabs
  • 33
  • 2
  • I also found a same question at forums.wolfram.com, but the answer was the cudalink bug. If it is really the reason for the latest version paclet, I will feel disappoint. – sejabs Dec 15 '14 at 15:01
  • It's working okay for me with paclet version 10.0.0.1 on Windows 7. What C compiler are you using? – Simon Woods Dec 15 '14 at 20:10
  • I use microsoft visual studio 2013 updata3. – sejabs Dec 16 '14 at 01:21

1 Answers1

4

I encountered the same problem and solved it.

You have to check:
1. Your graphics card supports CUDA.
2. CUDA Toolkits and related things have been installed. (from nVidia)
3. CUDA paclet has been installed. (from Wolfram)
4. The C compiler is VS2005, 2008 or 2010. VS2013 is not supported.

njpipeorgan
  • 1,166
  • 6
  • 13
  • Thanks for your reply! My card is Geforce GTX 670,so the first condition is satisfied; Although under the wolfram guide it's no need to install the toolkit because it has been included in the paclet, I have installed the CUDA Toolkits 6.5 from nvidia website, so 2 is ok; CUDACCompiler can show the visual studio imformation, but I guess the toolkit 6.0 included in the latest paclet is not support VS2013. Yes,I googled the information, VS2013 is not officially supported with CUDA 6! I will now change the compiler and try again! – sejabs Dec 16 '14 at 03:38