GPUAdapter: requestDevice() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The requestDevice() method of the GPUAdapter interface returns a Promise that fulfills with a GPUDevice object, which is the primary interface for communicating with the GPU.

Syntax

js
requestDevice()
requestDevice(descriptor)

Parameters

descriptor Optional

An object containing the following properties:

defaultQueue Optional

An object that provides information for the device's default GPUQueue (as returned by GPUDevice.queue). This object has a single property — label — which provides the default queue with a label value. If no value is provided, this defaults to an empty object, and the default queue's label will be an empty string.

label Optional

A string providing a label that can be used to identify the GPUDevice, for example in GPUError messages or console warnings.

requiredFeatures Optional

An array of strings representing additional functionality that you want supported by the returned GPUDevice. The requestDevice() call will fail if the GPUAdapter cannot provide these features. See GPUSupportedFeatures for a full list of possible features. This defaults to an empty array if no value is provided.

requiredLimits Optional

An object containing properties representing the limits that you want supported by the returned GPUDevice. The requestDevice() call will fail if the GPUAdapter cannot provide these limits. Each key with a non-undefined value must be the name of a member of GPUSupportedLimits.

Note: You can request unknown limits when requesting a GPU device without causing an error. Such limits will be undefined. This is useful because it makes WebGPU code less brittle — a codebase won't stop working because a limit no longer exists in the adapter.

Not all features and limits will be available to WebGPU in all browsers that support it, even if they are supported by the underlying hardware. See the features and limits pages for more information.

Return value

A Promise that fulfills with a GPUDevice object instance.

If you make a duplicate call, i.e., call requestDevice() on a GPUAdapter that requestDevice() was already called on, the promise rejects with an OperationError because the associated GPUAdapter is consumed when a GPUDevice is created.

Exceptions

OperationError DOMException

The promise rejects with an OperationError if either:

  • The limits included in the requiredLimits property are not supported by the GPUAdapter, either because they are not valid limits, or because their values are higher than the adapter's values for those limits.
  • The GPUAdapter has been consumed by having requestDevice() called on it previously.
TypeError DOMException

The promise rejects with a TypeError if the features included in the requiredFeatures property are not supported by the GPUAdapter.

Examples

Basic example

js
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 device = await adapter.requestDevice();

  // …
}

Requesting specific features and limits

In the following code we:

  1. Check whether a GPUAdapter has the texture-compression-astc feature available. If so, we push it into the array of requiredFeatures.
  2. Query the GPUAdapter.limits value of maxBindGroups to see if it is equal to or greater than 6. Our theoretical example app ideally needs 6 bind groups, so if the returned value is >= 6, we add a maximum limit of 6 to the requiredLimits object.
  3. Request a device with those feature and limit requirements, plus a defaultQueue label.
js
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 requiredFeatures = [];

  if (adapter.features.has("texture-compression-astc")) {
    requiredFeatures.push("texture-compression-astc");
  }

  const requiredLimits = {};

  // App ideally needs 6 bind groups, so we'll try to request what the app needs
  if (adapter.limits.maxBindGroups >= 6) {
    requiredLimits.maxBindGroups = 6;
  }

  const device = await adapter.requestDevice({
    defaultQueue: {
      label: "my_queue",
    },
    requiredFeatures,
    requiredLimits,
  });

  // …
}

Specifications

