Installation
To use WebNN before the Origin Trial milestone, complete these setup requirements.
- Window 11, version 21H2 or newer
- It’s recommended to install the latest Intel® Arc™ & Iris® Xe Graphics on Windows for improved WebNN compatibility and performance
Enabling WebNN
Download and install the latest Chrome Canary or Edge Canary
Navigate to about://flags
in browser address bar
Search for Enables WebNN API
and change it to Enabled
Exit browser
Running WebNN on CPU or GPU
Launch Chrome Canary or Edge Canary
launch-chrome-canary
"%LOCALAPPDATA%\Google\Chrome SxS\Application\chrome.exe"
launch-edge-canary
"%LOCALAPPDATA%\Microsoft\Edge SxS\Application\msedge.exe"
Running WebNN on NPU
- Window 11, version 24H2 or newer
- It’s recommended to install the latest Intel® Core™ Ultra NPU Driver on Windows for improved WebNN compatibility and performance
Chrome Canary
Prepare the DirectML.dll
Download the latest redistributable Microsoft.AI.DirectML, rename microsoft.ai.directml.[version].nupkg
to microsoft.ai.directml.[version].nupkg.zip
and extract it
Put the DirectML.dll
into correct path
Copy \bin\x64-win\DirectML.dll
to %LOCALAPPDATA%\Google\Chrome SxS\Application\[version]\
%LOCALAPPDATA%
meansC:\Users\<username>\AppData\Local\
- Note that Chrome Canary frequently updates automatically. When this occurs, recopy the
DirectML.dll
to the new version’s directory.
Launch Chrome Canary in Windows Command Line
enable-webnn-npu-chrome-canary
"%LOCALAPPDATA%\Google\Chrome SxS\Application\chrome.exe" --use-redist-dml --disable_webnn_for_npu=0
Edge Canary
Ensure the DirectML.dll
was downloaded automatically
- Launch Edge Canary
- Go to
%LOCALAPPDATA%\Microsoft\Edge SxS\User Data
, check theEdgeOnnxRuntimeDirectML\[version]\DirectML.dll
exists %LOCALAPPDATA%
meansC:\Users\<username>\AppData\Local\
- Exit Edge Canary
Launch Edge Canary in Windows Command Line
enable-webnn-npu-edge-canary
"%LOCALAPPDATA%\Microsoft\Edge SxS\Application\msedge.exe" --disable_webnn_for_npu=0
Force to download the DirectML.dll
manually
If EdgeOnnxRuntimeDirectML\[version]\DirectML.dll
does not exist under %LOCALAPPDATA%\Microsoft\Edge SxS\User Data
:
- Go to
edge://components/
- Click Check for update button of Edge Video Super Resolution
- Repeat step 2