Skip to Content
🎉 WebNN Developer Preview is released →
LearnGet Started⚙️ Installation

Installation

To use WebNN before the Origin Trial milestone, complete these setup requirements.

Enabling WebNN

Download and install the latest Chrome Canary or Edge Canary

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

Chrome Canary

Put the DirectML.dll into correct path

Copy \bin\x64-win\DirectML.dll to %LOCALAPPDATA%\Google\Chrome SxS\Application\[version]\

  • %LOCALAPPDATA% means C:\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

Put the DirectML.dll into correct path

Copy \bin\x64-win\DirectML.dll to %LOCALAPPDATA%\Microsoft\Edge SxS\Application\[version]\

  • %LOCALAPPDATA% means C:\Users\<username>\AppData\Local\
  • Note that Edge Canary frequently updates automatically. When this occurs, recopy the DirectML.dll to the new version’s directory.

Launch Edge Canary in Windows Command Line

enable-webnn-npu-edge-canary
"%LOCALAPPDATA%\Microsoft\Edge SxS\Application\msedge.exe" --disable_webnn_for_npu=0

Test your WebNN API installation at Playground - Hello WebNN.

Last updated on