#20845: feat(browser): Add GPU configuration support for headless Chrome
agents
size: XS
Cluster:
Browser Enhancements and Fixes
## Summary
Adds `browser.gpuEnabled` configuration option to enable GPU hardware acceleration in headless Chrome for improved browser automation performance.
## Problem
OpenClaw currently hardcodes `--disable-gpu` when running Chrome in headless mode, forcing all rendering to CPU-only software mode. This prevents GPU acceleration even when GPU devices (`/dev/dri/*`) are available in the container.
**Impact:**
- Slower screenshot/page rendering (especially charts, SVG, Canvas)
- Higher CPU usage during browser automation
- Poor performance for WebGL/WebGPU content
- No hardware video decode
**Use cases blocked:**
- Autonomous testing of React/Vue components with complex rendering
- Screenshot-based UI validation workflows
- Browser automation of data visualization tools (charts, dashboards)
- Testing WebGL/Canvas-heavy applications
## Solution
Add a new config option `browser.gpuEnabled` (default: `false`) that when set to `true`:
- Prevents the `--disable-gpu` flag
- Adds `--enable-gpu`, `--use-angle=vulkan`, and `--enable-features=Vulkan` flags
- Enables hardware-accelerated rendering in headless mode
**Benefits:**
- **Faster rendering:** Hardware-accelerated canvas, compositing, and rasterization
- **Lower CPU usage:** Offload rendering work to GPU
- **Better compatibility:** WebGL/WebGPU content works properly
- **Autonomous testing:** Enable GPU-dependent UI tests in agent workflows
- **Screenshot quality:** Improved rendering of complex visualizations
## Use Case: Autonomous Testing
This feature is particularly valuable for agent-driven browser automation:
```json
{
"browser": {
"headless": true,
"gpuEnabled": true
}
}
```
**Example scenarios:**
- Agent takes screenshots of data visualizations and validates chart rendering
- Autonomous testing of React component libraries with complex animations
- Browser-based UI regression testing in CI/CD pipelines
- Testing WebGL-based data exploration tools
## Changes
- Added `gpuEnabled?: boolean` to `BrowserConfig` type
- Updated Zod schema to include the new field
- Modified browser launch logic in `chrome.ts` to conditionally add GPU flags
- Updated `ResolvedBrowserConfig` type and resolution logic
- Fixed test mocks and sandbox config to include `gpuEnabled: false`
## Configuration Example
```json
{
"browser": {
"headless": true,
"gpuEnabled": true
}
}
```
**Requirements:**
- GPU devices must be available in the container (e.g., `/dev/dri/renderD128`)
- Mesa drivers or equivalent GPU drivers installed
- Not recommended for environments without GPU access (will fail or fall back)
## Testing
Verified on:
- **Platform:** Home Assistant OS (Debian container)
- **Hardware:** Intel NUC i7-1360P with Intel Iris Xe Graphics
- **GPU device:** `/dev/dri/renderD128` exposed to container
- **Result:** Hardware acceleration confirmed via `chrome://gpu`
**Before (gpuEnabled: false):**
- Canvas: Software only
- Compositing: Software only
- OpenGL: Disabled
**After (gpuEnabled: true):**
- Canvas: Hardware accelerated
- Compositing: Hardware accelerated
- OpenGL: Enabled
- Rasterization: Hardware accelerated on all pages
- WebGL: Hardware accelerated
- WebGPU: Hardware accelerated
## Backward Compatibility
Default is `false` to maintain existing behavior. No breaking changes.
Most Similar PRs
#15690: feat(browser): add browser.args config field for custom Chrome laun...
by lailoo · 2026-02-13
68.7%
#14944: fix(browser): prefer openclaw profile in headless/noSandbox environ...
by BenediktSchackenberg · 2026-02-12
64.3%
#15304: feat(browser): add browser-use no-relay profile driver
by rajanrengasamy · 2026-02-13
62.7%
#20578: feat(browser): add proxy configuration option
by illusivejosiah · 2026-02-19
60.7%
#22952: fix(browser): suggest remote profile when local Chrome is not insta...
by dashed · 2026-02-21
60.3%
#19823: fix(browser): stability improvements for headless Chrome
by Milofax · 2026-02-18
58.7%
#6193: fix(browser): default to openclaw profile instead of chrome extensi...
by mikezaoldyeck · 2026-02-01
58.0%
#11692: feat: add standalone browser CLI for Linux users
by shipitirl · 2026-02-08
57.8%
#7157: docs(browser): recommend openclaw managed profile as default
by AkashaBot · 2026-02-02
57.1%
#13568: Fix browser (OpenClaw-managed) launch fail by binding remote debugg...
by singlag · 2026-02-10
57.0%