mediapipe
mediapipe copied to clipboard
Build AutoFlip with GPU and CUDA
Hi Team,
I am trying to figure out how to correctly compile AutoFlip to run using the GPU.
System information
-
Dell Vostro 14, 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz × 8 , NVIDIA MX330, 32GB RAM, Ubuntu 20.04LTS, Nvidia Driver 470.103.01, CUDA 11.2
-
Compiler version: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
-
Programming Language and version: Python 3.8.10, TensorFlow as extracted by the mediapipe package. The package checks out the latest TF version which is 2.9 - still in development - This is specified in the mediapipe/WORKSPACE file
-
MediaPipe version: v0.8.9
-
Bazel version: 4.2.1
-
OpenCV version (if running on desktop): 3.4 (installed opencv using the mediapipe/setup_opencv.sh script)
Describe the problem: I am trying to build AutoFlip to work with the GPU, was able to build the package but when running it - it doesn't seem to be using the GPU (GPU utilization is 0)
Build command: bazel-4.2.1 build -c opt --config=cuda --spawn_strategy=local --define no_aws_support=true --copt -DMESA_EGL_NO_X11_HEADERS --copt -DEGL_NO_X11 --verbose_failures mediapipe/examples/desktop/autoflip:run_autoflip
Run command: LOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/autoflip/run_autoflip --calculator_graph_config_file=mediapipe/examples/desktop/autoflip/autoflip_graph.pbtxt --input_side_packets=input_video_path=/home/user/dev/mediapipe/life_at_google.mp4,output_video_path=/home/user/dev/mediapipe/life_at_google_out.mp4,aspect_ratio=1:1
^ This is basically the same question as in #2915
Hi @peternaf, MediaPipe Python package only contains CPU graphs. If you need to run any GPU graphs, see https://github.com/google/mediapipe/issues/1651 (comment).
Hi @sureshdagooglecom ,
Thanks for getting back to me.
I am not trying to run the python package (I just added the python installs because the issue template asks for it)
I am trying to run the Autoflip example and have it use the GPU. Any guidance on how to achieve this?
Hi @peternaf , MEDIAPIPE_DISABLE_GPU = 1 will disable the GPU support. Did you see any error while building Autoflip with GPU ?
Hi @sureshdagooglecom
As you can see in the mentioned build command I did not use the MEDIAPIPE_DISABLE_GPU = 1 flag.
The build command mentioned above worked without errors, but when running AutoFlip - I did not see it utilize the GPU
Hi @peternaf , Could you please share any logs w.r.t above issue.
Hi @sureshdagooglecom As mentioned - the code is running and the logs are the regular run logs (exactly the same log I see if I run AutoFlip with GPU mode disabled) and nvidia-smi is showing 0 GPU utilization even though I am compiling and running in GPU mode.
If you run AutoFlip just like it shows in the example website page - you will see the same log messages I see.
So, it is hard for me to understand what exact log you are looking for that could give a clue as to how to solve this.
If logs are required - please point me to exactly what is needed.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Still looking for solution
Hi @peternaf , 1)When you are trying on CPU graphs ,is it working? 2) GPU for inference or for rendering or both?
Hi @sureshdagooglecom
- Yes
- For rendering
@peternaf Were you able to successfully build AutoFlip with GPU support?
@peternaf Were you able to successfully build AutoFlip with GPU support?
Nope :/
@peternaf did you come up with any solution to fix your problem? I'm issuing the same problem at the moment.
@MayerMax no unfortunately
Hello @peternaf, We are ending support for these MediaPipe Legacy Solutions, but upgrading the others. However, the libraries, documentation, and source code for all the MediapPipe Legacy Solutions will continue to be available in our GitHub repository and through library distribution services, such as Maven and NPM.
You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.