WebGPU Requirements
Hyperscape requires WebGPU for rendering. This document explains why, what’s required, and how to verify support.Why WebGPU is Required
TSL Shaders
All materials in Hyperscape use TSL (Three Shading Language), which is Three.js’s node-based shader system. TSL only works with the WebGPU rendering backend. Examples of TSL usage:- Terrain shaders (height-based blending, triplanar mapping)
- Water shaders (reflections, refractions, foam)
- Vegetation shaders (wind animation, LOD transitions)
- Post-processing (bloom, tone mapping, color grading)
- Impostor materials (octahedral impostors for distant objects)
No WebGL Fallback
BREAKING CHANGE (Commit 47782ed): All WebGL fallback code was removed. Removed:RendererFactory.ts- WebGL detection and fallback logicisWebGLForced,isWebGLFallbackForced,isWebGLFallbackAllowedflagsisWebGLAvailable,isOffscreenCanvasAvailable,canTransferCanvaschecksUniversalRenderertype (now onlyWebGPURenderer)forceWebGLanddisableWebGPUURL parametersSTREAM_CAPTURE_DISABLE_WEBGPUenvironment variableDUEL_FORCE_WEBGL_FALLBACKconfiguration option
- TSL shaders don’t compile to WebGL
- Maintaining two rendering paths was causing bugs
- WebGPU is now widely supported (Chrome 113+, Edge 113+, Safari 18+)
- Simplifies codebase and reduces maintenance burden
Browser Requirements
Desktop
| Browser | Minimum Version | Notes |
|---|---|---|
| Chrome | 113+ | ✅ Recommended |
| Edge | 113+ | ✅ Recommended |
| Safari | 18+ | ⚠️ Requires macOS 15+ |
| Firefox | Nightly | ⚠️ Behind flag, not recommended |
Mobile
| Platform | Browser | Notes |
|---|---|---|
| iOS | Safari 18+ | Requires iOS 18+ |
| Android | Chrome 113+ | Most Android devices |
Verification
Check your browser/GPU support at: webgpureport.org Or checkchrome://gpu in Chrome/Edge:
- Look for “WebGPU: Hardware accelerated”
- Verify “WebGPU Status” shows enabled features
Server/Streaming Requirements
GPU Hardware
Required:- NVIDIA GPU with Vulkan support
- CUDA capability 3.5+ (most GPUs from 2014+)
- Minimum 2GB VRAM (4GB+ recommended)
Software Stack
Required packages:Display Server Setup
Hyperscape streaming requires a display server (Xorg or Xvfb) for Chrome to access WebGPU.Option 1: Xorg with NVIDIA (Preferred)
Requirements:- DRI/DRM device access (
/dev/dri/card0) - NVIDIA X driver installed
/etc/X11/xorg-nvidia-headless.conf):
Option 2: Xvfb with NVIDIA Vulkan (Fallback)
When to use:- Container without DRM device access
- Xorg fails to initialize NVIDIA driver
- Xvfb provides X11 protocol (virtual framebuffer)
- Chrome uses NVIDIA GPU via ANGLE/Vulkan (not the framebuffer)
- CDP captures frames from Chrome’s internal GPU rendering
Vulkan Configuration
Force NVIDIA ICD (avoid Mesa conflicts):- Some containers have broken Mesa Vulkan ICDs
- Mesa ICDs can conflict with NVIDIA drivers
- Forcing NVIDIA-only ICD ensures consistent behavior
Chrome Configuration
Launch Arguments
Chrome must be launched with specific flags for WebGPU:Playwright Configuration
Troubleshooting
”WebGPU not supported” Error
Cause: Chrome cannot access WebGPU API Solutions:- Verify browser version:
google-chrome-unstable --version(should be 113+) - Check
chrome://gpu- WebGPU should show “Hardware accelerated” - Verify Vulkan works:
vulkaninfo --summary - Check display server:
xdpyinfo -display $DISPLAY - Verify
VK_ICD_FILENAMESis set correctly
Black Screen / No Rendering
Cause: WebGPU initialized but rendering failed Solutions:- Check browser console for WebGPU errors
- Verify shaders compiled: Look for TSL compilation errors
- Check GPU memory:
nvidia-smi(should have free VRAM) - Verify display server is using GPU:
glxinfo | grep renderer
Xorg Falls Back to Software Rendering
Symptoms:- Xorg starts but uses swrast (software rendering)
/var/log/Xorg.99.logshows “IGLX: Loaded and initialized swrast”
- Check NVIDIA driver is installed:
nvidia-smi - Verify DRI devices exist:
ls -la /dev/dri/ - Check Xorg config has correct BusID
- Review Xorg errors:
grep "(EE)" /var/log/Xorg.99.log - Try Xvfb fallback instead
Vulkan Initialization Failed
Symptoms:vulkaninfofails or shows no devices- Chrome shows “Vulkan: Disabled”
- Install Vulkan packages:
apt install mesa-vulkan-drivers vulkan-tools libvulkan1 - Verify ICD file exists:
ls -la /usr/share/vulkan/icd.d/nvidia_icd.json - Check ICD points to valid library:
cat /usr/share/vulkan/icd.d/nvidia_icd.json - Force NVIDIA ICD:
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
Deployment Checklist
Before deploying to a GPU server (Vast.ai, etc.):- NVIDIA GPU with Vulkan support
- NVIDIA drivers installed (
nvidia-smiworks) - Vulkan tools installed (
vulkaninfoworks) - X server packages installed (Xorg or Xvfb)
- Chrome Dev channel installed (
google-chrome-unstable) - Display server starts successfully (
xdpyinfo -display :99) - Vulkan ICD configured (
VK_ICD_FILENAMESset) - WebGPU works in Chrome (
chrome://gpushows hardware accelerated)
See Also
- CLAUDE.md - WebGPU development rules
- AGENTS.md - AI assistant guidance
- docs/vast-deployment.md - Vast.ai deployment with GPU setup
- docs/streaming-configuration.md - Streaming configuration reference
- scripts/deploy-vast.sh - Deployment script with GPU setup