Skip to content

Main.py crashes with Arch-based distro, + workaround #6

@autodistries

Description

@autodistries

I have tried running FoxyFace on my laptop (which runs Garuda Linux, based on Arch) and it failed. It also failed on a brand-new Arch system, so this is either the hardware of my computer that's at fault, or any Arch-based distro will similarly fail. I have not tested other distros.

Laptop has an integrated Alder-Lake Intel GPU, and a discrete Nvidia gpu which is configured well enough. I use envycontrol to choose what GPU to use, and I only tested FoxyFace while both GPUs were available to use. I can run anything on my nvidia gpu (either with prime-run xxx, or with __GLX_VENDOR_PRELOADER=nvidia xxx. It shows up in nvidia-smi).

I have tried both with the python312 aur package and pyenv-managed python, with the same results.
The error, which showed in the latest.log and in terminal, was the following :

latest.log

I've made the file a little bit more readable. This is the gist of it:

Traceback (most recent call last):
File "/home/user/FoxyFace/FoxyFace/Main.py", line 30, in <module>
from src.UpdateChecker import UpdateChecker
File "/home/user/FoxyFace/FoxyFace/src/UpdateChecker.py", line 10, in <module>
from src.ui.windows.MainWindow import MainWindow
File "/home/user/FoxyFace/FoxyFace/src/ui/windows/MainWindow.py", line 12, in <module>
from src.pipline.BabblePipeline import BabblePipeline
File "/home/user/FoxyFace/FoxyFace/src/pipline/BabblePipeline.py", line 7, in <module>
from src.pipline.MediaPipePipeline import MediaPipePipeline
File "/home/user/FoxyFace/FoxyFace/src/pipline/MediaPipePipeline.py", line 17, in <module>
from src.stream.mediapipe.core.MediaPipeFrame import MediaPipeFrame
File "/home/user/FoxyFace/FoxyFace/src/stream/mediapipe/core/MediaPipeFrame.py", line 3, in <module>
from mediapipe.tasks.python.vision.face_landmarker import FaceLandmarkerResult
File "/home/user/.pyenv/versions/venv/lib/python3.12/site-packages/mediapipe/__init__.py", line 16, in <module>
import mediapipe.python.solutions as solutions 
File "/home/user/.pyenv/versions/venv/lib/python3.12/site-packages/mediapipe/python/solutions/__init__.py", line 17, in <module>
import mediapipe.python.solutions.drawing_styles
File "/home/user/.pyenv/versions/venv/lib/python3.12/site-packages/mediapipe/python/solutions/drawing_styles.py", line 21, in <module>
from mediapipe.python.solutions.hands import HandLandmark
File "/home/user/.pyenv/versions/venv/lib/python3.12/site-packages/mediapipe/python/solutions/hands.py", line 31, in <module>
from mediapipe.calculators.tflite import ssd_anchors_calculator_pb2
File "/home/user/.pyenv/versions/venv/lib/python3.12/site-packages/mediapipe/calculators/tflite/ssd_anchors_calculator_pb2.py", line 23, in <module>
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n9mediapipe/calculators/tflite/ssd_anchors_calculator.proto\x12\tmediapipe\x1a$mediapipe/framework/calculator.proto\x1a\x39mediapipe/framework/formats/object_detection/anchor.proto\"\xd7\x05\n\x1bSsdAnchorsCalculatorOptions\x12\x18\n\x10input_size_width\x18\x01 \x01(\x05\x12\x19\n\x11input_size_height\x18\x02 \x01(\x05\x12\x11\n\tmin_scale\x18\x03 \x01(\x02\x12\x11\n\tmax_scale\x18\x04 \x01(\x02\x12\x1c\n\x0f\x61nchor_offset_x\x18\x05 \x01(\x02:\x03\x30.5\x12\x1c\n\x0f\x61nchor_offset_y\x18\x06 \x01(\x02:\x03\x30.5\x12\x12\n\nnum_layers\x18\x07 \x01(\x05\x12\x19\n\x11\x66\x65\x61ture_map_width\x18\x08 \x03(\x05\x12\x1a\n\x12\x66\x65\x61ture_map_height\x18\t \x03(\x05\x12\x0f\n\x07strides\x18\n \x03(\x05\x12\x15\n\raspect_ratios\x18\x0b \x03(\x02\x12+\n\x1creduce_boxes_in_lowest_layer\x18\x0c \x01(\x08:\x05\x66\x61lse\x12*\n\x1finterpolated_scale_aspect_ratio\x18\r \x01(\x02:\x01\x31\x12 \n\x11\x66ixed_anchor_size\x18\x0e \x01(\x08:\x05\x66\x61lse\x12+\n\x1cmultiscale_anchor_generation\x18\x0f \x01(\x08:\x05\x66\x61lse\x12\x14\n\tmin_level\x18\x10 \x01(\x05:\x01\x33\x12\x14\n\tmax_level\x18\x11 \x01(\x05:\x01\x37\x12\x17\n\x0c\x61nchor_scale\x18\x12 \x01(\x02:\x01\x34\x12\x1c\n\x11scales_per_octave\x18\x13 \x01(\x05:\x01\x32\x12#\n\x15normalize_coordinates\x18\x14 \x01(\x08:\x04true\x12(\n\rfixed_anchors\x18\x15 \x03(\x0b\x32\x11.mediapipe.Anchor2T\n\x03\x65xt\x12\x1c.mediapipe.CalculatorOptions\x18\xff\xb8\xf3u \x01(\x0b\x32&.mediapipe.SsdAnchorsCalculatorOptions')
TypeError : Couldn't build proto file into descriptor pool: Invalid default '0.5' for field mediapipe.SsdAnchorsCalculatorOptions.anchor_offset_x of type 2

I got around the problem by installing distrobox (in the extra repo). I created a debian-based box, entered it, installed pyenv, python3.12.9, libportaudio2, then created a virtualenv, activated it, installed the python FoxyFace requirements, then ran the app :

distrobox create --name debian-latest --image debian:latest
distrobox enter debian-latest # this drops you in the box's shell
bash --norc # The .bashrc/fishrc are shared. So if your host system has aliases like   apt=man pacman   this is necessary
sudo apt install pyenv
pyenv install 3.12.9 # pyenv uses your home dir to store stuff. So you may already have a correct python version installed. Check with : pyenv versions
eval "$(pyenv init - bash)" # This lets pyenv take control of what happens when you run python
cd FoxyFace/FoxyFace # your folders are shared between host and box
pyenv shell 3.12.9 # sets the default python version for this shell session to 3.12.9
python --version # make sure all is good
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python Main.py

I could not get it to run on my NVIDIA GPU. There are supposedly guides for this but I couldn't get it to work. I still get fairly low latency with my integrated cpu.
Anyway, I run VRCFT on my host machine and there are no issues for them to communicate.

I have created a .desktop that runs the following command for easier launching :

distrobox enter debian-latest -- /bin/bash --norc -c 'cd /path/to/FoxyFace/FoxyFace && eval "$(pyenv init - bash)" && source venv/bin/activate && python Main.py'

(I set it to open in a terminal, because closing the window seemingly doesn't fully exit the app)

Thanks for @Jeka8833 for their time and the help witg debugging c:

Edit : If I run the program with the discrete NVidia GPU disabled, I get *8 in image processing delay, so some obscure stuff is happening somewhere

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions