DPDK-on-the-Go – Profile DPDK Applications on Your Windows Laptop

By Muthurajan Jayakumar,

Published: 04/17/2017   Last Updated: 04/17/2017

Introduction

Figure 1This article gets you started with hands-on development, execution, and profiling of the Data Plane Development Kit (DPDK) application on your own laptop. This enhances portability as well as sharing and teaching developers, customers, and students in a scalable way.

About the Author

M Jay

M Jay has worked with the DPDK team since 2009. He joined Intel in 1991 and has been in various roles and divisions: 64-bit CPU front side bus architect, 64 bit HAL developer, among others, before he joined the DPDK team. M Jay holds 21 US patents, both individually and jointly, all issued while working at Intel. M Jay was awarded the Intel Achievement Award in 2016, Intel's highest honor based on innovation and results.

Background

Figure 2To run and profile DPDK on the Linux* platform, please refer to the article Profiling DPDK Code with Intel® VTune™ Amplifier. If you don’t want to install Linux on your laptop, follow the steps in this article to learn how to configure your Intel® architecture-based Windows* laptop to develop, run and get started profiling DPDK applications.

Intel® VTune™ Amplifier, a performance profiler, will run natively on the Windows* OS so that it can access all the hardware performance registers. Developing and running DPDK applications will be done on an Oracle VM VirtualBox*.

The instructions in this article were tested on an Intel® Xeon® processor-based desktop, server, and laptop. Here we will use a laptop with the Windows OS.

If you have an Apple* laptop, the appendix provides information about systems based on the Mac OS*.

DPDK Application Building and Profiling – Components

  • Intel® Atom™ or Intel Xeon processor-based system
  • DPDK Applications
  • Oracle VM VirtualBox 
  • Intel VTune  Amplifier profiler

Figure 3

The platform can be any Intel® processor-based platform:  desktop, server, laptop, or embedded system.

This article covers the following steps:

  • Install and configure the Oracle VM VirtualBox.
  • Import, build, and run DPDK applications.
  • Install Intel VTune Amplifier and get started profiling.

Install and Configure the Oracle VM VirtualBox*

  • Step 1: Make sure Intel® Virtualization Technology for Directed I/O (Intel® VT-d) Intel® Virtualization Technology for IA32, Intel® 64 and Intel® Architecture (Intel® VT-x) are enabled in the UEFI firmware/BIOS.
  • Step 2: Download two images: the VirtualBox image and the extension packs for the same version.
  • Step 3: Install VirtualBox.
  • Step 4: Install the extension packs.
  • Step 5: Verify that 64-bit guest virtualization is enabled.

Step 1: Make sure Intel VT-d and Intel VT-x are enabled in UEFI firmware/BIOS. 

This is needed to ensure 64-bit guests can be run; VT-d and VT-x need to be on.

Intel VT-d and Intel VT-x enabling will be under Advanced CPU settings or Advanced Chipset settings as mentioned below. First we need to get into safe mode and look into BIOS setting.

  1. Windows buttonPress the Windows button. You will see the following screen Startup Screen
  2. Press the Power Switch icon.  Power Button   You will see the following drop-down menu.
    Menu
  3. MenuTo get into BIOS, press SHIFT+RESTART.

    If you have a laptop installed with Windows* 8, go to safe mode (SHIFT+RESTART).

    You will see the following settings. Note that depending on your computer, you may see different options.
     

  4. To use advanced tools, choose Troubleshoot.
     

  5. If the following screen displays, choose Enable Safe Mode to access the screen for the BIOS change.

    Menu
    Once you have selected safe mode, you will be able to access additional options, as shown below.

      Menu ;

  6. Select UEFI Firmware Settings

    Note: In your system, it may be referred to as BIOS setting.

    Depending on your vendor and BIOS, you will be able to access the Advanced setting or Advance Chipset Control or Advanced CPU Control. What you need to do is verify whether Intel VT is enabled. In certain BIOS models, it may display as VT-d and VT-x.

    Some systems will have both a CPU section (for Intel VT-x) and a chipset section (for Intel VT-d) so you may have to look at both sections to enable virtualization.

    Below are two screens: the CPU screen followed by the chipset screen. In this system, only the chipset screen has virtualization control.

    CPU screen

    Chipset screen

  7. Save and then exit.

    Now the OS and applications come up.

    Step 2: Download two images: the VirtualBox Image and the extension packs for the same version 

    To access the downloads, go to https://www.virtualbox.org/wiki/Downloads

    For Windows:

    1. Select VirtualBox5.1.8 (or the latest) for Windows hosts.
    2. Matching version number Extension Packs.

    For OS X*:

    1. Select VirtualBox5.1.8 (or the latest) for OS X hosts. Virtual Box

    2. Click and download the matching version extension. 

     

    Why install extension packs? What functionality do they provide?

    Extension packs complement the functionality of VirtualBox.Virtual Box

    1. Verify that both images downloaded in your system successfully. 

    Verify

