Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add steps for running WebNN NPU #232

Merged
merged 11 commits into from
Aug 30, 2024
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@ WebNN requires a compatible browser to run, and Windows 11 v21H2 (DML 1.6.0) or
4. In the drop-down menu, select `Enabled`.
5. Relaunch your browser.

#### Running WebNN on NPU
Running WebNN on NPU requires capable NPU hardware e.g. Intel® AI Boost NPU of Intel® Core™ Ultra processors.
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved

* Google Chrome Canary:
huningxin marked this conversation as resolved.
Show resolved Hide resolved
1. Download and install the [latest Intel NPU driver](https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html).
2. Download the latest redistributable [Microsoft.AI.DirectML](https://www.nuget.org/packages/Microsoft.AI.DirectML/), extract the package and copy the DirectML.dll (e.g. \bin\x64-win\DirectML.dll) to the Chrome Canary’s directory (e.g. C:\Users\"username"\AppData\Local\Google\Chrome SxS\Application\"version number").
3. Launch your browser in Windows Command Line:
```bash
"C:\Users\\"username"\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --use-redist-dml --disable_webnn_for_npu=0
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
```

* Microsoft Edge Canary:
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
1. Download and install the [latest Intel NPU driver](https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html).
2. Launch your browser in Windows Command Line:
```bash
"C:\Users\\"username"\AppData\Local\Microsoft\Edge SxS\Application\msedge.exe" --disable_webnn_for_npu=0
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
```
3. For the first time you enable the `Enables WebNN API` flag, please wait a moment while the latest redistributable [Microsoft.AI.DirectML] is downloaded automatically.

* Notes:
There is an intermittent issue of Intel NPU driver which will be fixed soon, please relaunch your browser to try again if you encounter a failure.
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved

## Support and Feedback
If you encounter any issues or have feedback on the WebNN Samples, please open an issue on the repository. We appreciate your input and will strive to address any problems as quickly as possible.

Expand Down