Message Boards Message Boards

Avoid problem with some CUDA functions?

Posted 8 years ago

Some CUDA functions work for me, others don't.

Needs["CUDALink`"] 
CUDAQ[]

(True)

For instance, CUDAImageConvolve works:

enter image description here

But CUDAMap and CUDAFold do not work:

enter image description here

enter image description here

I'm not quite sure how to interpret the error message. Might be noteworthy that I am using OSX 10.11.6, while the messages refer to 10.5.0. I don't think it is a driver issue, as I updated to the latest driver and still get the same error. Any ideas why this issue is occurring? Thanks in advance.

POSTED BY: Bryan Lettner
11 Replies
Posted 8 years ago

Do any CUDA users out there have some ideas?

POSTED BY: Bryan Lettner

(1) What version of the CUDA Toolkit do you have installed?

(2) The "10.5.0" is the version of the paclet, and is not related to the OSX version.

Posted 8 years ago

Toolkit 7.5. Actually I just updated to Toolkit 8.0.47 to see if that would help, but now CUDAQ gives "False."

POSTED BY: Updating Name

Yes, the 10.5.0 CUDALink paclets currently only support Toolkit 7.5.

What kind of graphics card does your machine have? What does CUDAInformation[] return?

Posted 8 years ago

(I reupdated the driver so CUDAQ returns True again.)

EVGA GeForce GTX 980Ti is the card. enter image description here

And if it helps, here is the CUDA info in the SystemInformation[] -> "Links" tab: enter image description here

I appreciate your help Stefan.

POSTED BY: Bryan Lettner

Do you have Xcode installed? And have you opened it since installation (the app needs to be opened to complete full installation)?

Posted 8 years ago

I was unaware of Xcode. I downloaded it and installed (v8.2), and opened the app. Didn't solve the issue.

POSTED BY: Bryan Lettner

What does the following return for you?

code = "
  __global__ void addTwo(mint * in, mint * out, mint length) {
    int index = threadIdx.x + blockIdx.x*blockDim.x;
    if (index < length)
     out[index] = in[index] + 2;
  }";

cudaFun = 
 CUDAFunctionLoad[code, 
  "addTwo", {{_Integer, _, "Input"}, {_Integer, _, 
    "Output"}, _Integer}, 256, "ShellCommandFunction" -> Print, 
  "ShellOutputFunction" -> Print]
Posted 8 years ago

enter image description here

The Stack Trace:

enter image description here

POSTED BY: Bryan Lettner

Ah, the line with "nvcc fatal : <<etc>>" is key. The issue is that CUDA Toolkit 7.5 doesn't support the very latest clang C compiler (which Xcode installs). So, unless I'm mistaken, this is the situation:

(a) Before you installed Xcode, the problem was that the clang C compiler wasn't installed.

(b) Now after you installed Xcode, the problem is that your clang compiler is too new!

Perhaps the best thing to try would be to install an older version of Xcode from somewhere... I believe you can download them directly from Apple if you have a Developer Account with them, but otherwise I'm not sure.

Posted 8 years ago

Okay so I tried a few different Xcode versions, and version 6.4 makes your code work. However, the same issue persists for CUDAMap and CUDAFold.

enter image description here

What I am mostly trying to achieve with CUDA is to generate a parallel table, which I assume can be achieved with CUDAMap, since the following is not quite fast enough for my purposes:

ParallelTable[
 Sum[{1/(Sqrt[2.])^k Sin[(Sqrt[2.])^k t], 
   1/(Sqrt[2.])^k Cos[(Sqrt[2.])^k t]}, {k, 1, 35}], {t, 0, 100. Pi, 0.00002}]
POSTED BY: Bryan Lettner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract