User Guide

  • 2022.3
  • 09/27/2022
  • Public Content
Contents

Enable System-wide Time-based GPU Metrics and Enable Query-based Metrics for OpenGL* in Graphics Frame Analyzer for Ubuntu*

Enable System-wide Time-based GPU Metrics Collection

Use these steps to enable System Analyzer and Graphics Trace Analyzer to collect Intel GPU metrics. Afterwards, the available metrics will also be shown in Monitor under
Options
on the
Metrics
tab (in a top-level Intel category labeled with a suffix based on either the GPU name or graphics device ID).
  1. You should only have graphics drivers for an Intel GPU installed on the machine. If other GPU vendor's graphics drivers are installed, follow their instructions to remove them. Then confirm that Intel GPU graphics drivers are installed.
    1. Make sure that the Ubuntu default open source Intel graphics driver package (
      xserver-xorg-video-intel
      ) is installed and loaded. The following command should output text with the substring
      xserver-xorg-video-intel
      :
      apt search xorg | grep intel
    2. Verify that the Intel GPU i915 kernel module is installed. The following command should output text with the module named
      i915
      in the left column:
      lsmod | grep i915
  2. Enable the Intel kernel module to allow user space applications to perform GPU based metrics collection. On boot, by default, it does not allow user space applications to do this:
    1. Use the following command to manually enable GPU based metrics collection:
      sudo sysctl -w dev.i915.perf_stream_paranoid=0
    2. Optionally, use the following command to add an automated cron job that executes whenever the platform reboots:
      sudo crontab -e # Add the following line at the end or as the 1st no comment line: @reboot /sbin/sysctl -w dev.i915.perf_stream_paranoid=0
    3. Afterwards, the
      perf_stream_paranoid
      mode 0 change can be confirmed by using the following command:
      sysctl -n dev.i915.perf_stream_paranoid
  3. Install the current version of the Intel metrics-discovery library (
    libigdmd.so
    ). This is an open source library that is periodically updated to support Intel integrated and discrete GPUs. Intel® Graphics Performance Analyzer (Intel GPA) tools use the library with its former name,
    libmd.so
    .
    These steps are validated on Ubuntu 20.04.
    1. Delete any old versions of the library used by the GPA tools. This helps to ensure that you have the latest version of the open source Intel metrics-discovery library. Run this command:
      sudo rm /opt/intel/gpa/libmd.so* sudo rm /opt/intel/gpa/libigdmd.so*
    2. Install the base packages required on your machine for compilation with:
      sudo apt install g++ libdrm-dev
    3. Clone and build the Intel metrics-discovery library from the latest source:
      cd ~/Downloads git clone https://github.com/intel/metrics-discovery cd metrics-discovery mkdir build cd build cmake .. make -j4 # Adjust based on the # of available CPU cores to improve compile time.
    4. Install the built Intel metrics-discovery library for the GPA tools to use:
      sudo cp -a ../dump/linux64/release/metrics_discovery/libigdmd.so* /opt/intel/gpa/ sudo ln -sf libigdmd.so /opt/intel/gpa/libmd.so
  4. Verify that the Monitor, Frame Analyzer and other Intel applications are not running in the foreground or background. To do this,
    1. Run the Ubuntu System Monitor.
    2. Search for the string
      Intel
      .
    3. If
      GpaMonitor
      is visible in the search results, right-click on it.
    4. Select
      End
      followed by
      End Process
      .
    5. Wait a few seconds for the application to shut down.
    6. Repeat steps a-f for any other Intel GPA applications you found.
  5. Confirm that GPA Monitor only shows a single Intel GPU connection in the upper-left drop-down menu.
  6. In the
    Metrics
    tab (in a top-level Intel category labeled with a suffix based on either the GPU name or graphics device ID), verify that Intel GPU metrics display under
    Options
    .

Enable OpenGL* Query-based GPU Metrics Collection in Frame Analyzer

First perform the steps above. Afterwards, you can perform the following steps to collect more accurate metric values in Graphics Frame Analyzer by locking the GPU frequency:
  1. Modify the rights to the following files to add write capabilities:
    sudo chmod +w /sys/class/drm/card0/gt_max_freq_mhz sudo chmod +w /sys/class/drm/card0/gt_min_freq_mhz sudo chmod +w /sys/class/drm/card0/gt_boost_freq_mhz
  2. Check and record what the current GPU frequency settings are:
    cat /sys/class/drm/card0/gt_max_freq_mhz cat /sys/class/drm/card0/gt_min_freq_mhz cat /sys/class/drm/card0/gt_boost_freq_mhz
  3. Write the same GPU frequency value in MHz for the three files. Do not exceed the GPU's maximum frequency, For example:
    echo 1000 | sudo tee /sys/class/drm/card0/gt_max_freq_mhz echo 1000 | sudo tee /sys/class/drm/card0/gt_min_freq_mhz echo 1000 | sudo tee /sys/class/drm/card0/gt_boost_freq_mhz
After finishing usage of Graphics Frame Analyzer, restore the prior settings recorded by following the example in step 3 above, except replace
1000
with the original settings recorded. Alternatively, perform a reboot.

Product and Performance Information

1

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