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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ 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 NPU Guides on Windows
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
Running WebNN NPU requires devices with capable NPU hardware e.g. Intel NPU hardware. Based on the steps 1~4 of WebNN Installation Guides above, some other steps are required:
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved

1. Download and install the latest Intel NPU driver according to this [Guides Documentation](https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html).
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
2. Apply the latest redistributable DirectML.dll:
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
* For Google Chrome Canary:
mingmingtasd 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
* For Microsoft Edge Canary:
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
Edge browser will download the latest DirectML.dll automatically when WebNN is enabled.
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
3. Launch your browser in Windows Command Line:
* For Google Chrome Canary:
mingmingtasd marked this conversation as resolved.
Show resolved Hide resolved
> "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.

* For 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