Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M1 macbook using GPU for training: problem and solution #247

Open
yingjoeyzhou opened this issue Apr 20, 2024 · 0 comments
Open

M1 macbook using GPU for training: problem and solution #247

yingjoeyzhou opened this issue Apr 20, 2024 · 0 comments

Comments

@yingjoeyzhou
Copy link

Short description of the problem

Having set up the osld environment following steps below (see screenshot), I was able to train HMMs on my M1 macbook. However, tensorflow did not seem to use GPU at all.
Screenshot 2024-04-20 at 13 40 56

Solution

As suggested by https://developer.apple.com/metal/tensorflow-plugin/ , seems like installing the tensorflow-metal plugin solves the problem. Concretely, after pip install tensorflow-macos==2.9.1, I also ran pip install tensorflow-metal==0.5.0. This works in my case as in, if I evaluate

import tensorflow as tf
tf.config.list_physical_devices('GPU')

I now get [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant