You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/api-reference/browser-compatibility/chrome-flags.mdx
+77-32Lines changed: 77 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ Visit via `about://flags/`
21
21
| Name | Windows ML / ONNX Runtime backend for WebNN |
22
22
| :--: | :-------- |
23
23
| Description | Enables using ONNX Runtime for CPU, GPU and NPU inference with the WebNN API. Disabling this flag enables a fallback to DirectML or TFLite. – Windows |
24
+
| Expiry Milestone | 146 |
24
25
| Command Line Usage |`"%LOCALAPPDATA%\Google\Chrome SxS\Application\chrome.exe" --enable-features=WebMachineLearningNeuralNetwork,WebNNOnnxRuntime`|
25
26
26
27
@@ -37,7 +38,14 @@ Visit via `about://flags/`
37
38
38
39
| Name | Core ML backend for WebNN |
39
40
| :--: | :-------- |
40
-
| Description | Enables using Core ML for GPU and NPU inference with the WebNN API. Disabling this flag enables a fallback to TFLite. |
41
+
| Description | Enables using Core ML for GPU and NPU inference with the WebNN API |
42
+
| Expiry Milestone | 146 |
43
+
44
+
### `#webnn-coreml-explicit-gpu-or-npu`
45
+
46
+
| Name | Core ML backend (explicit GPU or NPU) for WebNN |
47
+
| :--: | :-------- |
48
+
| Description | Enables using Core ML for explicit GPU and NPU inference with the WebNN API |
41
49
| Expiry Milestone | 146 |
42
50
43
51
### `#webnn-directml`
@@ -49,87 +57,124 @@ Visit via `about://flags/`
49
57
50
58
## Switches (Command Line Flags)
51
59
52
-
### `--use-redist-ort`
53
-
54
-
| Name | Use redistributable ONNX Runtime |
55
-
| :--: | :-------- |
56
-
| Description | Try to use a redistributable onnxruntime.dll. |
57
-
58
-
### `--webnn-use-ort`
59
-
60
-
| Name | WebNN Use ONNX Runtime |
61
-
| :--: | :-------- |
62
-
| Description | Introduces `webnn_use_ort` build flag and enable it for Windows. Replaces the DirectML backend with the ONNX Runtime backend. |
63
-
64
-
### `--webnn-ort-use-openvino`
65
-
66
-
| Name | WebNN ONNX Runtime Use OpenVINO |
67
-
| :--: | :-------- |
68
-
| Description | Enables the OpenVINO Execution Provider, OpenVINO EP will be
69
-
used for GPU and NPU devices. ONNX Runtime will run with the CPU EP by default. |
70
-
| Usage (No Sandbox) |`"%LOCALAPPDATA%\Google\Chrome SxS\Application\chrome.exe" --no-sandbox --webnn-use-ort --webnn-ort-use-openvino --use-redist-ort`|
| Description | Try to use a redistributable DirectML.dll. Used for testing WebNN against newer DirectML release before it is integrated into Windows OS. Please see more info about DirectML releases at: https://learn.microsoft.com/en-us/windows/ai/directml/dml-version-history.|
64
+
| Description | Try to use a redistributable DirectML.dll. Used for testing WebNN against newer DirectML release before it is integrated into Windows OS. Please see more info about [DirectML releases](https://learn.microsoft.com/en-us/windows/ai/directml/dml-version-history).|
65
+
| Note | DirectML was officially deprecated during Microsoft Build 2025. WebNN will leverage Windows ML to access OpenVINO and other EPs to get hardware acceleration. |
| Description | Run with DirectML fallback shaders if disabling Metacommands |
73
+
| Note | DirectML was officially deprecated during Microsoft Build 2025. WebNN will leverage Windows ML to access OpenVINO and other EPs to get hardware acceleration.|
| Description | If `--disable_webnn_for_gpu` workaround is enabled for the GPU device, we need to check to see if there is a NPU device available before setting the WebNN gpu feature status. If there is a NPU device, check the `--disable_webnn_for_npu` workaround. |
81
+
| Description | If `--disable_webnn_for_gpu` workaround is enabled for the GPU device, we need to check to see if there is a NPU device available before setting the WebNN gpu feature status. |
| Name | WebNN ONNX Runtime Execution Provider Library Path For Testing |
134
+
| :--: | :-------- |
135
+
| Description | Specify the ORT EP name and library path pair via this switch for testing development EP builds. Libraries of the ORT EP specified by the EP name are forced to be loaded from the specified path. The value should be in the format `<ep_name>?<ep_library_path>`. |
136
+
| Note |This switch is not to be used in shipping scenarios and is ignored by default |
| Description | Collect ORT profile data for performance analysis. The profile data file is generated in Chrome's folder with a fixed naming format `prefix_date_time.json`.|
152
+
| Note | The prefix can be provided by user or use `WebNNOrtProfile` as default |
| Description | Often used to fix crashes related to the GPU process. Should only be used when necessary for development or troubleshooting, as it makes the application vulnerable to exploits. |
162
+
| Note | This is an insecure configuration. After performing the test, you should quit Chrome and re-launch normally. |
| Description |The `--no-sandbox` flag disables Chromium's security sandbox, which isolates browser processes to prevent malicious code execution. While sometimes used in development/testing environments, using this flag in regular browsing is dangerous as it removes essential security protections. |
126
-
| Note |Running with `--no-sandbox` is an insecure configuration. After performing the test, you should quit Chrome and re-launch normally. |
169
+
| Description |Disables Chromium's security sandbox, which isolates browser processes to prevent malicious code execution. While sometimes used in development/testing environments, using this flag in regular browsing is dangerous as it removes essential security protections. |
170
+
| Note |This is an insecure configuration. After performing the test, you should quit Chrome and re-launch normally. |
| Description |The `--allow-third-party-modules` flag permits third-party software to inject DLLs or modules into Chrome's processes.|
177
+
| Description |Permits third-partysoftware to inject DLLs or modules into Chrome's processes |
133
178
| Note | While useful for legitimate software like antivirus or accessibility tools, it can pose security risks by allowing potentially malicious code injection. |
1. Follow the [WebNN Installation Guide](installation) to enable WebNN API and switch to Windows ML / ONNX Runtime backend
14
+
2. Put the ONNX Runtime dynamic link librares into a folder under `C:\Program Files\`, e.g. `C:\Program Files\ONNXRuntime`
15
+
3. Launch your Chrome or Edge browser with switch [--webnn-ort-library-path-for-testing](../../api-reference/browser-compatibility/chrome-flags#--webnn-ort-library-path-for-testing)
If you are running WebNN on AMD, Intel, Nvidia, or Qualcomm devices and need to debug WebNN using specific Execution Provider of ONNX Runtime:
32
+
33
+
1. Follow the [WebNN Installation Guide](installation) to enable WebNN API and switch to Windows ML / ONNX Runtime backend
34
+
2. Put the ONNX Runtime and Execution Provider dynamic link librares into a folder under `C:\Program Files\`, e.g. `C:\Program Files\ONNXRuntime-EP`
35
+
3. Launch your Chrome or Edge browser with switch [--webnn-ort-ep-library-path-for-testing](../../api-reference/browser-compatibility/chrome-flags#--webnn-ort-ep-library-path-for-testing)
36
+
37
+
### Execution Provider Mapping Table for Independent Hardware Vendors
If you are testing with custom or internal GPU or NPU drivers, add the [--allow-third-party-modules](../../api-reference/browser-compatibility/chrome-flags#--allow-third-party-modules) switch when launching the browser.
In some cases, you may need to debug WebNN by disabling Chromium's security sandbox using the [--disable-gpu-sandbox](../../api-reference/browser-compatibility/chrome-flags#--disable-gpu-sandbox) switch.
You can configure the logging severity level of ONNX Runtime using the switch [--webnn-ort-logging-level](../../api-reference/browser-compatibility/chrome-flags#--webnn-ort-logging-level). Other available severity levels include "INFO", "WARNING", "ERROR" (default), and "FATAL".
The Execution Providers (EPs) to be installed depend on your computer’s hardware configuration. It will display the following similar logs:
56
56
57
57
<divclassName="shell-font-small">
58
58
```shell
@@ -72,15 +72,7 @@ Provider 1:
72
72
```
73
73
</div>
74
74
75
-
> <InfoIcon /> The installation time may vary depending on your network speed. The Execution Providers (EPs) to be installed depend on your computer's hardware configuration.
0 commit comments