InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: PYTORCH_ENABLE_MPS_FALLBACK=1 is not set

Open psychedelicious opened this issue 3 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS

macOS

GPU

mps

VRAM

No response

What happened?

PYTORCH_ENABLE_MPS_FALLBACK=1 is not set. It needs to be set before invoke.py is run, for MPS systems specifically.

Screenshots

No response

Additional context

No response

Contact Details

No response

psychedelicious avatar Dec 02 '22 06:12 psychedelicious

it should be being set in the invoke.sh in the root of the repo (not the one in scripts). i think this is preferable to patching .venv/bin/activate , but open to differing opinions.

damian0815 avatar Dec 02 '22 08:12 damian0815

temporary work-around for those getting 'could not generate image' type errors on console when running on M1 Mac was for me to add the PYTORCH_ENABLE_MPS_FALLBACK setting into existing invoke.sh as suggested above. e.g. adding export PYTORCH_ENABLE_MPS_FALLBACK=1

#!/usr/bin/env sh

export PYTORCH_ENABLE_MPS_FALLBACK=1
set -eu

. .venv/bin/activate

echo "Do you want to generate images using the"
echo "1. command-line"
echo "2. browser-based UI"
echo "OR"
echo "3. open the developer console"
echo "Please enter 1, 2, or 3:"
read choice

Cybergate9 avatar Dec 02 '22 12:12 Cybergate9

this isn’t happening because #1660, which contained commits to implement it, was “superseded” and closed

damian0815 avatar Dec 02 '22 14:12 damian0815