-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
[Bug]: Segmentation Fault in webui.py on M1 Mac #5167
Comments
It doesn't seem like it actually did run once. You get a pretty clear error: Torch is not compiled with CUDA enabled. Generally, using Mac means disabling yourself from a lot of stuff, especially stuff like this, and even more so when using M1/M2 which is ARM-based specialized architecture and the GPU is proprietary (and non-CUDA) as well... Choosing Mac often means choosing non-compatability. I am sure that Applie didn't inform you of that, but that's how it is. Still, some people made general SD work: (They didn't report compute times, however. Since you basically need a supported card to run this GPU-accellerated, and only Nvidia and AMD are supported, you're in for a wait). IF you're gonna make it WebUI work, it probably means not using venv, but conda, unless you're able to take something from the first link and apply it to the WebUI installation. What you CAN maybe do is run SD on CPU only. As a command-line argument, add "--use-cpu all". But again, it will take you at least ten times longer to compute an image. |
It is running on my system. I've been running it for about a month now, and it uses my GPU. Over the past few weeks, stability has gotten pretty bad. I don't know if it was due to the OS update or SD. Both happened about the same time. No idea why I can try to launch it a half dozen times and get the fault, then suddenly it loads as if there's no problem. It's not memory, as a fresh reboot is no guarantee it'll run either. |
Followed these instructions HERE and the issue cleared up. |
Is there an existing issue for this?
What happened?
Segmentation faults on M1 mac in webui.py.
When doing a fresh install, webui.py may or may not start up correctly. When it fails (as it does most of the time) it gets a segmentation fault:
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled No module 'xformers'. Proceeding without it. LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Loading weights [6b508e59] from /Volumes/Mac Data SSD/Developer/stable-diffusion-webui/models/Stable-diffusion/Elysium_Anime_V2.ckpt Loading VAE weights from: /Volumes/Mac Data SSD/Developer/stable-diffusion-webui/models/VAE/kl-f8-anime2.ckpt ./run_webui_mac.sh: line 15: 4213 Segmentation fault: 11 python webui.py --precision full --no-half --use-cpu Interrogate GFPGAN CodeFormer $@
Steps to reproduce the problem
On the first run it usually will run OK. Afterwards, when exiting and restarting it will stubbornly get segmentation faults - nondeterministically. Sometimes no, but most of the time yes. To get it working again, I need to nuke it and reinstall.
What should have happened?
Should run without crashing. Stability has gone down a lot over the past few weeks.
Commit where the problem happens
0b5dcb3
What platforms do you use to access UI ?
MacOS
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
python webui.py --precision full --no-half --use-cpu Interrogate GFPGAN CodeFormer $@
Additional information, context and logs
As you can see from the log below, it successfully ran once (as the default model has changed). It refuses to run a second time.
Adding: pip install -r requirements.txt to the startup script tends to bring it back (cut for brevity):
The text was updated successfully, but these errors were encountered: