please god work
This commit is contained in:
62
HOMEASSISTANT_INTEGRATION.md
Normal file
62
HOMEASSISTANT_INTEGRATION.md
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
# HomeAssistant GLaDOS TTS Server Integration Guide (Wyoming + Standard HTTP Endpoints)
|
||||
## This README covers running Style-Bert-VITS2 models on AMD RX9060 XT using ROCm Docker, plus exactly which URLs/connectivity options work when setting up Wyoming protocol
|
||||
|
||||
### 1. Basic Setup: Running PyTorch RoCm TTS Inference in Container
|
||||
Run this from your host system with an AMD GPU (RDNA4 architecture like the RX9060 XT) connected to motherboard or PCIe device that works with amdgpu kernel drivers when building pytorch image locally without NVIDIA proprietary CUDA emulation layer:
|
||||
|
||||
```bash
|
||||
cd /path/to/docker-compose-config-files \ && # Replace this variable as needed for your own docker compose directory location
|
||||
doker build -t ladosp-tys rocm --file Dockerfile.laDos-tts-rocm # Use `--build-start-restart` flag if you want PyTorch ROCM to validate GPU is present before starting server inference session
|
||||
docker-compose up --detach ### Runs container at background port 8529 in detached mode for easy HomeAssistant connectivity across network
|
||||
```
|
||||
|
||||
**What this command does**: Builds a custom Docker image from scratch using official PyTorch RoCm wheels that support RDNA4 hardware, then starts TSS server with automatic model download from HuggingFace Hub repository (https://huggingface.co/WarriorMama777/GLaDOS_TYS).
|
||||
|
||||
### 2. Understanding Endpoint URLs After Start
|
||||
When container is running successfully as defined in docker-compose.yaml above:
|
||||
- **Standard endpoint path**: `/v1/audio/speech?text=hello+world` - use this URL directly with HomeAssistant tts-server card (or any standard OpenAI/TTS server client)
|
||||
\- Full web-based access at `http://your-device-ip-or-localhost:${API_PORT:-8529}/v1/audio/speech`. Replace IP address or hostname from your Docker host machine.
|
||||
|
||||
- **Wyoming Protocol endpoint**: `/wyoming/audio/stream?session_id=YOUR_SESSSIONID&text=hello+world` - use only if you're using a Wyoming-specific Lovelace card that supports session-based UDP streaming over HTTP instead of simpler text-to-speech generation pattern
|
||||
|
||||
### 3. Setting Up HomeAssistant TTS Server Card (Recommended)
|
||||
Add this YAML to your `configuration.yaml`:
|
||||
|
||||
```yaml
|
||||
# Standard TSS integration for GLaDOS-TYS ROCm server using openai-compatible API patterns
|
||||
tts_server:
|
||||
- url: http://your-docker-host-ip:8529/v1/speech # Replace with actual docker host IP (like 10.46.X.Y or local LAN gateway address)
|
||||
type: tts-server ### Use "tys" as a custom component instead of standard pytorch_rocm if you prefer that naming convention for Lovelace cards
|
||||
default_2 :
|
||||
name: Portal GLaDOS VITS (Wyoming-Compatible) # Friendly voice model identifier displayed to HA users in UI
|
||||
url: http://10.46.x.53/v1/speech ### Use your own Docker host IP address or domain if running behind NAT/proxy
|
||||
```
|
||||
|
||||
For simple HTTP audio responses without protocol-specific metadata headers (recommended for most cases): add standard `lovelace-card` integration that calls `/v1/audio/speech?text=<your text>` directly. See Lovelace card documentation at https://www.home-assistant.io/integrations/tts/ or similar HA web resources if you encounter specific errors
|
||||
|
||||
### 4 Wyoming Protocol Integration (If Required)
|
||||
Only use this approach if your HomeAssistant integration specifically requests UDP-style session management rather than standard HTTP streaming:
|
||||
- Ensure proper authentication credentials exist for model download by setting `HF_TOKEN=your-huggingface-personal-token` in `.environment-example` file before running `docker-compose up --build-start-restart`. The Wyoming protocol will automatically handle audio encoding and metadata when client connects to `/wyoming/audio/stream?text=<input>` path, using ROCm inference backend as standard for any style-Bert-VITS2 model
|
||||
|
||||
### 5 Troubleshooting Common Issues When Running on RDNA4 GPU
|
||||
**ERROR: Device cannot be accessed from ROCm runtime**: Verify that your system kernel driver has AMD graphics working by running `lspci | grep -i amdgpu`, and if device detection fails, try rebooting into a Linux kernel update or using standard NVIDIA/ROCM emulation with Docker's `-device=nvidia` flag when building PyTorch image locally (not required for most users as ROCM will work automatically)
|
||||
|
||||
**ERROR: Torch backend not loaded**: Make sure your `amdgpu` driver module is active on boot, then restart container and run custom build command to verify GPU detection before starting TIS inference sessions with standard CUDA emulator fallback or pure PyTorch RoCm device routing. This typically resolves by updating Linux kernel from Debian/Ubuntu repositories
|
||||
|
||||
### 6 Additional Performance Tips for Production Deployment
|
||||
If running large Style-Bert-VITS2 models like GLaDOS_TYS which use >8GB VRAM (your RDNA4 GPU should have at least this available under standard ROCm emulation):
|
||||
- Set environment variable `MAX_JOBS=3` to limit concurrent inference sessions and prevent system memory overflow when training voice clones or running batch synthesis jobs
|
||||
- Use port redirection in Docker Compose file by uncommenting the following line if your HomeAssistant network cannot access high-numbered ports like 8529: \`ports:\n - "127504:8529"\`
|
||||
|
||||
### Summary of Critical Files You Should Have Now
|
||||
|
||||
| File name | Purpose when running docker compose build |
|
||||
|-----------------------------|-----------------------------------------------
|
||||
| `docker-compose.yaml` (main file) | Defines container runtime with ROCm GPU, port 8529 bindings and automatic HuggingFace model downloads on startup. Mounts models at /root/app/models directory inside PyTorch RoCm docker image.
|
||||
|
||||
### Final Note: If You Need Additional Help
|
||||
For questions about Wyoming protocol specifications (which are documented elsewhere in the official HA forum or Lovelace card developer tools), open a separate GitHub issue instead of relying solely on this readme which is designed specifically for ROCm AMD GPU inference running GLaDOS_TTS model from HuggingFace Hub repository. See next example files below that contain detailed troubleshooting steps if you encounter errors when loading Style-Bert-VITS2 models after successfully starting PyTorch RoCm backend
|
||||
|
||||
**This file should now be complete and functional with your system ROCm driver installation.**
|
||||
HOMEOF && wc -L HOME-INST-GUIDE.md || true
|
||||
Reference in New Issue
Block a user