Configuring a Hyper-V* Virtual Machine for Hardware-Based Hotspots Analysis
This recipe helps you set up a Virtual Machine instance in the Hyper-V environment for hardware performance profiling with
Intel® VTune™
.
Profiler
Ingredients
This section lists the hardware and software tools used for the performance analysis scenario.
- Tools:
- Intel® VTune™(or any release of the Intel® VTune™ Amplifier 2019)Profiler
- Starting with the 2020 release, Intel® VTune™ Amplifier has been renamed toIntel® VTune™.Profiler
- Most recipes in theIntel® VTune™Performance Analysis Cookbook are flexible. You can apply them to different versions ofProfilerIntel® VTune™. In some cases, minor adjustments may be required.Profiler
- Get the latest version ofIntel® VTune™:Profiler
- From theIntel® VTune™product page.Profiler
- Download the latest standalone package from the Intel® oneAPI standalone components page.
- A third-party virtual machine manager (VMM) may also be required.
- CPU: Intel® Xeon® processor that supports Intel® Virtualization Technology (Intel® VT)You can also use any Intel microarchitecture with performance monitoring hardware, such as:Intel Microarchitecture code namePMU VersionPEBSLBRIPTPT2GPA
- Operating system:Microsoft* Windows Server 2019 or Windows 10 Version 1809 (October 2018 Update) or later
- BIOSwith Intel VT support
Hyper-V may impose additional requirements described in the
Enable Intel Performance Monitoring Hardware in a Hyper-V virtual machine
article.
Configure a Hyper-V Host
- Enable the Intel VT in the BIOS setup on your server:
- Access the system BIOS by pressingF2during the system power-on self test (POST).
- ClickAdvanced>Processor Configuration.
- SelectIntel® Virtualization Technologyand change toEnabled.
- Do an AC power cycle for changes to take effect.
- Go toControl Panel>Programs>Programs and Featuresand clickTurn Windows features on or offon the left pane.TheWindows Featuresdialog box opens.
- Expand theHyper-Vfeature and select all the check boxes:
- ClickOKand proceed with the installation.When the installation is complete, clickRestart now.
Create and Configure a Virtual Machine
On your Hyper-V host (further,
host
), run Hyper-V Manager from the
Start
menu to create and configure a new VM (further,
VM
):
- From theActionspanel, clickNewand selectVirtual Machine...:
- In theNew Virtual Machine Wizard, specify all necessary parameters for the new machine (CPU configuration, Memory, Network, Hard Disk, and others).Recommended system requirements for theVTuneare 4 GB RAM and at least 10 GB free disk space.Profiler
- Configure your installation source. For example, you can use local installation.isoimage:
- Start the newly created VM and proceed with the OS installation process.
Configure the Virtual Machine for the Hardware Analysis
Prepare a target system instance for profiling by exposing PMU/PEBS/LBR to the VM:
- Turn off the newly created VM and launch your host Windows PowerShell as an Administrator from theStartmenu.
- In the PowerShell, configure your VM to expose PMU, PEBS, LBR to the VM as follows:Set-VMProcessor -VMName your_vm_name -Perfmon pmu,pebs,lbr
- Turn on your VM.
For additional guidance, see the
Enable Intel Performance Monitoring Hardware in a Hyper-V virtual machine article.
Run Hotspots Analysis
Run the
VTune
directly from the VM:
Profiler
- Install theVTuneon the VM.Profiler
- Run theVTunefromProfilerStartmenu.
- Create a project.TheConfigure Analysiswindow opens.
- On theWHEREpane, selectLocal Host.
- On theWHATpane, specify the location of your application and its working directory.
- On theHOWpane, select theHardware Event-Based Samplingcollection mode for the Hotspots analysis.If you succeed with exposing PMU/PEBS/LBR, your analysis configuration pane will show no error messages and you will be able to perform the analysis.
- ClickStartto run the analysis.The analysis result opens in the defaultHotspots by CPU Utilizationviewpoint.
You may perform the Hotspots analysis in multiple VMs running simultaneously.