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 internalchrome://gpu page.
Location: packages/server/scripts/stream-to-rtmp.ts
Implementation:
- 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:
- Navigate to
about:blank(minimal page, fast load) - Check
navigator.gpuavailability - Request WebGPU adapter
- Create WebGPU device
- Destroy device (cleanup)
- Return success/failure
- 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)
navigator.gpunot 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:- Diagnostics first - Capture GPU info before any WebGPU usage
- Preflight test - Detect hangs on minimal page
- 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):- 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):- 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
- GPU driver issue - Update NVIDIA drivers
- Vulkan ICD missing - Install vulkan-tools and mesa-vulkan-drivers
- Display server not running - Check
echo $DISPLAYandxdpyinfo - Headless mode - WebGPU requires display (Xorg or Xvfb)
GPU Diagnostics Show Software Rendering
Symptoms:- Chrome launched with
--disable-gpu - No display server (headless mode)
- GPU drivers not installed
- DRM/DRI devices not accessible
Preflight Test Fails
Symptoms:- GPU not accessible to Chrome
- Vulkan backend not working
- ANGLE backend misconfigured