Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kainino0x
Copy link
Contributor

Iteration on #4550.

Replaces the GPUAdapter method
Promise<GPUAdapterInfo> requestAdapterInfo();
with a synchronous attribute
[SameObject] readonly attribute GPUAdapterInfo info;

Important points:

  • requestAdapterInfo() is removed. Chromium will deprecate and remove it and attempt to get any sites migrated off of it, so hopefully Firefox/Safari won't have to implement it at all (though the implementation is trivial so they may choose to, for compatibility with outdated sites).
  • The available info about a given GPUAdapter may no longer change. You can only get new info by getting a new GPUAdapter. (The only reason this should happen is if someone adds a permission prompt for fingerprintability.)

Less important points:

  • You can now only get one GPUAdapterInfo object per GPUAdapter object, since adapter.info returns the same object every time you access it.

Fixes #4536

- Add a `[SameObject] readonly attribute GPUAdapterInfo info;` to
  `GPUAdapter`.
    - It returns the same JS object every time you access it.
- `requestAdapterInfo` still returns a new one each time for minor
  backward-compatibility reasons.
    - **HOWEVER** it has been changed to always return an
      already-resolved promise instead of resolving later.
- If the info available to the page changes for some reason (generally
  shouldn't), the attributes on the `GPUAdapterInfo` object start
  returning different values (like an empty string gets changed to a
  non-empty string).

Fixes 4536
@kainino0x kainino0x changed the title Sync info Replace .requestAdapterInfo() with .info May 23, 2024
@kainino0x kainino0x changed the title Replace .requestAdapterInfo() with .info Replace asynchronous .requestAdapterInfo() with synchronous .info May 23, 2024
@kainino0x
Copy link
Contributor Author

Whoops, accidentally opened the PR before I finished it. Should be ready now.

@kainino0x kainino0x added this to the Milestone 1 milestone May 23, 2024
@kainino0x kainino0x added the api WebGPU API label May 23, 2024
Copy link
Member

@toji toji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reflects the decision made on today's call, so LGTM. I have one verbiage nit:

"Info" is an informal abbreviation, which is common to see in code but in the spec prose we should probably spell it out as "information". I do thing that using "adapter info" when talking about the returned object is a reasonable exception, since it directly reflects the name of the returned object.

@mwyrzykowski
Copy link

Looks like this broke or will break https://chat.webllm.ai/, I will mention it to Tianqi Chen who filed another report against WebKit on this

@kainino0x
Copy link
Contributor Author

Chrome is adding a metric to measure usage of requestAdapterInfo() in the wild in preparation for removal.
https://chromium-review.googlesource.com/c/chromium/src/+/5569741
Currently we won't be capturing which websites use it, but we are likely to need to do that so we can reach out to developers to update their sites (once .info has reached Chrome Stable and ideally Safari TP / Firefox Nightly, so they can switch)

@mwyrzykowski
Copy link

mwyrzykowski commented May 31, 2024

That's great, thank you for adding the metrics. .info should appear in the next or next after next Safari Technology Preview, I merged the change yesterday, but kept requestAdapterInfo to avoid breaking webllm.ai amongst others

@beaufortfrancois
Copy link
Contributor

FYI I'm updating Apache TVM used by WebLLM to use adapter.info in apache/tvm#17051.

@beaufortfrancois
Copy link
Contributor

FYI https://chat.webllm.ai/ now uses the GPUAdapter info attribute when available following apache/tvm#17051

@beaufortfrancois
Copy link
Contributor

beaufortfrancois commented Jun 4, 2024

The GPUAdapter info attribute is now available in Chrome 127.0.6519.0 (Canary 🐤 at the time of writing). See https://chromiumdash.appspot.com/commit/9e908a7dca56215132ec7afc8962b18f993bbd2d

juj added a commit to juj/wasm_webgpu that referenced this pull request Jun 8, 2024
gyagp pushed a commit to gyagp/onnxruntime that referenced this pull request Jun 17, 2024
WebGPU is deprecating async adapter.requestAdapterInfo, and replacing it
with sync adapter.info.
Spec change: gpuweb/gpuweb#4662
gyagp pushed a commit to gyagp/onnxruntime that referenced this pull request Jun 18, 2024
WebGPU is deprecating async adapter.requestAdapterInfo, and replacing it
with sync adapter.info.
Spec change: gpuweb/gpuweb#4662
guschmue pushed a commit to microsoft/onnxruntime that referenced this pull request Jun 18, 2024
WebGPU is deprecating async adapter.requestAdapterInfo, and replacing it
with sync adapter.info.
Spec change: gpuweb/gpuweb#4662
@kainino0x kainino0x added the potentially breaking Could require a breaking change to the API label Jul 15, 2024
littledivy added a commit to littledivy/deno that referenced this pull request Jul 29, 2024
littledivy added a commit to denoland/deno that referenced this pull request Aug 6, 2024
@beaufortfrancois
Copy link
Contributor

@mwyrzykowski Can you affirm that WebGPU will ship in Safari without requestAdapterInfo() method as we're discussing in https://groups.google.com/a/chromium.org/g/blink-dev/c/HxOgGf4NzQ4? I'm happy to file a standards position for that as well

@mwyrzykowski
Copy link

mwyrzykowski commented Sep 9, 2024

@mwyrzykowski Can you affirm that WebGPU will ship in Safari without requestAdapterInfo() method as we're discussing in https://groups.google.com/a/chromium.org/g/blink-dev/c/HxOgGf4NzQ4? I'm happy to file a standards position for that as well

We don’t need a standards position but we do implement GPUAdapter.info

Let me check on the status of removing requestAdapterInfo. I don’t think anyone is still depending on that one. It’s not in the specification either, so it would be a website issue if they continue to use it.

@mwyrzykowski
Copy link

@beaufortfrancois I made the PR to remove it in WebKit now that WebLLM has updated their site - WebKit/WebKit#33333 - in any case we don't intend to support it and would consider it a website issue for using requestAdapterInfo.

@beaufortfrancois
Copy link
Contributor

Thank you @mwyrzykowski for your responsiveness!

aarongable pushed a commit to chromium/chromium that referenced this pull request Sep 11, 2024
Spec PR: gpuweb/gpuweb#4662
Intent to deprecate: https://groups.google.com/a/chromium.org/g/blink-dev/c/HxOgGf4NzQ4

Bug: 335383516
Change-Id: Ie396d3d462d07b77aaeb1ffeaca008c701478e5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5578020
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Ari Chivukula <[email protected]>
Commit-Queue: Fr <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1354048}
aarongable pushed a commit to chromium/chromium that referenced this pull request Oct 7, 2024
This CL removes the GPUAdapter requestAdapterInfo() method by turning
off the DeprecatedRequestAdapterInfo blink runtime feature.
Once it's stable enough, we'll clean it up entirely.

