Spaces:
Running
Issues with mpi4py Installation During Docker Build for GPU-Optimized Space & Looking for Face Swap Spaces with Powerful GPU
Hello everyone,
I am currently working on building a Docker image for a Hugging Face Space that is GPU-optimized, using Optimum-NVIDIA and ONNX Runtime. My goal is to copy an existing Space that runs Face Swap (FCE Swap) but take advantage of a more powerful GPU for better performance.
Problem:
The build process fails when installing dependencies listed in the requirements.txt, specifically with the package mpi4py. The error message is related to a missing MPI library (mpi.h), and it states: "Cannot compile MPI programs. Check your configuration!!!"
Current Setup:
Base image: NVIDIA CUDA 12.3.2 on Ubuntu 22.04.
Installed essential libraries such as Python build tools and other dependencies.
Used pyenv to install Python 3.10.
Attempting to install Python packages including onnxruntime-gpu, optimum-nvidia, insightface, gfpgan, and the necessary CUDA libraries.
Error Details:
The issue arises when installing mpi4py, which requires the MPI library (specifically mpi.h for compilation) that is not found in the environment. The build process fails with the following error:
mathematica
Code kopieren
Cannot compile MPI programs. Check your configuration!!!
Attempted Solution:
To resolve this, I added the following MPI development libraries to the Dockerfile:
openmpi-bin
openmpi-common
libopenmpi-dev
These changes ensure that the required MPI libraries are present before attempting to install mpi4py. However, I haven't yet tested this updated Dockerfile.
Next Steps: I'm looking for advice on whether the inclusion of these MPI packages is sufficient or if there are additional steps or alternative approaches to take. The goal is to successfully build the image with mpi4py and deploy the Space using a more powerful GPU.
Additionally, I am looking for existing Hugging Face Spaces that are set up for Face Swap (FCE Swap) but are configured to run on a more powerful GPU. Does anyone know where I could find such spaces that can be copied or adapted?
Any suggestions on troubleshooting the build or pointers to where I can find GPU-optimized Face Swap spaces would be greatly appreciated!
Thank you!
I can find a number of spaces for Face Swap, but it looks like they are using a non-FCE Swap library.
https://huggingface.co/spaces?sort=trending&search=face+swap
https://huggingface.co/spaces/tuan2308/face-swap
https://huggingface.co/spaces/guardiancc/video-face-swapper-gpu
Thank you for the links! I can find several spaces for Face Swap, but most seem to be using a non-FCE Swap library.
To clarify, my use case isn't general face swapping but video face swap for long videos, specifically files between 150-400 MB and 10-40 minutes in length. I need a more powerful GPU to handle this because I've experienced frequent crashes on ZeroGPU, likely due to the size and length of the videos I'm processing. These crashes make it difficult to complete any face swapping on videos of this scale.
My main goal is to book a better GPU to process these larger video files without interruptions. Does anyone know of a solution that can handle such large videos or a space with a more powerful GPU setup for video face swapping, especially using FCE Swap?
Any help or pointers would be appreciated!