Installing Theano and CUDA on Mac OS X

I started trying Theano today and wanted to use the GPU (NVIDIA GeForce GT 750M 2048 MB) on my Mac. Here’s a brief instruction on how to use the GPU on Mac, largely following the instructions from http://deeplearning.net/software/theano/install.html#mac-os.

Install Theano:

Download and install CUDA: https://developer.nvidia.com/cuda-downloads

Put the following lines into your ~/.bash_profile:

Note that the PATH line is necessary. Otherwise you may see the following message:

ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check your nvcc installation and try again.

Configure Theano:

Test if GPU is used:

A more realistic example:

So it seems this GPU does not outperform the CPU. Well,GT 750M may not be the best GPU you can get… Someone else here has a similar experience.

 

3 thoughts on “Installing Theano and CUDA on Mac OS X

  1. Hi Daoyuan,

    That is a nice tutorial.

    What is your computer set up?

    2017 Mac do not use NVIDIA cards. CUDA won’t install on the card they chosen (Radeon).

    Without CUDA, Theano will not be able to use the GPU. However, it can still run on the CPU alone although at much reduced speed.

    There is currently no easy solution for Mac users and that is why we are switching to Linux environments on PC desktops.

    Gilles

    • Hi Gilles,

      My Mac was from late 2014 with NVIDIA GeForce GT 750M. Since CUDA is designed specifically for NVdia GPUs, it will not work with AMD GPUs…

Leave a Reply

Your email address will not be published.