Machine Learning – Install TensorFlow v1.1.0 with CUDA in High Sierra(10.13.2)

Welcome to CS With James

If you are using the Ubuntu or Windows then you don’t have to build, simply type

pip3 install tensorflow-gpu

to install the latest version of TensorFlow that support CUDA.

However, if you type the same command in MacOS, you will see they are going to install 1.1.0 version of the TensorFlow-gpu and that is what we are going to use fore awhile

Before install the GPU version of the TensorFlow, you have to uninstall the existing TensorFlow, simply type

pip3 uninstall tensorflow

to uninstall the existing TensorFlow

System Information

  • OS Platform: MacOS High Sierra 10.13.2
  • TensorFlow version: 1.1.0
  • Python version: 3.6.4
  • Graphics Card: GTX 1080 Ti
  • NVIDIA Web Driver Version: 378.10.10.10.25.102
  • CUDA Driver Version: 387.99
  • CUDA Toolkit Version : 8.0
  • cuDNN Version: 5.1

Before start installing anything, you have to understand Web Driver, CUDA Driver, CUDA Toolkit and cuDNN is different software. you can install latest CUDA Driver with the older version of the Toolkit that you want, same to cuDNN.

Web Driver Download

This Driver is only for MacOS 10.13.2, if you are running different version of the OS google for your specific version.

CUDA Toolkit 8.0 Download

Download and install the Driver and the Toolkit, you don’t have to install sample if you want to save some space on your disk. Tensorflow v1.1.0 only support 8.0 so don’t install 9.0 or 9.1 which is newer version of the Toolkit.

Download both Base installer and Patch2 to install

However, you have to update your CUDA Driver to compatible with your OS. After installation, go to System Preference -> CUDA and update to the latest version

cuDNN Download

I downloaded cuDNN v5.1 Library for OSX, for CUDA 8.0. You might need to have the Nvidia’s login id for download, it is free to sign up and download, however it might take some time to get verified. After finishing download type few command to install cuDNN.

Install CUDA Toolkit before install cuDNN

In download folder, Double click the file to unzip

From terminal
cd Downloads
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib/libcudnn* /usr/local/cuda/lib

 

This is pretty much everything you need to install before install the GPU Version of the TensorFlow. In the terminal type

pip3 uninstall tensorflow
pip3 install tensorflow-gpu

to install the GPU enabled TensorFlow. 

To test the TensorFlow, simply run one of the code from previous tutorial. 

 

Leave a Reply

Your email address will not be published. Required fields are marked *