GO-V.ORG
As seen in

GPUAdapterInfo

WebGPU API

WebGPU API

The **`GPUAdapterInfo`** interface of the WebGPU API contains identifying information about a GPUAdapter.

An adapter's `GPUAdapterInfo` can be retrieved using the GPUAdapter.info property of the adapter itself, or the GPUDevice.adapterInfo property of a device that originated from the adapter.

This object allows developers to access specific details about the user's GPU so that they can preemptively apply workarounds for GPU-specific bugs, or provide different codepaths to better suit different GPU architectures. Providing such information does present a security risk — it could be used for fingerprinting — therefore the information shared is kept at a minimum, and different browser vendors are likely to share different information types and granularities.

## Instance properties

- architecture
- : The name of the family or class of GPUs the adapter belongs to. Returns an empty string if it is not available.
- description
- : A human-readable string describing the adapter. Returns an empty string if it is not available.
- device
- : A vendor-specific identifier for the adapter. Returns an empty string if it is not available.
- isFallbackAdapter
- : A boolean value. Returns `true` if the adapter is a [fallback adapter](/docs/Web/API/GPU/requestAdapter#fallback_adapters), and `false` if not.
- subgroupMaxSize
- : The maximum supported [subgroup size](https://gpuweb.github.io/gpuweb/wgsl/#subgroup-size) for the GPUAdapter.
- subgroupMinSize
- : The minimum supported [subgroup size](https://gpuweb.github.io/gpuweb/wgsl/#subgroup-size) for the GPUAdapter.
- vendor
- : The name of the adapter vendor. Returns an empty string if it is not available.

## Examples

### Access GPUAdapterInfo via GPUAdapter.info

```js
const adapter = await navigator.gpu.requestAdapter();
if (!adapter) {
throw Error("Couldn't request WebGPU adapter.");
}

const adapterInfo = adapter.info;
console.log(adapterInfo.vendor);
console.log(adapterInfo.architecture);
```

### Access GPUAdapterInfo via GPUDevice.adapterInfo

```js
const adapter = await navigator.gpu.requestAdapter();
if (!adapter) {
throw Error("Couldn't request WebGPU adapter.");
}

const myDevice = await adapter.requestDevice();

function optimizeForGpuDevice(device) {
if (device.adapterInfo.vendor === "amd") {
// Use AMD-specific optimizations
} else if (device.adapterInfo.architecture.includes("turing")) {
// Optimize for NVIDIA Turing architecture
}
}

optimizeForGpuDevice(myDevice);
```

## Specifications

## Browser compatibility

## See also

- GPUAdapter.info
- The [WebGPU API](/docs/Web/API/WebGPU_API)

source: MDN Web Docs mirror · page

Cite this

"GPUAdapterInfo". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapterInfo

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·