async function init() {
if (!navigator.gpu) {
throw Error("WebGPU not supported.");
}
const adapter = await navigator.gpu.requestAdapter();
if (!adapter) {
throw Error("Couldn't request WebGPU adapter.");
}
const adapterInfo = await adapter.requestAdapterInfo();
console.log(adapterInfo.vendor);
console.log(adapterInfo.architecture);
// …
}GPUAdapter: requestAdapterInfo() method / notebook
GPUAdapter: requestAdapterInfo() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.