How to enable mps on Mac? #17039
Replies: 1 comment
-
I have decent performance on my M2 Ultra. Not as good as a cheap PC with a video card, but it's acceptable. Here's what I have in my
It also took me many weeks to work out how to optimize my environment. I use python 3.10.17 and torch 2.7.1. Also in webui-user.sh I have this
If you make a change to your python environment, make sure you delete the /venv directory and then run ./webui.sh to pull the packages. Double check at the bottom of the web page you see the correct versions. I use python 3.10.17 and torch 2.7.1. I tried versions of torch after 2.7.1 but they all produced garbage. You also need Python 3.8 or later. I can get 3.6 to 4.4 it/s depending on which model I use. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m using a MacBook with the Apple M3 chip.
My launch parameters are:
I’ve also installed the nightly version of PyTorch.
However, generating a single 1024×1024 image with 20 steps takes around 20 minutes, which seems abnormally slow.
I did some research and found that I should be able to enable MPS (Metal Performance Shaders). When MPS is working, the log should show
Using torch device: mps
.But no matter what I try, I can’t get it to work — the log never shows that MPS is being used.
Has anyone encountered this on an M3 Mac? Any idea how to fix it?
Beta Was this translation helpful? Give feedback.
All reactions