Specification
WebGPU
# dom-gpuadapter-requestdevice

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
requestDevice
Chrome – Partial support
Chrome 113 (Release date: 2023-05-02)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Chrome 144.
Edge – Partial support
Edge 113 (Release date: 2023-05-05)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Edge 144.
Firefox – Partial support
Firefox 141 (Release date: 2025-07-22)
footnote Partial support
footnote Supports all contexts except service workers. See bug 1942431.
footnote Supports Windows since Firefox 141. See bug 1972486.
footnote Supports macOS Tahoe on Apple silicon since Firefox 145. See bug 1992212.
footnote Supports older macOS versions on Apple silicon since Firefox 147. See bug 1993341.
footnote Does not support macOS on Intel CPUs. See bug 2004105.
footnote Does not support Linux. See bug 2006676.
Opera – Partial support
Opera 99 (Release date: 2023-05-16)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Opera 128.
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 121 (Release date: 2024-01-23)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 81 (Release date: 2024-03-14)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 25 (Release date: 2024-04-24)
footnote Full support
WebView Android – Full support
WebView Android 121 (Release date: 2024-01-23)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
Deno – No support
Deno 1.8 – 1.31 (Release date: 2021-03-02)
footnote Removed in 1.32 and later
Deno – No support
Deno 1.39 (Release date: 2023-12-14)
disabled
disabled From version 1.39 users must explicitly set the --unstable-webgpu runtime flag.
Rejects duplicate calls as adapter is consumed.
Chrome – Partial support
Chrome 116 (Release date: 2023-08-15)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Chrome 144.
footnote Before Chrome 140, lost GPUDevice is returned on duplicate calls.
Edge – Partial support
Edge 116 (Release date: 2023-08-21)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Edge 144.
footnote Before Edge 140, lost GPUDevice is returned on duplicate calls.
Firefox – No support
Firefox
footnote No support
Opera – Partial support
Opera 102 (Release date: 2023-08-23)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Opera 128.
footnote Before Opera 124, lost GPUDevice is returned on duplicate calls.
Safari – Partial support
Safari 26 (Release date: 2025-09-15)
footnote Partial support
footnote Duplicate calls don't reject; instead, lost GPUDevice is returned on duplicate calls.
Chrome Android – Partial support
Chrome Android 121 – 139 (Release date: 2024-01-23)
footnote Partial support
footnote Duplicate calls don't reject; instead, lost GPUDevice is returned on duplicate calls.
Chrome Android – Full support
Chrome Android 140 (Release date: 2025-09-02)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Partial support
Opera Android 81 – 91 (Release date: 2024-03-14)
footnote Partial support
footnote Duplicate calls don't reject; instead, lost GPUDevice is returned on duplicate calls.
Opera Android – Full support
Opera Android 92 (Release date: 2025-10-08)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Partial support
footnote Duplicate calls don't reject; instead, lost GPUDevice is returned on duplicate calls.
Samsung Internet – Partial support
Samsung Internet 25 (Release date: 2024-04-24)
footnote Partial support
footnote Duplicate calls don't reject; instead, lost GPUDevice is returned on duplicate calls.
WebView Android – Partial support
WebView Android 121 – 139 (Release date: 2024-01-23)
footnote Partial support
footnote Duplicate calls don't reject; instead, lost GPUDevice is returned on duplicate calls.
WebView Android – Full support
WebView Android 140 (Release date: 2025-09-02)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Partial support
footnote Duplicate calls don't reject; instead, lost GPUDevice is returned on duplicate calls.
Deno – No support
Deno 1.8 – 1.31 (Release date: 2021-03-02)
footnote Removed in 1.32 and later
Deno – Partial support
Deno 1.39 (Release date: 2023-12-14)
disabled
footnote Partial support
disabled From version 1.39 users must explicitly set the --unstable-webgpu runtime flag.
footnote Duplicate calls don't reject; instead, lost GPUDevice is returned on duplicate calls.
Request unknown limits with undefined value
Experimental
Chrome – Partial support
Chrome 133 (Release date: 2025-02-04)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Chrome 144.
Edge – Partial support
Edge 133 (Release date: 2025-02-06)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Edge 144.
Firefox – No support
Firefox
footnote No support
Opera – Partial support
Opera 118 (Release date: 2025-04-15)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Opera 128.
Safari – No support
Safari
footnote No support
Chrome Android – Partial support
Chrome Android 133 (Release date: 2025-02-04)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Chrome Android 144.
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Partial support
Opera Android 88 (Release date: 2025-03-19)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since Opera Android 95.
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Partial support
Samsung Internet 29 (Release date: 2025-10-25)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
WebView Android – Partial support
WebView Android 133 (Release date: 2025-02-04)
footnote Partial support
footnote Supported on ChromeOS, macOS, and Windows.
footnote Supported on Linux (Intel Gen12+ GPUs only) since WebView Android 144.
WebView on iOS – No support
WebView on iOS
footnote No support
Deno – No support
Deno
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Experimental. Expect behavior to change in the future.
User must explicitly enable this feature.
Has more compatibility info.

See also