10
$\begingroup$

On my MacBook Pro, I have a CUDA enabled video card, yet Mathematica does not seem to recognize this. For example, following the CUDALink Setup, I get

Needs["CUDALink`"]
CUDAQ[]
(* False *)
CUDADriverVersion[] 
(* CUDADriverVersion::nodriv message raised. *)

Additionally, according to the documentation, my card is not listed, despite NVidia saying otherwise.

How do I convince Mathematica that my card supports CUDA?

$\endgroup$
3
  • $\begingroup$ I think this'll need an update for v9. I have CUDA working with v8 but not v9. $\endgroup$
    – Szabolcs
    Nov 29, 2012 at 3:45
  • $\begingroup$ @Szabolcs I have not tried it with 9. Will have to do that this weekend ... $\endgroup$
    – rcollyer
    Nov 29, 2012 at 4:40
  • 1
    $\begingroup$ It turns out that the problem was that v9 tried to use the resources downloaded for v8, but the binaries are incompatible. I couldn't figure out how to remove the resource packet, so I removed the Library/Mathematica directory entirely, let Mathematica 9 re-download the CUDA resources, and now everything is working fine. $\endgroup$
    – Szabolcs
    Nov 30, 2012 at 2:19

1 Answer 1

12
$\begingroup$

The answer, in this case, is updating the CUDA driver manually. Finding the driver, though, is non-trivial. For instance, this page says that there are no drivers available for the mac. To find the CUDA drivers, you need to find the Developer Zone, and go to the CUDA downloads page. Interestingly enough, the Getting Started Documentation (pdf) is Windows specific and does not include the 300 series in its list of supported cards. However, downloading the CUDA for MAC drivers works just fine on my machine. Note: you only need to download the drivers (currently the middle of the three links) to get it working.

Needs["CUDALink`"]
CUDAQ[] (* True *)
CUDADriverVersion[] (* 4.2.9 *)

alongside the rest of the tests. But, the proof is in the graphics:

data = CUDAVolumetricDataRead[
        FileNameJoin[{$CUDALinkExampleDataPath, "Bucky.raw"}], 
        32, 32
       ];
CUDAVolumetricRender[data, "Width" -> 400, "Height" -> 400]

output from CUDAVolumetricRender

$\endgroup$
15
  • $\begingroup$ You have a Mac with an Nvidia card? How did you get it? I'd buy one if I could. $\endgroup$
    – Jens
    Jun 5, 2012 at 15:25
  • 1
    $\begingroup$ @Jens I have a 2010 model. It appears that the current line of macbooks have AMD Radeons. $\endgroup$
    – rcollyer
    Jun 5, 2012 at 15:31
  • $\begingroup$ @Jens My 2008 MBP has a CUDA capable Nvidia card. I guess the newer ones don't $\endgroup$
    – rm -rf
    Jun 5, 2012 at 16:03
  • $\begingroup$ @R.M But, the Radeon's support OpenCL which is baked into the OS starting v. 10.6. $\endgroup$
    – rcollyer
    Jun 5, 2012 at 16:10
  • $\begingroup$ @R.M. yes, but OpenCL is less mature than CUDA, and you have to implement more things by hand (e.g. if you want to use BLAS/LAPACK). Thanks for the info! $\endgroup$
    – Jens
    Jun 5, 2012 at 17:14

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.