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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ 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 from Intel® Core™ Ultra processors.
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. Microsoft Edge browser will download the latest DirectML.dll automatically when WebNN is enabled. Apply the latest redistributable DirectML.dll for Google Chrome Canary:
huningxin marked this conversation as resolved.
Show resolved Hide resolved
Download the latest redistributable DirectML package from [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"\).
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
3. Launch your browser in Windows Command Line:
* Google Chrome Canary:
> "C:\Users\\"username"\AppData\Local\Google\Chrome SxS\Application\chrome.exe" --disable-gpu-sandbox
Copy link
Contributor

Choose a reason for hiding this comment

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

@huningxin @mingmingtasd Do we have to use the '--disable-gpu-sandbox' flag? I mean the minimal impact flag the better, only use "--use-redist-dml" will not help, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only use "--use-redist-dml" is OK for chrome canary. I also removed the flag for edge canary, is that OK? Should rely on edge itself to download the latest dml?

Copy link

Choose a reason for hiding this comment

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

Do we have to use the '--disable-gpu-sandbox' flag?

Interesting, a new flag to add to the list. I suppose that's a narrower form of --no-sandbox that only applies to the GPU process.

* Microsoft Edge Canary:
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
> "C:\Users\\"username"\AppData\Local\Microsoft\Edge SxS\Application\msedge.exe" --disable-gpu-sandbox

## 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