Intel® VTune™ Profiler

Cookbook

ID 766316
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Profiling in an Apptainer* Container

Learn how to configure an Apptainer container to run analyses with Intel® VTune™ Profiler. Identify hot spots in an application that is running in the isolated container environment.

Ingredients

This section lists the hardware and software tools used for the performance analysis scenario.

  • Application: MatrixMultiplication

    This Java* application is used as a demo and not available for download.

  • Tools: Intel VTune Profiler

  • Linux container runtime: Apptainer

  • Operating system: Ubuntu* 20.04

  • CPU: Intel® microarchitecture code named Skylake with 8 logical CPUs

Install and Configure an Apptainer* Container

  1. Install Apptainer. For installation instructions, see the Apptainer installation guide.

  2. Create an Apptainer* container, for example, using the Docker Hub:

    
    host> apptainer build ubuntu.img docker://ubuntu:latest
    INFO:    Starting build...
    Getting image source signatures
    Copying blob 5e8117c0bd28 done
    Copying config b6548eacb0 done
    Writing manifest to image destination
    Storing signatures
    2023/12/08 15:23:58  info unpack layer: sha256:5e8117c0bd28aecad06f7e76d4d3b64734d59c1a0a44541d18060cd8fba30c50
    INFO:    Creating SIF file...
    INFO:    Build complete: ubuntu.img
    
    NOTE:

    Make sure the ubuntu.img file is created in the current directory.

  3. Run the container.

    Apptainer allows you to map directories on your host system to directories within your container. This way, you can read and write data on the host system. For example, if you have a host folder /tmp/vtune with VTune Profiler and a Java application, you must run the container and map /tmp/vtune to /local/vtune within the container.

    
    host> apptainer shell --bind 
    /opt/intel/oneapi/vtune/2024.0:/local/vtune --bind 
    /test_application:/local/test_application ./ubuntu.img
    

Run Analysis inside the Container

From the Apptainer container, open the command line interface of VTune Profiler(vtune-cl). Run an analysis for your Java application.

For example, to run the Hotspots analysis on the MatrixMultiplication application, type:

Apptainer> /local/vtune/bin64/vtune -collect hotspots -- /local/test_application/jdk-21.0.1/bin/java -cp /local/test_application MatrixMultiplication 2000 2000 2000 2000
NOTE:

To profile a target application running in the Apptainer container, you must open VTune Profiler from the same container.

When the analysis result is ready, use the VTune Profiler GUI installed on the host system to open the result. Start in the Summary window to see a performance overview for the application:

NOTE:

If you need to re-finalize an analysis result outside the Apptainer container (for example, in the GUI version of VTune Profiler installed on the host system), ensure that all binary and source files required for module resolution are accessible outside the container.