From ac9f6efcfd81afb469311289417521ae2be370fc Mon Sep 17 00:00:00 2001 From: mingmingtasd Date: Thu, 5 Sep 2024 15:59:56 +0800 Subject: [PATCH 1/3] Optimize the readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d1bebe09..f0378335 100644 --- a/README.md +++ b/README.md @@ -40,13 +40,13 @@ To get started, follow these steps: ### WebNN Installation Guides -WebNN requires a compatible browser to run, and Windows 11 v21H2 (DML 1.6.0) or higher for GPU. Try the latest Google Chrome* Canary or Microsoft Edge Canary, which requires enabling WebNN functionality in the settings. +WebNN requires a compatible browser to run, and Windows 11 v21H2 (DML 1.6.0) or higher for GPU. Try the latest Google Chrome Canary or Microsoft Edge Canary, which requires enabling WebNN functionality in the settings. 1. Download the latest [Google Chrome Canary](https://www.google.com/chrome/canary/) or [Microsoft Edge Canary](https://www.microsoft.com/en-us/edge/download/insider) browser. -2. To enable WebNN, in your browser address bar, `enter chrome://flags`, and then press `Enter`. An Experiments page opens. +2. To enable WebNN, in your browser address bar, enter `chrome://flags`, and then press `Enter`. An Experiments page opens. 3. In the Search flags box, enter `webnn`. `Enables WebNN API` appears. 4. In the drop-down menu, select `Enabled`. -5. Relaunch your browser. +5. Relaunch your browser to run the samples on GPU or CPU. To run them on NPU, please continue following the additional steps below. #### Running WebNN on NPU At present, the [image classification](https://webmachinelearning.github.io/webnn-samples/image_classification/) and [object detection](https://webmachinelearning.github.io/webnn-samples/object_detection/) samples support NPU. @@ -57,7 +57,7 @@ At present, the [image classification](https://webmachinelearning.github.io/webn * Google Chrome Canary: 1. Download the latest redistributable [Microsoft.AI.DirectML](https://www.nuget.org/packages/Microsoft.AI.DirectML/). -2. 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"). Note that Chrome Canary may automatically update to a new version, in which case DirectML.dll will need to be recopied to the directory. +2. Extract the package and copy the DirectML.dll (e.g., \bin\x64-win\DirectML.dll) to the Chrome Canary’s version directory (e.g., %LOCALAPPDATA%\Google\Chrome SxS\Application\\"version number"). Note that Chrome Canary may automatically update to a new version, in which case DirectML.dll will need to be recopied to the directory. 3. Launch your browser in Windows Command Line: ```bash "%LOCALAPPDATA%\Google\Chrome SxS\Application\chrome.exe" --use-redist-dml --disable_webnn_for_npu=0 @@ -68,7 +68,7 @@ At present, the [image classification](https://webmachinelearning.github.io/webn ```bash "%LOCALAPPDATA%\Microsoft\Edge SxS\Application\msedge.exe" --disable_webnn_for_npu=0 ``` -2. For the first time you enable the `Enables WebNN API` flag, please wait a moment while the latest redistributable [Microsoft.AI.DirectML](https://www.nuget.org/packages/Microsoft.AI.DirectML/) is downloaded automatically before trying the samples. +2. For the first time you enable the `Enables WebNN API` flag, please wait a moment until the latest DirectML.dll is automatically downloaded into the Edge's user data directory (e.g., %LOCALAPPDATA%\Microsoft\Edge SxS\User Data\EdgeOnnxRuntimeDirectML\1.18.2.0) before trying the samples. * Notes: 1. There is an intermittent issue with the Intel NPU driver that causes failure of NPU adapter creation. The `WebNN(NPU)` backend button in the samples will be disabled with message "Unable to find a capable adapter". If you encounter this issue, please relaunch your browser and try again. From d1215e2e25ef64dbece744ae3568d6a75e0a26b1 Mon Sep 17 00:00:00 2001 From: mingmingtasd Date: Mon, 9 Sep 2024 13:29:09 +0800 Subject: [PATCH 2/3] re-write the webnn installation guides --- README.md | 56 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index f0378335..db0fa31f 100644 --- a/README.md +++ b/README.md @@ -40,35 +40,43 @@ To get started, follow these steps: ### WebNN Installation Guides -WebNN requires a compatible browser to run, and Windows 11 v21H2 (DML 1.6.0) or higher for GPU. Try the latest Google Chrome Canary or Microsoft Edge Canary, which requires enabling WebNN functionality in the settings. +To get started with WebNN on Intel AI PCs you will need: +* Window 11, version 21H2 or newer +* It's recommended to install the latest [Intel® Arc™ & Iris® Xe Graphics](https://www.intel.com/content/www/us/en/download/785597/intel-arc-iris-xe-graphics-windows.html) on Windows for improved WebNN compatibility and performance -1. Download the latest [Google Chrome Canary](https://www.google.com/chrome/canary/) or [Microsoft Edge Canary](https://www.microsoft.com/en-us/edge/download/insider) browser. -2. To enable WebNN, in your browser address bar, enter `chrome://flags`, and then press `Enter`. An Experiments page opens. -3. In the Search flags box, enter `webnn`. `Enables WebNN API` appears. -4. In the drop-down menu, select `Enabled`. -5. Relaunch your browser to run the samples on GPU or CPU. To run them on NPU, please continue following the additional steps below. +1. Download and install the latest [Chrome Canary](https://www.google.com/chrome/canary/) or [Edge Canary](https://www.microsoft.com/en-us/edge/download/insider?form=MA13FJ) +2. Navigate to `about://flags` in browser address bar +3. Search for `Enables WebNN API` and change it to "Enabled" +4. Exit browser + +#### Running WebNN on CPU or GPU +1. Launch Chrome Canary or Edge Canary #### Running WebNN on NPU At present, the [image classification](https://webmachinelearning.github.io/webnn-samples/image_classification/) and [object detection](https://webmachinelearning.github.io/webnn-samples/object_detection/) samples support NPU. -* Install NPU driver: - - For Intel® AI Boost NPU of Intel® Core™ Ultra processors, download and install the [latest Intel NPU driver](https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html). - -* Google Chrome Canary: -1. Download the latest redistributable [Microsoft.AI.DirectML](https://www.nuget.org/packages/Microsoft.AI.DirectML/). -2. Extract the package and copy the DirectML.dll (e.g., \bin\x64-win\DirectML.dll) to the Chrome Canary’s version directory (e.g., %LOCALAPPDATA%\Google\Chrome SxS\Application\\"version number"). Note that Chrome Canary may automatically update to a new version, in which case DirectML.dll will need to be recopied to the directory. -3. Launch your browser in Windows Command Line: -```bash -"%LOCALAPPDATA%\Google\Chrome SxS\Application\chrome.exe" --use-redist-dml --disable_webnn_for_npu=0 -``` - -* Microsoft Edge Canary: -1. Launch your browser in Windows Command Line: -```bash -"%LOCALAPPDATA%\Microsoft\Edge SxS\Application\msedge.exe" --disable_webnn_for_npu=0 -``` -2. For the first time you enable the `Enables WebNN API` flag, please wait a moment until the latest DirectML.dll is automatically downloaded into the Edge's user data directory (e.g., %LOCALAPPDATA%\Microsoft\Edge SxS\User Data\EdgeOnnxRuntimeDirectML\1.18.2.0) before trying the samples. +* Window 11, version 24H2 or newer +* It's recommended to install the latest [Intel® Core™ Ultra NPU Driver on Windows](https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html) for improved WebNN compatibility and performance +* **Google Chrome Canary:** + 1. Download the latest redistributable [Microsoft.AI.DirectML](https://www.nuget.org/packages/Microsoft.AI.DirectML/1.15.2), rename the "microsoft.ai.directml.\.nupkg" to "microsoft.ai.directml.\.nupkg.zip" and extract it + 2. Copy "\bin\x64-win\DirectML.dll" to "%LOCALAPPDATA%\Google\Chrome SxS\Application\\\" + - "%LOCALAPPDATA%" means "C:\Users\\AppData\Local\" + - Note that Chrome Canary frequently updates automatically. When this occurs, you'll need to recopy the DirectML.dll to the new version's directory + 3. Launch Chrome Canary in Windows Command Line: + ```bash + "%LOCALAPPDATA%\Google\Chrome SxS\Application\chrome.exe" --use-redist-dml --disable_webnn_for_npu=0 + ``` + +* **Microsoft Edge Canary:** + 1. Ensure the DirectML.dll was downloaded automatically (may take several minutes): + - Launch Edge Canary + - Go to "%LOCALAPPDATA%\Microsoft\Edge SxS\User Data", check the "EdgeOnnxRuntimeDirectML\\DirectML.dll" exists + - "%LOCALAPPDATA%" means "C:\Users\\AppData\Local\" + - Exit Edge Canary + 2. Launch Edge Canary in Windows Command Line: + ```bash + "%LOCALAPPDATA%\Microsoft\Edge SxS\Application\msedge.exe" --disable_webnn_for_npu=0 + ``` * Notes: 1. There is an intermittent issue with the Intel NPU driver that causes failure of NPU adapter creation. The `WebNN(NPU)` backend button in the samples will be disabled with message "Unable to find a capable adapter". If you encounter this issue, please relaunch your browser and try again. From 062207db3feacc79baabeb885200b0deae42839d Mon Sep 17 00:00:00 2001 From: mingmingtasd Date: Mon, 9 Sep 2024 14:17:14 +0800 Subject: [PATCH 3/3] fix path issue in preview mode --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index db0fa31f..edadedd1 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,8 @@ At present, the [image classification](https://webmachinelearning.github.io/webn * It's recommended to install the latest [Intel® Core™ Ultra NPU Driver on Windows](https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html) for improved WebNN compatibility and performance * **Google Chrome Canary:** 1. Download the latest redistributable [Microsoft.AI.DirectML](https://www.nuget.org/packages/Microsoft.AI.DirectML/1.15.2), rename the "microsoft.ai.directml.\.nupkg" to "microsoft.ai.directml.\.nupkg.zip" and extract it - 2. Copy "\bin\x64-win\DirectML.dll" to "%LOCALAPPDATA%\Google\Chrome SxS\Application\\\" - - "%LOCALAPPDATA%" means "C:\Users\\AppData\Local\" + 2. Copy `\bin\x64-win\DirectML.dll` to `%LOCALAPPDATA%\Google\Chrome SxS\Application\\` + - `%LOCALAPPDATA%` means `C:\Users\\AppData\Local\` - Note that Chrome Canary frequently updates automatically. When this occurs, you'll need to recopy the DirectML.dll to the new version's directory 3. Launch Chrome Canary in Windows Command Line: ```bash @@ -70,8 +70,8 @@ At present, the [image classification](https://webmachinelearning.github.io/webn * **Microsoft Edge Canary:** 1. Ensure the DirectML.dll was downloaded automatically (may take several minutes): - Launch Edge Canary - - Go to "%LOCALAPPDATA%\Microsoft\Edge SxS\User Data", check the "EdgeOnnxRuntimeDirectML\\DirectML.dll" exists - - "%LOCALAPPDATA%" means "C:\Users\\AppData\Local\" + - Go to `%LOCALAPPDATA%\Microsoft\Edge SxS\User Data`, check the `EdgeOnnxRuntimeDirectML\\DirectML.dll` exists + - `%LOCALAPPDATA%` means `C:\Users\\AppData\Local\` - Exit Edge Canary 2. Launch Edge Canary in Windows Command Line: ```bash