Skip to main content

GPU Streaming

Hyperscape supports GPU-accelerated streaming to multiple platforms simultaneously using WebGPU rendering and hardware H.264 encoding.

Overview

The streaming pipeline captures frames directly from Chrome’s compositor via CDP (Chrome DevTools Protocol) and pipes them to FFmpeg for multi-platform RTMP distribution. Supported platforms:
  • Twitch (RTMPS)
  • Kick (RTMPS)
  • X/Twitter (RTMP)
  • YouTube (disabled by default)

Requirements

Hardware

  • NVIDIA GPU with Vulkan support (WebGPU required)
  • Minimum 8GB VRAM recommended
  • CUDA drivers installed

Software

  • Ubuntu 20.04+ or Debian 11+
  • NVIDIA drivers
  • Vulkan ICD
  • Xorg or Xvfb display server
  • PulseAudio for audio capture
  • FFmpeg with H.264 support
  • Chrome Dev channel (google-chrome-unstable)
  • Bun runtime

Quick Start

1. Set Stream Keys

Create .env file with your stream keys:

2. Deploy to Vast.ai

The deployment is automated via GitHub Actions:

3. Monitor Stream

Architecture

Capture Pipeline

GPU Rendering Modes

The deploy script tries multiple modes in order:
  1. Xorg with NVIDIA (preferred):
    • Direct GPU access
    • Requires DRI/DRM devices
    • Best performance
  2. Xvfb with NVIDIA Vulkan (fallback):
    • Virtual framebuffer
    • GPU rendering via ANGLE/Vulkan
    • Works without DRM access
  3. Headless mode: NOT SUPPORTED
    • WebGPU requires display server
    • Deployment fails if neither Xorg nor Xvfb works

Configuration

Video Settings

Audio Settings

Encoding Settings

Monitoring

PM2 Commands

RTMP Status

The bridge writes status every 2 seconds:
Status fields:

Health Checks

Troubleshooting

GPU Not Accessible

Symptom: nvidia-smi fails Solution:

Display Server Fails

Symptom: Xorg/Xvfb won’t start Solution:

PulseAudio Not Running

Symptom: No audio in stream Solution:

Black Screen

Symptom: Stream shows black screen Solution:

Stream Not Starting

Symptom: PM2 running but no stream Solution:

Performance Optimization

Reduce CPU Usage

Reduce Memory Usage

Reduce Bandwidth

Advanced Configuration

Custom RTMP Destinations

Add custom destinations via JSON:

Production Client Build

Use pre-built client for faster page loads:
This serves the pre-built client via vite preview instead of the slow JIT dev server, preventing browser timeout issues during Vite’s on-demand compilation.

Recovery Settings

Configure automatic recovery from capture failures: