-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.gpu-amd.yml
More file actions
109 lines (97 loc) · 3.33 KB
/
docker-compose.gpu-amd.yml
File metadata and controls
109 lines (97 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# MarchProxy AMD GPU Override Configuration
# Use with: docker-compose -f docker-compose.yml -f docker-compose.gpu-amd.yml up
# Requires: ROCm and AMD GPU drivers installed on host
version: '3.8'
services:
# RTMP Container with AMD GPU acceleration (ROCm)
proxy-rtmp-amd:
build:
context: ./proxy-rtmp
dockerfile: Dockerfile
target: amd
container_name: marchproxy-proxy-rtmp-amd
profiles:
- gpu-amd
- rtmp-amd
devices:
- /dev/kfd:/dev/kfd # Kernel Fusion Driver
- /dev/dri:/dev/dri # Direct Rendering Infrastructure
group_add:
- video
- render
environment:
# API Server connection
- API_SERVER_URL=http://api-server:8000
- CLUSTER_API_KEY=${CLUSTER_API_KEY:-default-api-key}
# gRPC server (ModuleService)
- GRPC_PORT=50054
- GRPC_BIND=0.0.0.0:50054
# Module configuration
- MODULE_TYPE=rtmp
- MODULE_NAME=${RTMP_AMD_NAME:-proxy-rtmp-amd-1}
- RTMP_PORT=1935
- ADMIN_PORT=7005
- LOG_LEVEL=${LOG_LEVEL:-info}
# AMD GPU configuration
- GPU_ENABLED=true
- GPU_TYPE=amd
- HSA_OVERRIDE_GFX_VERSION=${HSA_OVERRIDE_GFX_VERSION:-} # Set if needed for specific GPU
- ROCR_VISIBLE_DEVICES=${ROCR_VISIBLE_DEVICES:-0}
# FFmpeg AMD configuration
- FFMPEG_THREADS=${FFMPEG_THREADS:-8}
- TRANSCODE_PRESET=${TRANSCODE_PRESET:-medium}
- VIDEO_CODEC=h264_amf # AMD Media Framework encoder
- VIDEO_CODEC_HEVC=hevc_amf # AMD HEVC encoder
- HWACCEL=vaapi # Video Acceleration API
- HWACCEL_DEVICE=/dev/dri/renderD128
- VAAPI_DEVICE=/dev/dri/renderD128
# AMF encoding settings
- AMF_QUALITY=${AMF_QUALITY:-speed} # speed, balanced, quality
- AMF_USAGE=${AMF_USAGE:-transcoding} # transcoding, ultralowlatency, lowlatency
- AMF_PROFILE=${AMF_PROFILE:-main} # baseline, main, high
- AMF_RATE_CONTROL=${AMF_RATE_CONTROL:-vbr_latency} # cqp, cbr, vbr_latency, vbr_peak
- AMF_BITRATE=${AMF_BITRATE:-5M}
# Output formats
- HLS_ENABLED=${HLS_ENABLED:-true}
- HLS_SEGMENT_DURATION=${HLS_SEGMENT_DURATION:-6}
- DASH_ENABLED=${DASH_ENABLED:-true}
- DASH_SEGMENT_DURATION=${DASH_SEGMENT_DURATION:-6}
# Multi-bitrate support
- MULTI_BITRATE_ENABLED=${MULTI_BITRATE_ENABLED:-true}
- BITRATES=${BITRATES:-1M,2M,5M,10M}
- RESOLUTIONS=${RESOLUTIONS:-640x360,1280x720,1920x1080,3840x2160}
# Rate limiting per stream
- RATE_LIMIT_ENABLED=${RTMP_RATE_LIMIT:-true}
- MAX_STREAMS=${MAX_STREAMS:-10}
# Observability
- JAEGER_ENABLED=${JAEGER_ENABLED:-true}
- JAEGER_HOST=jaeger
- JAEGER_PORT=6831
ports:
- "1935:1935" # RTMP
- "8081:8081" # HLS/DASH HTTP
- "7005:7005" # Admin/Metrics
- "50054:50054" # gRPC ModuleService
volumes:
- rtmp_streams:/streams
networks:
- marchproxy-internal
depends_on:
- api-server
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7005/healthz"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
labels:
- "service=marchproxy-proxy-rtmp"
- "component=proxy"
- "layer=video"
- "module=rtmp"
- "variant=amd"
- "gpu=true"
volumes:
rtmp_streams:
driver: local