Spec PR: gpuweb/gpuweb#4662
Intent to deprecate: https://groups.google.com/a/chromium.org/g/blink-dev/c/HxOgGf4NzQ4

Bug: 335383516
Change-Id: Ib6b85a9c8d3661992072028e25ba35798e7e6e4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5569679
Commit-Queue: Fr <[email protected]>
Reviewed-by: Richard (Torne) Coles <[email protected]>
Reviewed-by: Yoav Weiss (@Shopify) <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1364867}
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 21, 2024
This CL removes entirely the GPUAdapter requestAdapterInfo() method.

Spec PR: gpuweb/gpuweb#4662
Intent to deprecate: https://groups.google.com/a/chromium.org/g/blink-dev/c/HxOgGf4NzQ4

Bug: 335383516
Change-Id: I538d083699d52355336e08fdf85d0f1870efa65c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5853988
Commit-Queue: Fr <[email protected]>
Reviewed-by: Alexei Svitkine <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
Reviewed-by: Yoav Weiss (@Shopify) <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1386121}
rohan11235813 pushed a commit to quadric-io/onnxruntime that referenced this pull request Aug 19, 2025
WebGPU is deprecating async adapter.requestAdapterInfo, and replacing it
with sync adapter.info.
Spec change: gpuweb/gpuweb#4662
rohan11235813 pushed a commit to quadric-io/onnxruntime that referenced this pull request Sep 15, 2025
WebGPU is deprecating async adapter.requestAdapterInfo, and replacing it
with sync adapter.info.
Spec change: gpuweb/gpuweb#4662
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api WebGPU API potentially breaking Could require a breaking change to the API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synchronously query GPUAdapterInfo
4 participants