Step 3. Install VirtualBox – Run As Administrator 

  1. To start the install, right-click VirtualBox, and then select Run as administrator.

     
    Virtual Box    
  2. Continue through the following screens. Virtual Box Setup Wizard
  3. For the screen above, press the left-arrow “<” to select INSTALL.

     Virtual Box Installation

Step 4: Install the Extension Packs 

  1. Click File, and then click Preferences. 

    Install the Extension Packs - Preferences

  2. Click Extensions.
  3. To select the extension packs download, browse, and then click the folder icon on the right, as shown by the arrow below.  
    : Install the Extension Packs Preferences 2
  4. Select the extension packs to install. 
    Install the Extension Packs - Preferences 


    You will see the following success message:    Message

Step 5: Verify that 64-bit guest virtualization is enabled. 

  1. Select New (shown by the arrow below) and choose OS Type “Linux”.
  2. Verify in the “Version” sub-menu whether 64-bit Ubuntu* is selectable. If so, the virtualization steps to enable Intel VT-d and Intel VT-x were successful.

Now you are ready to import the VMs. Import the VMs

Note: If you don’t see 64-bit versions and see only 32-bit version, you’ll need to enable Intel VT-d and Intel VT-x correctly. Return to the BIOS setting steps under “Step 1: “Make sure Intel VT-d and Intel VT-x are enabled in UEFI firmware/BIOS.”

Import, Build, and Run DPDK Applications

In this article, we assume that you have plugged in a thumb drive with a copy of an exported DPDK application virtual machine that was built on a native Linux platform running DPDK. When you have connected the thumb drive, follow these instructions to import the VM.

  1. Click File, and then click Import ApplianceImport, Build, and Run DPDK Applications
  2. Click the folder on the right (as shown by the arrow below) to select the VM to import.
  3. Select the VM.
    Example, as shown below: Ubuntu Nov 7 VTune DPDK.
     Select the VM Dialog

    The following screenshot shows verification of the virtual appliance getting imported.

     Verification of import
  4. Select Import.
    You will see the appliance being imported as shown below.

     Import appliance

    You have successfully imported the DPDK virtual appliance, as shown by the arrow in the screenshot below. Import appliance

    You have successfully launched DPDK running in the Ubuntu guest OS with VirtualBox on your laptop as shown below.

  5. Select the Imported DPDK appliance.

  6. To start the imported DPDK appliance, click StartOracle VM Manager

    You have successfully launched DPDK running in the Ubuntu guest OS with VirtualBox on your laptop as shown below

    DPDK running in the Ubuntu guest OS

Now you can start your own development by developing applications, building, and running. To get started, locate the README_FIRST file, as shown in the above screenshot. Click open and you’ll find instructions to run DPDK microbenchmarks and other applications. 

Quick Profile View using Windows Task Manager

Let’s say you want to know where cycles are being spent in the system. You can use Task Manager to have get a bird’s-eye view first. Then you can dig into Intel VTune Amplifier.

The screenshot below shows the CPU cycles and tasks running, with Windows Task Manager showing CPU utilization running the DPDK application as a guest with VirtualBox. 

Intel VTune Amplifier

Install Intel® VTune™ Amplifier

  1. Go to https://software.intel.com/en-us/intel-VTune-amplifier-xe
  2. Under Get Free Downloads & Trials, choose Windows*, and then click Download FREE Trial. Install and Profile Intel VTune Amplifier
  3. On the form, enter your email information to which the download link will be sent.
  4. Check your email inbox for an email titled “Thank you for evaluating Intel® VTune™ Amplifier XE for Windows*. (Note: Search in your e-mail’s trash folder in case you don’t see it)
  5. Click Download. Install and Profile Intel VTune Amplifier

    The Activation Acknowledgement page displays with the Download Now button, as shown below. 

    Install and Profile Intel VTune Amplifier
  6. Click Download Now.
  7. Print the “What’s New?” document

    Once the download has completed, as shown below you will have the VTune _Amplifier_XE_2017_update1_setup.exe image 
    Install and Profile Intel VTune Amplifier
  8. Double-click the extracted setup image. You will see the following confirmation. Confirmation
  9. On the welcome page, click NextInstall and Profile Intel VTune Amplifier
  10. In the following screen, select Evaluate this product (no serial number required). 
    Install and Profile Intel VTune Amplifier
  11. Click through the successive screen to complete the install. Install and Profile Intel VTune Amplifier
  12. On the following screen, leave “How do you want to open this file?” as the default and click OK. Install and Profile Intel VTune Amplifier
  13. Press the Windows button. You will see the installed Intel VTune Amplifier title as shown below. Install and Profile Intel VTune Amplifier

