Skip to content

Instantly share code, notes, and snippets.

View beaufortfrancois's full-sized avatar
🏠
Working from home

François Beaufort beaufortfrancois

🏠
Working from home
View GitHub Profile
@beaufortfrancois
beaufortfrancois / headless-chrome-webgpu.ipynb
Last active April 13, 2025 09:23
Supercharge Web AI model testing: WebGPU, WebGL, and Headless Chrome
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@beaufortfrancois
beaufortfrancois / background.js
Created January 17, 2024 15:18
WebGPU Chrome Extension
chrome.action.onClicked.addListener(async () => {
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();
const canvas = new OffscreenCanvas(256, 256);
const context = canvas.getContext("webgpu");
const format = navigator.gpu.getPreferredCanvasFormat();
context.configure({ device, format });
const code = `