This guide will help you set up the AI Avatar Video application for production use with AMD GPU support.
- Python 3.10+
- AMD GPU with ROCm support (preferred) or NVIDIA GPU with CUDA
- At least 8GB RAM
- Sufficient disk space for dependencies and generated videos
We provide multiple setup scripts depending on your needs:
To quickly test if the application works with basic dependencies:
./simple_setup.shThis will:
- Create a virtual environment
- Install all required dependencies
- Start a minimal test server on an available port
- Let you check GPU detection at http://localhost:PORT/gpu/info
For a production-ready setup:
./prod_setup.shThis will:
- Install all required dependencies
- Configure the application for production
- Start the server using Gunicorn for better performance
Add --dev flag to run in development mode with auto-reload:
./prod_setup.sh --devTo check if AMD GPU detection is working properly:
source venv/bin/activate
export PREFER_AMD_GPU=true
python check_gpu.pyPORT: Set a specific port (default: 8080)PREFER_AMD_GPU: Set to "true" to prefer AMD GPU over NVIDIA (default: true)LOG_LEVEL: Set logging level (default: INFO)ALLOWED_ORIGINS: Comma-separated list of allowed origins for CORS
Example:
PORT=8888 PREFER_AMD_GPU=true ./prod_setup.shIf you encounter dependency conflicts, try:
# Clean up environment
rm -rf venv
# Run setup with cleaned environment
./simple_setup.shThe setup scripts will automatically find an available port. If you want to use a specific port:
PORT=9000 ./prod_setup.shMake sure ROCm is properly installed for AMD GPUs:
# Check if ROCm is installed
rocm-smi
# Check if PyTorch can see the GPU
python -c "import torch; print(torch.version.hip); print('AMD GPU available:', torch.version.hip != '')"For more detailed GPU info:
python check_gpu.py