Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Would TensorFlow utilize GPU on a Mac if installed on a VM?

From TensorFlow's "Getting Started" page:

# Only CPU-version is available at the moment.
$ pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

I'm not super familiar with using GPU or CUDA libraries, but if I installed TensorFlow inside a Linux VM (say the precise32 available through Vagrant), then would TensorFlow utilize the GPU when running inside that VM?

like image 999
190290000 Ruble Man Avatar asked Nov 11 '15 17:11

190290000 Ruble Man


2 Answers

Probably not. VirtualBox, for example, does not support PCI Passthrough on a MacOS host, only a Linux host (and even then, I'd... uh, not get my hopes up). MacOS ends up so tightly integrated with its GPU(s) that I'd be very dubious that any VM can do it at this point.

like image 192
dga Avatar answered Sep 29 '22 03:09

dga


As an update: Tensorflow can now use GPUs on Mac OS X. The relevant PR is https://github.com/tensorflow/tensorflow/pull/664 and after a brew install coreutils the Linux installation 'build from source' instructions should work. I see a 10x speedup compared to the CPU version with an NVIDIA gforce 960 and Intel i7-6700K.

Edit/(downdate?): Starting with MacOS Mojave, due some API changes and what appears to be some long-standing beef between Apple and NVidia, drivers for NVidia graphics cards are no longer available. No NVidia means no Cuda means no Tensorflow, nor really any other respectable machine learning. It appears something like Google Collaboratory is the way to go for now.

like image 32
Matthias Winkelmann Avatar answered Sep 29 '22 02:09

Matthias Winkelmann