Skip to content
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

Segmentation fault on Manjaro Linux with Mediapipe #150

Open
Tanza3D opened this issue Apr 7, 2023 · 15 comments
Open

Segmentation fault on Manjaro Linux with Mediapipe #150

Tanza3D opened this issue Apr 7, 2023 · 15 comments

Comments

@Tanza3D
Copy link

Tanza3D commented Apr 7, 2023

Describe the bug
Blender completely segfaults out, regardless of what tracking type is being used, and if it's a webcam or mp4 file. I've installed the dependencies manually and used the button through sudo, and they all show up.

To Reproduce
Steps to reproduce the behavior:

  1. Open Blender
  2. Attempt to track Webcam or import video file through BlendArMocap plugin with MediaPipe

Logs
Logs are from 3.5.0, as that's the only one which saves blender-crash.txt. For whatever reason, 3.6.0 seems to segfault so hard it never seems to get the chance to do so.

INFO:root:PoseDetector -> PoseRotationCalculator -> MPPoseOutputNode
04-08 00:12:45 - BlendArMocap: INFO - PoseDetector -> PoseRotationCalculator -> MPPoseOutputNode - cgt_mp_detection_operator.py:62
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Writing: /tmp/blender.crash.txt
zsh: segmentation fault (core dumped)  ./blender
# Blender 3.5.0, Commit date: 2023-02-14 21:21, Hash dcc80748d327
bpy.ops.simpletabs.update()  # Operator
Cannot read file '/home/tanza/Downloads/Drgn21-16_collection_KmiBvis.blend': No such file or directory  # Error
bpy.ops.view3d.blenderkit_disclaimer_widget(message="Don't miss your chance. Only a few days left. Keep lower price forever.", url="https://www.blenderkit.com/articles/price-increase/", fadeout_time=8, tip=False)  # Operator
bpy.context.space_data.system_bookmarks_active = 3  # Property
bpy.context.space_data.params.filter_search = "art"  # Property
bpy.context.space_data.params.filter_search = "blendar"  # Property
Modules Installed (BlendArMocap) from '/home/tanza/Downloads/BlendArMocap_release_160.zip' into '/home/tanza/.config/blender/3.5/scripts/addons'  # Info
bpy.ops.button.cgt_install_dependencies()  # Operator
bpy.context.space_data.system_bookmarks_active = 6  # Property
bpy.context.scene.cgtinker_mediapipe.enum_detection_type = 'HOLISTIC'  # Property
bpy.context.scene.cgtinker_mediapipe.enum_detection_type = 'POSE'  # Property
Running POSE as modal.  # Info

# backtrace

# Python backtrace