The next step is to open a terminal as an administrator. It is important to access Intel VTune Amplifier as an administrator.

  1. In the Search Windows box, type: cmd (shown below as the first step).
  2. Right-click Command Prompt (shown below as the second step).
  3. On the scroll-down menu, choose Run as administrator. Install and Profile Intel VTune Amplifier
  4. Verify that the terminal opened is titled Administrator. 
    Install and Profile Intel VTune Amplifier
    The next step is to verify that the system is ready and the install was successful.
  1. C:cd Program Files (x86)\IntelSWTools\VTune Amplifier XE 2017\bin32
  2. To verify whether your system meets the needs of hardware-event-based sampling, type: amplxe-sepreg.exe –c

    The following message screen should display. Terminal

    The screen above indicates that you have successfully verified the correct dependency checks required to install the sampling driver:

    • Platform, architecture, and OS environment
    • Availability of the sampling driver binaries: sepdrv4_0.syssep3drv.sys and sepdal.sys
    • Administrative privileges 
    • 32/64-bit installation 
  3. To check whether the sampling driver is loaded, type: amplxe-sepreg.exe –s 

    The following message screen should display. Install and Profile Intel VTune Amplifier

    The screen above indicates that the sampling driver loaded successfully.

    NOTE: If the sampling driver did NOT successfully load, refer to Appendix 3. Do NOT enter the command in Appendix 3 if you see the above success message.

    What’s next?

    The default installation path for the Intel VTune™ Amplifier XE is
    [Program Files (x86)]\IntelSWTools\VTune™ Amplifier XE

  4. cd \Progam Files (x86)\IntelSWTools\VTune™ Amplifier XE 2017 Install and Profile Intel VTune Amplifier
  5. amplxe-vars.bat         - run the batch file as shown below Install and Profile Intel VTune Amplifier

    You have set the needed environment variables successfully. You will get output as shown below Install and Profile Intel VTune Amplifier

    The final step is to run Intel VTune Amplifier.

  6. amplxe-gui            - run VTune; the GUI version is shown below Install and Profile Intel VTune Amplifier

You will see the welcome screen as shown below.

Be sure to print the items circles below: Getting Started and Discover Performance Snapshots.

Start practicing by clicking New Project (also circled)

To get hands-on practice, please refer to the sections after “Starting Intel VTune Amplifier” in the following article: Profiling DPDK Code with Intel® VTune™ Amplifier

Also refer to the resources given in the reference section of the above article for videos and articles. Welcome Screen

Next Steps

With the above hands-on exercise, you have successfully completed your “DPDK-On-The-Go” hands-on exercise.

As your first step, please register on the DPDK mailing list http://www.dpdk.org/ml/listinfo/dev

Also, we encourage you to play an active role in our meetups and DPDK community: www.dpdk.org

Please provide your feedback on this article to Muthurajan.Jayakumar@intel.com within 2 weeks after you go through your hands-on experience.

Exercises for the Readers

  1. How do you virtualize network devices in your host to present to VirtualBox appliances?
  2. How do you share your host file system with VirtualBox appliances?
  3. When you configure for sharing, what happens when you export the Virtual Appliance?
  4. What parameters in Intel VTune Amplifier do you look for in case you feel your application is compute bound?
  5. Same question as above, with your application being a) memory bound, b) I/O bound?

Appendix 1: How to Enable Intel® Virtualization Technology in a Mac* Computer

This article’s instructions were tested on a laptop with the Windows OS. Here are some references for the Mac regarding enabling Intel VT.

http://kb.parallels.com/en/5653

https://support.apple.com/en-us/HT203296 How to enable v-tune

Virtualization Technology

Appendix 2 – Potential Items to Watch Out for

  • Event-based sampling analysis: To install the drivers on Windows 7 and Windows* Server* 2008 R2 operating systems, you must enable the SHA-2 code signing support for these systems by applying Microsoft Security update 3033929: https://technet.microsoft.com/en-us/library/security/3033929. If the security update is not installed, event-based sampling analysis types will not work properly on your system.

Appendix 3 – In case the sampling driver is not installed

If the sampling driver is not installed but the system is supported by Intel VTune Amplifier, execute the following command with the administrative privileges to install the driver:

amplxe-sepreg.exe –I

Appendix 4 – Intel VTune Amplifier for Mac Computers

While Intel VTune Amplifier 2017 can run on Windows and Linux systems, the profiled results can be seen on OS X.

So you can run the DPDK applications with VirtualBox in Mac computers. For profiling you can use native tools that come with OS X.

And you can use the Viewer given below to view the output Intel VTune Amplifier generated on Windows or Linux machines.

Please refer to the article How to Download and Evaluate the VTune™ Amplifier OS X* Viewer

References

DPDK

DPDK-in-a-Box uses Minnowboard Turbot Single Board Computer.

Profiling DPDK Code with Intel® VTune™ Amplifier

Video: Intel® VTune™ and Performance Optimizations 

DPDK Performance Optimization Guidelines White Paper 

Product and Performance Information

1

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