Skip to content

Instantly share code, notes, and snippets.

@phmagic
Last active November 4, 2021 06:48
Show Gist options
  • Save phmagic/2b2960a5b7691d8567bcff577eb6b907 to your computer and use it in GitHub Desktop.
Save phmagic/2b2960a5b7691d8567bcff577eb6b907 to your computer and use it in GitHub Desktop.
Install TensorFlow GPU on NVIDIA GeForce GT 750M on macOS Sierra 10.12

Current as of Sept 6, 2017

I have a MacBook Pro Retina 2013 and I had a hard time setting up TensorFlow with GPU support from all the conflicting information out there. I hope this gets you up and running training models on your local computer!

  1. Download the CUDA Toolkit 8.0 for macOS here. Install it using the DMG package.
  2. Edit your ~/.bash_profile file and add the following line: export DYLD_LIBRARY_PATH="/Developer/NVIDIA/CUDA-8.0/lib:$DYLD_LIBRARY_PATH"
  3. Download the CUDA DNN v5.1 from here. This requires you to sign up as an NVIDIA Developer.
  4. Unzip the CUDA DNN package and copy the files inside the include folder to Developer/NVIDIA/CUDA-8.0/include and copy the files inside the lib folder into Developer/NVIDIA/CUDA-8.0/lib
  5. Inside your terminal, do source ~/.bash_profile
  6. Inside your Python environment, do pip install tensorflow-gpu. If you have tensorflow (regular CPU version) already installed, you will need to uninstall it first with pip uninstall tensorflow. If you aren't using an Virtual Environment to keep you python stuff separate, I highly recommend it (check it out here.
  7. Confirm your installation by entering python -c "import tensorflow" in your terminal.

That's all!

@Arnold1
Copy link

Arnold1 commented Feb 29, 2020

hi, can you use it with Tensorflow serving 2.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment