This recipe helps you set up a VM instance in AWS for performance profiling with Intel® VTune™ Amplifier.

Ingredients

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

  • Application:matrix. The application is used as a demo and not available for download.

  • Tools: Intel® VTune™ Amplifier 2019 - Hotspots analysis

    Note

    • For trial VTune Amplifier downloads and product support, visit https://software.intel.com/en-us/vtune.

    • All the Cookbook recipes are scalable and can be applied to VTune Amplifier 2018 and higher. Slight version-specific configuration changes are possible.

Create and Configure a Virtual Machine Instance

  1. On the Amazon Web Services site, click Sign In to the Console to log in to your account.

    If you do not have an account, create it.

  2. Enter the Amazon EC2 Dashboard, select Compute > EC2.

  3. Click Launch Instance to create and configure your virtual machine with a wizard.

    In the configuration wizard, you can specify an OS and specification of the instance that fits your case (number of CPUs, memory, storage, and networking capacity).

  4. In Step 1: Choose an Amazon Machine Image (AMI), select Ubuntu Server 18.04 LTSlick.

  5. In Step 2: Choose an Instance Type, select an instance and click Next: Configure Instance Details.

    Note

    Recommended system requirements for the VTune Amplifier is 4 GB of RAM and at least 10Gb free disk space.

  6. In Step 3: Configure Instance Details, enable Auto-assign Public IP and click Next: Add Storage.

  7. In Step 4: Add Storage, increase the size of the storage device and click Next: Add Tags.

  8. [Optional] In Step 5: Add Tags, add a tag (for example, VTune Demo), then click Review and Launch.

  9. In Step 7: Review Instance Launch, click Launch.

  10. Create a key pair:

    1. Select Create a new key pair and assign a name (for example, MyEC2Instance).

    2. Click Download Key Pair to download the key.

    3. Select Launch Instances to complete the setup.

      The instance is launched.

  11. Click View Instances.

    When the Instance State is updated to running, proceed to the next step.

Connect to the EC 2 Instance

Select the EC2 instance you created and click the Connect tab to connect to your instance via SSH.

PuTTY* does not natively support the private key format (.pem) generated by Amazon EC2. You should convert your private key (.pem) to the required PuTTY format (.ppk) using PuTTYgen before attempting to connect to your instance using PuTTY:

  1. Convert your private key:

    1. Start PuTTYgen.

    2. For the Type of key to generate, select SSH-1 (RSA).

    3. Click Load and select your .pem file.

    4. Click Save private key to save the key in the format that PuTTY can use.

  2. Start PuTTY and specify a Public DNS for the instance and your private key (.ppk) file in the Connection > SSH > Auth pane.

  3. Save this configuration and click Open.

    You are logged in to the instance.

Note

You need to install the Xubuntu* desktop on your running instance and setup a VNC* Server if you want to access the system via VNC.

Configure the Instance for Profiling

Prepare the target instance for profiling by setting /proc/sys/kernel/yama/ptrace_scope to 0:

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

Run Hotspots Analysis

Run the Hotspots analysis using any of the following methods:

Run a remote collection from the locally installed VTune Amplifier using SSH:

Note

Remote hardware event-based sampling analysis is not available in the AWS EC2 virtualized environment with an exception for the EC2 bare metal instances (i3.metal instance family) that allow direct access to bare metal infrastructure and full profiling capability of the VTune Amplifier.

  1. Create a project in the VTune Amplifier.

    The Configure Analysis window opens.

  2. In the WHERE pane, select Remote Linux (SSH) and enter ubuntu@<name of putty configuration> for the SSH destination.

    At this point, VTune Amplifier attempts to connect to the remote system and install the binaries necessary for collection to the specified folder.

  3. In the WHAT pane, specify the location of your application and its working directory.

  4. In the HOW pane, select the User-Mode Sampling collection mode for the Hotspots analysis (open by default).

  5. Click to start the collection.

    The results are automatically copied to your local system for analysis.

Run VTune Amplifier directly from the AWS instance:

  1. Install the VTune Amplifier as described in the Installation Guide.

  2. Run the VTune Amplifier. For example:

    $ sudo <vtune_install_dir>/vtune_amplifier_2019/bin64/amplxe-gui

  3. Create a project.

    The Configure Analysis window opens.

  4. In the WHERE pane, select Local Host.

  5. In the WHAT pane, specify the location of your application and its working directory.

  6. In the HOW pane, select a preferred collection mode for the Hotspots analysis, for example: Hardware Event-Based Sampling.

  7. Click to start the collection.

    The analysis result opens in the default Hotspots by CPU Utilization viewpoint.

有关编译器优化的更完整信息,请参阅优化通知
选择粘滞按钮颜色: 
Orange (only for download buttons)