User Guide

  • 2022.2
  • 06/30/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 the following steps to enable Intel GPU metrics to be collected by System Analyzer and Graphics Trace Analyzer. 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. Obtain and install the latest version of the open source Intel metrics-discovery library (
    libmd.so
    ). The library is updated periodically with support for new Intel integrated and discrete GPUs, and to address issues that are identified.
    These steps were validated on Ubuntu 20.04.
    1. Ensure you have the latest version of the open source Intel metrics-discovery library with the following command:
      sudo rm /opt/intel/gpa/libmd.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 using one of the following approaches:
      1. Install the library just for the GPA tools to use:
        sudo cp -a ../dump/linux64/release/metrics_discovery/libmd.so* /opt/intel/gpa/
      2. Or to install it for all applications on your machine use:
        sudo make install
  4. Verify that the Monitor, Frame Analyzer and other Intel applications are not running in the foreground or background. This can be done by running the Ubuntu System Monitor and searching for the string
    Intel
    . If
    GpaMonitor
    is visible in the search results, right-click on it, select
    End
    followed by
    End Process
    and wait a few seconds for it to shut down. Then follow the same process for any other found Intel GPA applications.
  5. Confirm that GPA Monitor only shows a single Intel GPU connection in the upper-left drop-down menu. Then verify that Intel GPU metrics are shown 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).

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.