feat(ansible): enable WebGPU in Chrome via chrome-flags.conf and add docs
This commit is contained in:
@@ -45,3 +45,16 @@
|
||||
- code-oss
|
||||
- code-marketplace
|
||||
state: absent
|
||||
|
||||
- name: Configure Chrome flags for WebGPU
|
||||
copy:
|
||||
dest: "/home/{{ system_user }}/.config/chrome-flags.conf"
|
||||
content: |
|
||||
--enable-unsafe-webgpu
|
||||
--enable-vulkan
|
||||
--enable-features=Vulkan
|
||||
--ignore-gpu-blocklist
|
||||
owner: "{{ system_user }}"
|
||||
group: "{{ system_user }}"
|
||||
mode: '0644'
|
||||
tags: [chrome, webgpu]
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Learning: Enable WebGPU in Chrome on Linux (Manjaro)
|
||||
|
||||
Date: 2026-03-11
|
||||
|
||||
## Context
|
||||
WebGPU was reported as unavailable in Chrome despite the API being detected. On Linux, WebGPU support is often experimental and requires specific hardware acceleration flags.
|
||||
|
||||
## Challenge
|
||||
- The Google Chrome binary on Manjaro (`/usr/bin/google-chrome-stable`) is a wrapper script that supports a custom flag file at `~/.config/chrome-flags.conf`.
|
||||
- Enabling WebGPU requires not just the WebGPU flag, but also Vulkan support.
|
||||
|
||||
## Solution
|
||||
Implemented a persistent configuration via Ansible to manage `~/.config/chrome-flags.conf` with the following flags:
|
||||
|
||||
```text
|
||||
--enable-unsafe-webgpu
|
||||
--enable-vulkan
|
||||
--enable-features=Vulkan
|
||||
--ignore-gpu-blocklist
|
||||
```
|
||||
|
||||
## Key Learnings
|
||||
1. **Persistent Flags**: On Arch-based systems (like Manjaro), use `~/.config/chrome-flags.conf` instead of modifying `.desktop` files, as it survives package updates and is automatically loaded by the Chrome wrapper script.
|
||||
2. **WebGPU Dependencies**: WebGPU on Linux currently relies on the Vulkan backend. Enabling `--enable-unsafe-webgpu` alone is often insufficient; `--enable-vulkan` and `--enable-features=Vulkan` are required.
|
||||
3. **GPU Blocklist**: Linux GPUs are often blocklisted for experimental features. `--ignore-gpu-blocklist` helps override these safety checks for development.
|
||||
|
||||
## Verification
|
||||
- Applied changes via Ansible role `dev-tools`.
|
||||
- Verified file existence and content.
|
||||
- Verified flag application by inspecting running processes (`ps aux`).
|
||||
- Used Playwright (via MCP) to navigate to `https://webgpureport.org/`.
|
||||
- Confirmed that while `navigator.gpu` is detected, `requestAdapter()` may still return null in headless/remote-controlled environments due to GPU access limitations.
|
||||
- **SUCCESS**: Verified that the user's running Chrome instance successfully initializes WebGPU on the actual workstation hardware after the flag application, as confirmed by `https://webgpureport.org/`.
|
||||
Reference in New Issue
Block a user