stable-diffusion-docker icon indicating copy to clipboard operation
stable-diffusion-docker copied to clipboard

Can this work with Macbook Pro M1?

Open pmaojo opened this issue 2 years ago • 3 comments

I am having this error on build:

./build.sh run 'A high tech solarpunk utopia in the Amazon rainforest'

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
(base) 

pmaojo avatar Aug 25 '22 22:08 pmaojo

I'm not sure if it can work with a Macbook Pro M1.

There are a few issues in my mind that would need to be overcome:

  • From what I can tell the tensorflow docker images are only built for amd64, not arm64. It might be possible to create your own compatible version of the tensorflow image, however.
  • The model requires at least 8GB of dedicated GPU RAM. I believe the M1 uses a shared memory pool, so even if you had an M1 with 8GB+ of RAM, it's not clear to me if / how that would work.
  • The current tensorflow-gpu image uses CUDA. I'm not sure if there's an equivalent for the M1.
  • Since the M1 has a different architecture from amd64, I'm not sure whether the model code like the torch tensors or model structure would need to be modified to work on it.

Let me know if you investigate this in more detail. It would be great to have a working arm64 version.

fboulnois avatar Aug 26 '22 00:08 fboulnois

According to this it does run, however, it is kind of slow and I ran into some issues that I didn't bother resolving. Now I just run it on an EC2 instance.

kailukowiak avatar Sep 01 '22 16:09 kailukowiak

I was already afraid this would not work fine on a Arm based Mac. It does work, but the fact that it's running as an amd64 image (emulation) and no gpu available makes the performance really bad. I did generate an image on my Macbook Pro M1. It was at least a hour for generating one image.

peterfortuin avatar Sep 13 '23 11:09 peterfortuin