Skip to main content

Overview

Hyperscape includes WebGPU diagnostics and preflight testing to detect GPU initialization issues early, especially on remote GPU servers (Vast.ai). These tools were added in commit d5c6884 (February 28, 2026). Purpose:
  • Extract chrome://gpu information at startup for debugging
  • Detect WebGPU initialization hangs before loading heavy game content
  • Provide actionable debugging info when WebGPU fails on remote servers

WebGPU Diagnostics

captureGpuDiagnostics()

Extracts GPU information from Chrome’s internal chrome://gpu page. Location: packages/server/scripts/stream-to-rtmp.ts Implementation:
Output Example:
When to Use:
  • Debugging WebGPU initialization failures
  • Verifying GPU driver configuration
  • Checking ANGLE backend selection
  • Identifying GPU feature support

WebGPU Preflight Test

testWebGpuInit()

Runs a lightweight WebGPU initialization test on a blank page before loading the game. Location: packages/server/scripts/stream-to-rtmp.ts Implementation:
Test Flow:
  1. Navigate to about:blank (minimal page, fast load)
  2. Check navigator.gpu availability
  3. Request WebGPU adapter
  4. Create WebGPU device
  5. Destroy device (cleanup)
  6. Return success/failure
Benefits:
  • Detects WebGPU hangs before loading heavy game content
  • Fails fast if WebGPU unavailable
  • Provides specific error messages for debugging
  • Runs on minimal page (no asset loading overhead)
Failure Scenarios:
  • navigator.gpu not available (browser doesn’t support WebGPU)
  • No adapter found (GPU driver issue)
  • Device creation fails (GPU initialization hang)
  • Timeout (WebGPU initialization blocking)

Integration with Streaming

Startup Sequence

The diagnostics run during browser setup:
Why This Order:
  1. Diagnostics first - Capture GPU info before any WebGPU usage
  2. Preflight test - Detect hangs on minimal page
  3. Game load - Only load heavy content if WebGPU works

Probe Timeout Handling

5-Second Timeout

The streaming system includes a 5-second timeout on probe evaluate calls to prevent hanging (commit cb0aaa9):
Why This Matters:
  • WebGPU initialization can block JavaScript execution
  • Without timeout, probe hangs indefinitely
  • 5s timeout allows detection of unresponsive browser
  • Prevents deployment from hanging forever

Consecutive Timeout Handling

After 5 consecutive probe timeouts, the system proceeds with capture anyway (commit 432ff84):
Rationale:
  • When browser page isn’t responding to JS (e.g., WebGPU taking all resources)
  • Skip readiness check and proceed with CDP capture
  • Stream will start even if we can’t verify canvas presence
  • Better than hanging forever waiting for probe response

Troubleshooting

WebGPU Initialization Hangs

Symptoms:
  • Browser page loads but JavaScript doesn’t execute
  • Probe timeouts every attempt
  • No canvas element detected
  • Stream shows black frames
Diagnosis:
Common Causes:
  1. GPU driver issue - Update NVIDIA drivers
  2. Vulkan ICD missing - Install vulkan-tools and mesa-vulkan-drivers
  3. Display server not running - Check echo $DISPLAY and xdpyinfo
  4. Headless mode - WebGPU requires display (Xorg or Xvfb)
Solutions:

GPU Diagnostics Show Software Rendering

Symptoms:
Causes:
  • Chrome launched with --disable-gpu
  • No display server (headless mode)
  • GPU drivers not installed
  • DRM/DRI devices not accessible
Solutions:

Preflight Test Fails

Symptoms:
Diagnosis:
  • GPU not accessible to Chrome
  • Vulkan backend not working
  • ANGLE backend misconfigured
Solutions:

Environment Variables

Diagnostic Configuration

Deprecated Variables


Logging

GPU Diagnostics Log Format

Preflight Test Log Format

Or on failure:

Probe Timeout Log Format


Deployment Guide

Vast.ai deployment with GPU configuration

Troubleshooting

Common issues and solutions

Streaming Setup

RTMP streaming configuration

WebGPU Requirements

Browser and GPU requirements for WebGPU