lanzani / jetson-docs

đŸ“– Independent, centralized and community tested nvidia jetson documentation.
https://jetson-docs.com
MIT License
4 stars 0 forks source link

I need to rebuild the mediapipe wheel #5

Open andres-ramirez-duque opened 7 months ago

andres-ramirez-duque commented 7 months ago

Hi Dear Lanzani,

Thanks for your help maintaining jetson-docs,

I need to rebuild the mediapipe0.10.7 - python3.8 wheel to run some algorithms using ssh sessions on remote terminals.

Can you share the steps to build the wheel?

Regards AR

lanzani commented 7 months ago

Hi! Thank you :)

The steps I've used to build mediapipe are described in this dockerfile.

I have the same problem as you in one of my projects: I need to run mediapipe headless, but I did not find a working solution yet. If you manage to make it works, let me know, and I will add your contribution to jetson docs!

:)

P.S. If you like the project, consider to leave a star, so more developers can find this resource :)

andres-ramirez-duque commented 7 months ago

Hi Dear Lanzani,

After a difficult week, I think I have managed to create the wheel by enabling headless running; however, when I run the test script, the following msg is shown:

Created TensorFlow lite XNNPACK delegate for CPU

How can I enable/test GPU support?

I followed all your steps, and I compiled using MEDIAPIPE_DISABLE_GPU=0; as far as I saw, the wheel was created fine.

Any thoughts?

Regards Andrés

lanzani commented 7 months ago

Hello!

Uhm, if you see that message, it can be that something went wrong with the GPU build because it should be already enabled.

May I ask you on which device are you running it?

Also, to reproduce the issue can be useful to have the steps you went through in order to build the wheel, so if you want to share the process I will test it and see what can be the problem.

:)

andres-ramirez-duque commented 7 months ago

Hi,

I'm using a Jetson Nano developer Kit with 4GB; I made a fresh install of JetPack 4.6.4 (L4T 32.7.4)

I followed all the steps to install OpenCV 4.8 from: https://github.com/lanzani/jetson-libraries/blob/main/libraries/opencv/l4t32.7.1/py3.8.0/ocv4.8.0/build_opencv/Dockerfile

Later, I made the mediapipe wheel from: https://github.com/lanzani/jetson-libraries/blob/main/libraries/mediapipe/l4t32.7.1/py3.8.0/mp0.10.7/build_mediapipe/Dockerfile

The only change I made was to delete the "optional" keyword from a proto file because the build crashed.

I used the following env variables:

export PYTHONPATH=/usr/local/lib/python3.8/site-packages export TF_CUDA_PATHS=/usr/local/cuda-10.2:/usr/lib/aarch64-linux-gnu:/usr/include export MEDIAPIPE_DISABLE_GPU=0 export MEDIAPIPE_OMIT_EGL_WINDOW_BIT=1

The jtop info shows:

CUDA: 10.2.300 cuDNN: 8.2.1.32 TensorRT: 8.2.1.8 VPI: 1.2.3 Vulkan: 1.2.70 OpenCV: 4.8.0 with CUDA: YES

Thanks Cheers Andrés

lanzani commented 7 months ago

Hello! Sadly, I wasn't able to make mediapipe work without a display.

In one of my projects tho, I have the need to run mediapipe on a jetson that doesn't have a display plugged in, and my friend @FIGIO55 found a workaround that works. Maybe he can share here his approach :)