Artificial Intelligence (AI)
Discuss current events in AI and technological innovations with Intel® employees
491 Discussions

Witness the power of Intel® iGPU with Azure IoT Edge for Linux on Windows(EFLOW) & OpenVINO™ Toolkit

Devang_Aggarwal
Employee
0 0 8,397

Authors: Narasimha Lakamsani, Devang Aggarwal, Sesh Seshagiri, Jian Sun

In a previous blog, we talked about how developers, like yourself, can utilize Windows Subsystem for Linux (WSL 2), a product that allows developers to run a Linux environment directly on Windows, and leverage the power of the Intel® iGPU on your laptop for inferencing of your applications.  

 In this blog, we will talk about a similar product, Azure IoT Edge for Linux on Windows (EFLOW). The similarities between both EFLOW and WSL is that they both use the same underlying technology and type of containerized workloads. However, they are created with different audiences and use cases in mind. WSL is meant to build, test, and run Linux code and applications. Whereas EFLOW is used for deployment of Azure IoT Edge modules and docker images running in containers.  

In fact, you can use WSL for development and bundle your developed application in an Azure IoT Edge container to deploy it in EFLOW.

 

Screen Shot 2022-05-06 at 10.57.03 AM.png

How EFLOW Works

Azure IoT Edge for Linux on Windows allows you to run containerized Linux workloads by running a curated or systematically organized Linux virtual machine on windows. EFLOW is primarily meant for running production services in IoT deployment, including processes that run round the clock for years.  

Unleash the power of Intel® iGPU with the OpenVINO™ Toolkit 

Intel’s Integrated Graphics Processing Unit (iGPU) is included in the same die as your CPU. You can use this added power on your machine to accelerate your AI inferencing workloads. The graphics processing unit comes in two flavors: integrated (built into the CPU) and discrete (stand-alone graphics card), branded as Intel® Iris® Xe MAX. 

 

Screen Shot 2022-05-06 at 10.59.46 AM.png

To unleash the full potential of Intel hardware for AI workloads you can use the OpenVINO™ toolkit, available in open-source version here: https://github.com/openvinotoolkit/openvino 

Now, you can access Intel® iGPU through Azure IoT Edge for Linux on Windows (EFLOW) with the help the OpenVINO™ Toolkit. 

System Setup for EFLOW 

  • Our system(works on other versions) 

    • Windows 10/11 Insider preview 

    • Windows Internet of Things Enterprise LTSC 2H21 (Build 19044) 
  • Enable Hyper-V 

    • Open PowerShell with administrator privileges and run the following command:
       Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All 
    • Press “y” to reboot and complete the operation 

EFLOW installation 

  • Download EFLOW

    • Open PowerShell with administrator privileges and run the following commands:
    • $msiPath = $([io.Path]::Combine($env:TEMP,'AzureIoTEdge.msi')) 
    • $ProgressPreference = 'SilentlyContinue' 
    • Invoke-WebRequest "https://aka.ms/AzEflowMSI" -OutFile $msiPath 
  • Install EFLOW 

    • Start-Process -Wait msiexec -ArgumentList "/i","$([io.Path]::Combine($env:TEMP, 'AzureIoTEdge.msi'))","/qn" 

EFLOW Deployment

  • Deploy EFLOW 

    • Open PowerShell with administrator privileges and run the following commands: 
    • Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force 
    • Import-Module AzureEFLOW 
    • cpu_count = 4 
    • $memory = 4096 
    • $hard_disk = 30 
    • $gpu_name = (Get-WmiObject win32_VideoController | where{$_.name -like "Intel(R)*"}).caption 
    • Deploy-Eflow -acceptEula yes -acceptOptionalTelemetry no -headless -cpuCount $cpu_count -memoryInMB $memory -vmDiskSize $hard_disk -gpuName $gpu_name -gpuPassthroughType ParaVirtualization -gpuCount 1
  • SSH into EFLOW VM 

    • Connect-EflowVM 
  • Ensure that GPU-PV is enabled 

    • Within the EFLOW VM, run the following command:
    • ls -al /dev/dxg
    • The expected output should be similar to:  
    • crw-rw-rw- 1 root 10, 60  Sep  8 06:20 /dev/dxg

Deploy a Docker container with OpenVINO™ Runtime and Run Benchmarking Using the Intel® iGPU

Run OpenVINOBenchmarking Using the iGPU

  • Within the deployed container, run the following commands: 

  • cd /opt/intel/openvino_2021/inference_engine/samples/cpp && 
    ./build_samples.sh 
  • cd ~/inference_engine_cpp_samples_build/intel64/Release 
  • wget https://download.01.org/opencv/2021/openvinotoolkit/2021.2/ope 
    n_model_zoo/models_bin/3/face-detection-retail-0004/FP32/face-detection-retail-0004.xml 
  • wget https://download.01.org/opencv/2021/openvinotoolkit/2021.2/ope 
    n_model_zoo/models_bin/3/face-detection-retail-0004/FP32/face-detection-retail-0004.bin 
  • ./benchmark_app -m face-detection-retail-0004.xml -d GPU 
  • The output should look something like the image shown below with clear indication of iGPU usage in the task manager

MicrosoftTeams-image (5).pngMicrosoftTeams-image (5).png

Azure IoT Hub Deployment 

Learn how to deploy Azure IoT Edge modules from Azure cloud to your Windows device here.

Conclusion 

We hope that with this blog, we were able to show you just how easy it is to: 

  • Setup and deploy your application or docker container in Linux VMs using EFLOW on a windows device.
  • Offload your AI workloads by harnessing the power of iGPU.
  • Get a significant performance boost by simply using OpenVINO. 

 

Notices & Disclaimers

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex . 

Performance results are based on testing as of dates shown in configurations and may not reflect all publicly available updates.  See backup for configuration details.  No product or component can be absolutely secure. 

Your costs and results may vary. 

Intel technologies may require enabled hardware, software or service activation.

© Intel Corporation.  Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries.  Other names and brands may be claimed as the property of others

About the Author
Devang is an AI Product Manager at Intel. He is part of Internet of Things (IoT) Group, where his focus is driving OpenVINO™ Toolkit integrations into popular AI Frameworks like ONNX Runtime. He also works with CSPs to enable cloud developers to seamlessly go from cloud to edge.