Open keturn opened 1 year ago
I see timm
in there, and our dependencies are pinned to an old version of that, but upgrading that to the latest didn't help.
The top line is in torch.jit, so I guess something is messed up with my torch installation?
if that line number can be trusted, it's falling over when torch jitscript is trying to copy over the docstring reference?
that is, uh, not something I expected.
https://pytorch.org/docs/stable/jit.html#disable-jit-for-debugging — using PYTORCH_JIT=0
to disable it allows the process to start, but it's obviously not a fix.
Thread 1 "python" received signal SIGSEGV, Segmentation fault. 0x00000000005266a0 in _PyDictKeys_StringLookup (dk=0x0, key='__doc__') at ../Objects/dictobject.c:1011 1011 ../Objects/dictobject.c: No such file or directory. (gdb) bt #0 0x00000000005266a0 in _PyDictKeys_StringLookup (dk=0x0, key='__doc__') at ../Objects/dictobject.c:1011 #1 0x0000000000504e03 in specialize_dict_access (kind=<optimized out>, base_op=95, hint_op=159, values_op=154, name=<optimized out>, type=0x448b4e0, instr=0x4cd1ea6, owner=<torch._C.ScriptFunction at remote 0x7fff435acad0>) at ../Python/specialize.c:625 #2 _Py_Specialize_StoreAttr (name=<optimized out>, instr=0x4cd1ea6, owner=<torch._C.ScriptFunction at remote 0x7fff435acad0>) at ../Python/specialize.c:813
That dk=0x0
-- a null got passed in as the DictKeys object? how does this even happen
building a new version of Python 3.11.4 (using pyenv) instead of using the python3.11 in Ubuntu LTS seems to have fixed things.
So I guess this is not-a-bug?
but maybe we have to explain to people that python 3.11 works unless you're using Ubuntu LTS? ugh.
Yikes. @Millu , let's add a warning in the docs about potential python 3.11 issues on Ubuntu LTS (22.04).
Here's a recipe from @gogurtenjoyer to build python on linux: https://discord.com/channels/1020123559063990373/1049495067846524939/1134255238963011644
Is that the process you followed @keturn ?
No, I used https://github.com/pyenv/pyenv
Seems like this is happening on python 3.10 too 😬
See #3967
Both segfaults, but very different places. This one was at the very start of the process launch, long before being able to attempt image generation.
If I can add to this:
./invoke.sh: line 54: 39533 Segmentation fault (core dumped) invokeai-web $PARAMS
./invoke.sh: line 54: 39533 Segmentation fault (core dumped) invokeai-web $PARAMS
This also happens on my system (Manjaro), but it might be a different issue because setting
PYTORCH_JIT=0
does not fix this issue for me.
Segmentation fault with fresh install of invoke 4 on Manjaro Linux: invoke.sh: line 37: 29423 Segmentation fault (core dumped) invokeai-web $PARAMS
No ideas how to debug this!
This seems to be dependent on the python version installed. You can try installing the latest python using pyenv
or building yourself a fresh python.
Segmentation fault with fresh install of invoke 4 on Manjaro Linux: invoke.sh: line 37: 29423 Segmentation fault (core dumped) invokeai-web $PARAMS
No ideas how to debug this!
It turns out in my case it was patchmatch issue, I recalled trying to fix a recurrent patchmatch warning by following the steps on the repo about how to stop that warning, so I disabled patchmatch in the invokeai.yaml file and I'm not getting the segmentation fault issue anymore, and the webui loads.
@arigbs that's a good catch. Some of the users who have this error had successfully compiled patchmatch. You'll see in the startup logs.
Same problem here. Fedora 40, nvidia, Python 3.11, v4.2.2post1
Crashes on startup. Disabling patchmatch in the config fixes it.
Delete python3.11 completely,
sudo apt-get remove python3.11-venv
sudo apt list --installed | grep python3.11
sudo apt-get purge python3.11
sudo apt-get autoremove
sudo rm -rf /usr/local/lib/python3.11
sudo rm -rf /usr/local/bin/python3.11
sudo apt-get clean
sudo apt-get autoclean
install python3.10-venv
sudo apt install git python3.10-venv -y
It worked for me.
Is there an existing issue for this?
OS
Linux
GPU
cuda
VRAM
12
What version did you experience this issue on?
bb9460d2781276d688d8da6287957826c2c05023
What happened?
I'm trying to get a development environment going with Python 3.11. Dependencies all installed successfully, but
invokeai-web
segfaults immediately.faulthandler log
``` $ PYTHONFAULTHANDLER=True invokeai-web Fatal Python error: Segmentation fault Current thread 0x00007f13ff078000 (most recent call first): File "src/InvokeAI/venv311/lib/python3.11/site-packages/torch/jit/_script.py", line 1345 in script File "src/InvokeAI/venv311/lib/python3.11/site-packages/timm/models/layers/activations_me.py", line 60 insegfault.txt
Additional context
Using python3.11 package on Ubuntu 22.04.2 LTS.