stable-diffusion-docker
stable-diffusion-docker copied to clipboard
Can this work with Macbook Pro M1?
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)
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.
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.
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.