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
- 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.
- 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 substringxserver-xorg-video-intel:apt search xorg | grep intel
- Verify that the Intel GPU i915 kernel module is installed. The following command should output text with the module namedi915in the left column:lsmod | grep i915
- 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:
- Use the following command to manually enable GPU based metrics collection:sudo sysctl -w dev.i915.perf_stream_paranoid=0
- 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
- Afterwards, theperf_stream_paranoidmode 0 change can be confirmed by using the following command:sysctl -n dev.i915.perf_stream_paranoid
- 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.
- 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*
- Install the base packages required on your machine for compilation with:sudo apt install g++ libdrm-dev
- 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.
- Install the built Intel metrics-discovery library using one of the following approaches:
- Install the library just for the GPA tools to use:sudo cp -a ../dump/linux64/release/metrics_discovery/libmd.so* /opt/intel/gpa/
- Or to install it for all applications on your machine use:sudo make install
- 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 stringIntel. IfGpaMonitoris visible in the search results, right-click on it, selectEndfollowed byEnd Processand wait a few seconds for it to shut down. Then follow the same process for any other found Intel GPA applications.
- 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 underOptionson theMetricstab (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
- 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
- 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
- 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