Skip to content

Latest commit

 

History

History
108 lines (74 loc) · 2.21 KB

File metadata and controls

108 lines (74 loc) · 2.21 KB

AI Avatar Video - Production Setup Guide

This guide will help you set up the AI Avatar Video application for production use with AMD GPU support.

System Requirements

  • 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

Setup Options

We provide multiple setup scripts depending on your needs:

1. Quick Setup (Minimal Test Server)

To quickly test if the application works with basic dependencies:

./simple_setup.sh

This 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

2. Production Setup

For a production-ready setup:

./prod_setup.sh

This 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 --dev

3. Check GPU Detection

To check if AMD GPU detection is working properly:

source venv/bin/activate
export PREFER_AMD_GPU=true
python check_gpu.py

Environment Variables

  • PORT: 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.sh

Troubleshooting

Dependency Issues

If you encounter dependency conflicts, try:

# Clean up environment
rm -rf venv
# Run setup with cleaned environment
./simple_setup.sh

Port Already in Use

The setup scripts will automatically find an available port. If you want to use a specific port:

PORT=9000 ./prod_setup.sh

GPU Not Detected

Make 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