Reland "WebNN: Handle device-removal error on DirectML" This is a reland of commit 3a4889b10ae431826f47b005e0d36c13aab95a2d This CL passes a callback `GpuServiceImpl::LoseAllContexts` to create `webnn::WebNNContextProviderImpl` to avoid including the `components/viz/service/gl/gpu_service_impl.h` into `services/webnn/webnn_context_provider_impl.cc` which will cause dependency issue during compilation. Original change's description: > WebNN: Handle device-removal error on DirectML > > This CL kills the GPU process to destroy all contexts if > device-removal[1] error happens on DirectML on services side. > > GPU/NPU contexts on DirectML rely on the same device[2]. If the > device enters a "device-removed" state, all affected contexts become > unavailable and should be destroyed immediately. > > Additionally, since other components besides WebNN may reference the > device, so we have to terminate the GPU process to allow for the > re-creation of the device and recovery from device removal. > > [1] https://learn.microsoft.com/en-us/windows/ai/directml/dml-errors > [2] https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nn-d3d12-id3d12device > > Bug: 349640008 > Change-Id: I89b3bfefadfe4f5c92e0c5c0fd5104080822e6a2 > Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, mac15-blink-rel, linux-blink-rel > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5833441 > Reviewed-by: ningxin hu <ningxin.hu@intel.com> > Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> > Commit-Queue: Mingming1 Xu <mingming1.xu@intel.com> > Reviewed-by: Reilly Grant <reillyg@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1355090} Bug: 349640008, 366573639 Change-Id: I6cba4ebda87ccf963f27a05aeabb2ec1d805c64e Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, mac15-blink-rel, linux-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5871931 Reviewed-by: Reilly Grant <reillyg@chromium.org> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: ningxin hu <ningxin.hu@intel.com> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1358500}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.