Skip to content

Repository files navigation

AudioCraft Docker with CUDA Support

This project provides Dockerfiles for running Meta's AudioCraft (MusicGen) with different CUDA versions (12.9, 12.8, 12.4, and 12.1). This repository was developed through collaboration with Claude 3.5 Sonnet (Anthropic) to extend the original CUDA 11.8 implementation, which was independently created by the repository owner.

📺 Resources & Documentation

🌟 Features

  • Support for latest CUDA versions (13.2, 12.9, 12.8, 12.4, 12.1)
  • Optimized dependency management
  • Ready-to-use Docker configurations
  • Gradio web interface for easy interaction
  • Detailed documentation and testing guidelines

🚀 Quick Start

# Build the Docker image (Choose your CUDA version)
docker build -f Dockerfile.cuda129 -t audiocraft:cuda129 .

# Run the container
docker run --gpus all -p 7860:7860 audiocraft:cuda129

Then open your browser and navigate to http://localhost:7860

📦 Supported Versions

CUDA 13.2

  • Uses PyTorch nightly builds for CUDA 13.2
  • Optimized for newest NVIDIA GPUs
  • CI-verified (build + basic import test)
  • Dockerfile.cuda132

CUDA 12.9

  • Latest CUDA support
  • Uses PyTorch 2.9.0 nightly builds (development version)
  • Optimized for newest NVIDIA GPUs
  • Dockerfile.cuda129

CUDA 12.8

  • Latest stable CUDA support
  • Uses PyTorch 2.7.0 stable
  • Recommended for production use
  • Dockerfile.cuda128

CUDA 12.4

  • Latest CUDA support
  • Uses PyTorch 2.4.0
  • Optimized for newer NVIDIA GPUs
  • Dockerfile.cuda124

CUDA 12.1

🛠️ Requirements

  • Docker
  • NVIDIA GPU with appropriate CUDA support
  • nvidia-docker2
  • At least 8GB GPU memory recommended

🎵 Usage Examples

Test your installation with these prompts:

"A gentle piano melody with soft strings in the background, calm and peaceful"
"Electronic dance music with a strong beat, synthesizer leads"
"Jazz quartet with acoustic bass, piano, drums, and saxophone"

Configuration options:

  • Duration: Up to 120 seconds (maximum length)
  • Temperature: 0.6-1.0 (recommended)
  • Guidance scale: 3.0 (default)

Note: While longer generations (up to 120 seconds) are possible, they require more GPU memory and processing time. For testing, starting with shorter durations (30-60 seconds) is recommended.

🤖 Development Credits

This project represents a collaborative effort:

  • Initial CUDA 11.8 implementation: Repository owner
  • CUDA 12.1 & 12.4 implementations: Developed in collaboration with Claude 3.5 Sonnet
  • Video tutorials and documentation: Repository owner

The AI collaboration provided:

  • Dockerfile optimization
  • Dependency resolution strategies
  • Testing methodologies
  • Documentation structure

🔍 Technical Details

The project addresses several technical challenges:

  • CUDA version compatibility management
  • PyTorch dependency resolution
  • Binary compatibility across versions
  • Optimal container configuration

Implementation Notes

  • CUDA 12.4 support includes some 12.1 binaries due to backward compatibility
  • Careful consideration of dependency versions for stability
  • Optimized for both performance and reliability

📚 Dependencies

Core components:

  • Python 3.11+ (varies by CUDA version)
  • PyTorch (version varies by CUDA)
  • AudioCraft (Meta's MusicGen)
  • Various audio processing libraries

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

✨ Acknowledgments

📞 Support

If you encounter any issues or have questions:

  1. Check the Issues section
  2. Create a new issue with detailed information
  3. Reference the blog post or YouTube video for additional context
  4. Join our discussions

About

Docker images for Meta's AudioCraft with CUDA 12.1-13.2 support. Multiple CUDA versions for MusicGen inference with Gradio interface.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors