Skip to main content

Overview

Hyperscape streaming requires hardware GPU rendering for WebGPU support. The game uses Three.js Shading Language (TSL) which compiles to WGSL and requires WebGPU—software rendering is not supported.
Software rendering (Xvfb, SwiftShader, Lavapipe) is NOT supported. WebGPU requires hardware GPU acceleration.

GPU Rendering Modes

The deployment system supports two GPU rendering modes, automatically detected based on container capabilities:

1. Xorg Mode (Preferred)

Requirements:
  • DRM/DRI device access (/dev/dri/card0 or similar)
  • NVIDIA GPU with working drivers
  • X server support
Advantages:
  • Full hardware GPU acceleration
  • Best performance
  • Lowest latency
  • Supports all WebGPU features
Configuration:
Xorg Setup: The deployment script automatically configures Xorg for headless GPU rendering:
Verification:

2. Headless EGL Mode (Fallback)

Requirements:
  • NVIDIA GPU with EGL support
  • No DRM/DRI device access required
  • Chrome’s new headless mode
Advantages:
  • Works in containers without DRM/DRI access
  • No X server required
  • Ideal for Vast.ai containers
  • Still uses hardware GPU via NVIDIA EGL
Configuration:
Chrome Flags:
Verification:

Automatic GPU Detection

The scripts/deploy-vast.sh script automatically detects and configures the best GPU rendering mode:

Environment Variables

GPU Rendering Configuration

Chrome Capture Configuration

System Requirements

NVIDIA Drivers

Required:
  • NVIDIA GPU (RTX 3060 Ti or better)
  • NVIDIA driver version 525+ (for Vulkan 1.3)
  • Vulkan ICD installed
Installation:

Xorg Dependencies (Xorg Mode)

Replace XXX with your NVIDIA driver version (e.g., 525, 535).

EGL Dependencies (Headless EGL Mode)

Chrome Dev Channel

WebGPU support requires Chrome Dev channel (google-chrome-unstable):
Playwright Configuration:

Vulkan Configuration

Force NVIDIA ICD

Vast.ai containers may have conflicting Mesa Vulkan ICDs. Force NVIDIA-only:
Why This Matters:
  • Mesa ICDs can conflict with NVIDIA drivers
  • Some Mesa ICDs are misconfigured (point to wrong libraries)
  • Forcing NVIDIA ICD ensures hardware Vulkan works correctly
Verification:

Vulkan Troubleshooting

Problem: vulkaninfo fails with “Cannot create Vulkan instance” Causes:
  1. NVIDIA driver not installed
  2. Vulkan ICD misconfigured
  3. Missing Vulkan libraries
Solutions:

Deployment Integration

ecosystem.config.cjs

The PM2 configuration automatically uses GPU rendering settings:

deploy-vast.sh

The deployment script handles GPU detection and configuration:

Troubleshooting

Black Screen in Stream

Symptom: Stream shows black screen instead of game Diagnosis:
Solutions: If Xorg mode:
If headless EGL mode:

WebGPU Not Available

Symptom: Chrome reports “WebGPU not supported” Diagnosis:
Common Causes:
  1. Vulkan ICD not working:
  2. Missing Chrome flags:
  3. Wrong GL backend:

Vulkan Instance Creation Fails

Symptom: vulkaninfo fails with “Cannot create Vulkan instance” Causes:
  • Conflicting Mesa ICDs
  • Broken NVIDIA ICD configuration
  • Missing Vulkan libraries
Solutions:

DRI Devices Not Available

Symptom: /dev/dri/ directory doesn’t exist or is empty Cause: Container doesn’t have DRM/DRI device access (common on Vast.ai) Solution: Use headless EGL mode instead of Xorg:
Why This Works:
  • EGL doesn’t require DRM/DRI devices
  • Chrome’s new headless mode supports EGL
  • NVIDIA EGL provides hardware GPU access
  • WebGPU works via Vulkan over EGL

Performance Optimization

GPU Memory

Monitor GPU memory usage:
Optimization:

CPU Usage

GPU rendering offloads work from CPU:
Expected CPU usage:
  • Xorg mode: 50-80% (encoding only)
  • Headless EGL mode: 60-90% (encoding + EGL overhead)
  • Software rendering: 200-300% (NOT SUPPORTED)

Tested Configurations

Commit History

Recent GPU rendering improvements:
  • dd649da (Feb 27, 2026): Fix headless mode flag passing (args vs option)
  • e51a332 (Feb 27, 2026): Add headless EGL mode for containers without DRM
  • 30bdaf0 (Feb 27, 2026): Require NVIDIA Xorg, no software rendering fallback
  • 5fe4a18 (Feb 27, 2026): Add robust Xorg/Xvfb fallback handling
  • 263bfc5 (Feb 27, 2026): Use Xorg instead of Xvfb for NVIDIA GPU rendering
  • 89b78e3 (Feb 27, 2026): Use NVIDIA hardware Vulkan instead of SwiftShader
  • 54836200 (Feb 27, 2026): Enable SwiftShader for WebGPU (deprecated)
  • ba1cf0a (Feb 27, 2026): Use Lavapipe software Vulkan (deprecated)
  • ef8033c (Feb 27, 2026): Use SwiftShader and WebGL fallback (deprecated)