Intel® VTune™ Profiler

Get Started

ID 769038
Date 3/22/2024
Public

Example: Profile an OpenMP* Application on Windows*

Use Intel VTune Profiler on a Windows machine to profile a sample iso3dfd_omp_offload OpenMP application offloaded onto an Intel GPU. Learn how to run a GPU analysis and examine results.

Prerequisites

  • Make sure your system is running on Microsoft* Windows 10 or a newer version.
  • Use Gen 9 or a newer version of Intel® Processor Graphics.
  • Your system should be run on 10th Generation Intel® Core™ i7 Processor (code named Ice Lake) or a newer Intel processor.
  • Download the Intel® oneAPI DPC++/C++ Compiler (available in the Intel® oneAPI Base Toolkit). You need this compiler to profile OpenMP applications.
  • Set up environment variables. Run the vars.bat script located in the <install-dir>\env directory.
  • Set up your system for GPU analysis.
NOTE:
To install Intel VTune Profiler in the Microsoft* Visual Studio environment, see the VTune Profiler User Guide.

Build and Compile the OpenMP Offload Application

  1. Download the iso3dfd_omp_offload OpenMP Offload sample.

  2. Open to the sample directory.

    cd <sample_dir>\DirectProgramming\C++\StructuredGrids\iso3dfd_omp_offload
  3. Compile the OpenMP Offload application.

    mkdir build
    cd build
    icx /std:c++17 /EHsc /Qiopenmp /I..\include\ /Qopenmp-targets:
    spir64 /DUSE_BASELINE /DEBUG ..\src\iso3dfd.cpp ..\src\iso3dfd_verify.cpp ..\src\utils.cpp
    

Run a GPU Analysis on the OpenMP Offload Application

You are now ready to run the GPU Offload Analysis on the OpenMP application you compiled.

  1. Open VTune Profiler and click on New Project to create a project.

  2. On the welcome page, click on Configure Analysis to set up your analysis.

  3. Select these settings for your analysis.
    • In the WHERE pane, select Local Host.
    • In the WHAT pane, select Launch Application and specify the iso3dfd_omp_offload binary as the application to profile.
    • In the HOW pane, select the GPU Offload analysis type from the Accelerators group in the Analysis Tree.
  4. Click the Start button to run the analysis.

VTune Profiler collects data and displays analysis results in the GPU Offload viewpoint.

  • In the Summary window, see statistics on CPU and GPU resource usage. Use this data to determine if your application is:
    • GPU-bound
    • CPU-bound
    • Utilizing the compute resources of your system inefficiently
  • Use the information in the Platform window to see basic CPU and GPU metrics.
  • Investigate specific computing tasks in the Graphics window.
For a deeper analysis, see a related recipe in the VTune Profiler Performance Analysis Cookbook. You can also continue your profiling with the GPU Compute/Media Hotspots analysis.