Desktop (please complete the following information):

  • OS: Manjaro Linux x86_64 6.1.19-1-MANJARO
  • Blender Version: 3.6.0 Alpha (although same happens on 3.5, although it's also an early beta version of 3.5 😅)
  • BlendArMocap Version: 1.6.0
@Tanza3D
Copy link
Author

Tanza3D commented Apr 7, 2023

I have my own tracking software which routes into Unity which uses OpenCV and Mediapipe and although different versions of both Python and those two packages, it works fine, so I don't think it's a misconfiguration with my system atleast, although maybe I've made a mistake with the install on Blender.

@cgtinker
Copy link
Owner

cgtinker commented Apr 8, 2023

Did you start blender via the terminal?
Did you try detecting in a .mov?

Unix sys and camera permissions can be an issue..

@Tanza3D
Copy link
Author

Tanza3D commented Apr 8, 2023

Trying a .mov file has the same issue as with the mp4 or the camera. I've been running it through the terminal, although trying to detect with blender running as sudo and also trying to detect when running blender from the start menu both also crash. The first log I attached is copied from the terminal as I ran. I've also tried adjusting the permissions of the files but that hasn't helped.

@cgtinker
Copy link
Owner

Don't really know what's going on, maybe the dependency is corrupted. Can you run "pip freeze" within blender or via blenders python executable?

Also, I'm working on a separate exe to pipe the data to blender in the future, maybe you want to join? If so, let me know, currently thinking on how to setup the inter process communication =)
https://github.com/cgtinker/BlendArMocapWrapper

@Tanza3D
Copy link
Author

Tanza3D commented Apr 23, 2023

seems like the opencv-contrib-python version was too new...

absl-py==1.4.0
aiohttp==3.8.4
aiosignal==1.3.1
async-timeout==4.0.2
attrs==22.2.0
autopep8==1.6.0
Brotli==1.0.9
certifi==2021.10.8
charset-normalizer==3.1.0
colorama==0.4.6
contourpy==1.0.7
cycler==0.11.0
Cython==0.29.30
discum==1.4.1
filetype==1.2.0
flatbuffers==23.3.3
fonttools==4.39.3
frozenlist==1.3.3
idna==3.3
kiwisolver==1.4.4
lottie==0.7.0
matplotlib==3.7.1
mediapipe==0.8.10
multidict==6.0.4
numpy==1.24.2
openai==0.27.2
opencv-contrib-python==4.7.0.72
opencv-python==4.7.0.72
packaging==23.0
Pillow==9.4.0
protobuf==3.20.3
pycodestyle==2.8.0
pyparsing==3.0.9
python-dateutil==2.8.2
requests==2.27.1
requests-toolbelt==0.10.1
six==1.16.0
toml==0.10.2
tqdm==4.65.0
ua-parser==0.16.1
urllib3==1.26.8
websocket-client==0.59.0
yarl==1.8.2
zstandard==0.16.0

but the version on the wiki doesn't seem to exist?

ERROR: Could not find a version that satisfies the requirement opencv-contrib-python==4.2.0.34 (from versions: 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.15.55, 3.4.16.59, 3.4.17.61, 3.4.17.63, 3.4.18.65, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.3.56, 4.5.4.58, 4.5.4.60, 4.5.5.62, 4.5.5.64, 4.6.0.66, 4.7.0.68, 4.7.0.72)
ERROR: No matching distribution found for opencv-contrib-python==4.2.0.34

also definitely sounds interesting but don't have any time really, might get around to contributing something in the future to that though! definitely seems like a better way to go about this than integrating it directly into blender lol

@cgtinker
Copy link
Owner

opencv-contrib-python==4.7.0.72 opencv-python==4.7.0.72

having two opencv versions available can also lead to issues. When there have been issues with opencv often the best way is to install opencv via the local package manager (remove blenders pip opencv versions before)..

yea the internal dependencies are really annoying. especially as they can clash with other add-on dependencies and python versions..

@Tanza3D
Copy link
Author

Tanza3D commented Apr 24, 2023

ohh i didn't notice there were two. the other one might've come from something i was working on locally 😅
i uninstalled it (opencv-python) but seems to still lead to the crash :/

@Tanza3D
Copy link
Author

Tanza3D commented Apr 25, 2023

also tried uninstalling the other opencv through blender's python and installing it locally myself, still nothing :(

@Vidyut
Copy link

Vidyut commented Jul 26, 2023

Did you find the solution? I'm having the same issue on a Ubuntu LTS

image

It recognises the dependencies as already available, but Blender crashes if I try to use BlendArMocap.

@Vidyut
Copy link

Vidyut commented Jul 26, 2023

The only thing I can think of is a python version/compatibility issue. The console says PYTHON INTERACTIVE CONSOLE 3.10.9 but the python on my system is 3.10.6. It is true that I have the packages already installed, but I'm not sure this is how it is supposed to be, though I also read somewhere that blender will import modules it needs if they are installed.

Just describing all this in case it helps someone cleverer to pinpoint the issue.

Some clarity on this too would be good, since the instructions insist that higher permissions are needed, but the addon recognises modules installed locally with lower permissions.

Anyway, on the off-chance that it needed to be done via sudo even if the modules were present, I did as the instructions said. The install failed. BTW, for someone non-technical like me, this is terrifying.

I tried to install it directly to the python folder, and it said I lacked permissions. I could try to force the issue with sudo, but given how this thing is going, chances are I'll break something important.

So now what. I have only one opencv, not two, so maybe that isn't the issue. The opencv-contrib-python is 4.6.0.66 (so not too new), then I upgraded opencv. Also crash. So the version doesn't seem to be the issue either. Besides, the newer versions break freemocap's dependency, and given that we're expecting to use freemocap, this can't be the answer, I guess.

Now what.

Only possibility remaining to test seems to be a downloaded blender - it shouldn't need anything it doesn't have permissions for as an ordinary folder... Will try it and update here.

@Tanza3D
Copy link
Author

Tanza3D commented Jul 26, 2023

hi, afraid not, the issue still occurs for me sadly.
also, i use blender downloaded and extracted directly, no package manager or anything, though it might be worth trying an environment like snap or flatpak, i'll try this now

@Tanza3D
Copy link
Author

Tanza3D commented Jul 26, 2023

no luck through flatpak nor snap

@Vidyut
Copy link

Vidyut commented Jul 27, 2023

Some progress from blender's scripting console.

image

If the libraries can be imported, perhaps may be useful to try importing them rather than installing?

@Vidyut
Copy link

Vidyut commented Aug 28, 2023

I was able to install dependencies for dream-textures by going to the addon folder and typing:

/snap/blender/3915/3.6/python/bin/python3.10 -m pip install -r requirements/mac-mps-cpu.txt --target .python_dependencies

As per instructions for installing from source for linux here https://github.com/carson-katri/dream-textures/blob/main/docs/SETUP.md

No higher permissions needed.

Something similar could be done for BlendArMocap? I think specifying the target in the addon folder (as opposed to anything needing elevated permissions) seemed to do the trick.

@Tanza3D
Copy link
Author

Tanza3D commented Dec 1, 2023

noticed something new today, when you run motion detection on a clip, blender very quickly uses up all the disk space before it crashes, i think that'd be something to do with it?

2023-12-01.10-58-54.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants