Some CUDA functions work for me, others don’t.
Needs["CUDALink`"]
CUDAQ[]
(True)
For instance, CUDAImageConvolve works:
But CUDAMap and CUDAFold do not work:
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.
[1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=sdfksdl.png&userId=167076
[2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=fdgh.png&userId=167076
[3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=dsfg.png&userId=167076
stefanr
(Stefan Ragnarsson)
November 7, 2016, 3:49pm
2
(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.
Toolkit 7.5. Actually I just updated to Toolkit 8.0.47 to see if that would help, but now CUDAQ gives “False.”
stefanr
(Stefan Ragnarsson)
November 8, 2016, 3:50pm
4
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?
(I reupdated the driver so CUDAQ returns True again.)
EVGA GeForce GTX 980Ti is the card.
And if it helps, here is the CUDA info in the SystemInformation[] → “Links” tab:
I appreciate your help Stefan.
stefanr
(Stefan Ragnarsson)
November 8, 2016, 7:39pm
6
Do you have Xcode installed? And have you opened it since installation (the app needs to be opened to complete full installation)?
I was unaware of Xcode. I downloaded it and installed (v8.2), and opened the app. Didn’t solve the issue.
stefanr
(Stefan Ragnarsson)
November 8, 2016, 10:45pm
8
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]
stefanr
(Stefan Ragnarsson)
November 9, 2016, 3:51pm
10
Ah, the line with “nvcc fatal : <>” 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.
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.
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}]
Do any CUDA users out there have some ideas?