Intel® VTune™ Profiler

User Guide

ID 766319
Date 12/20/2024
Public
Document Table of Contents

Rebuild and Install the Kernel for GPU Analysis

To collect i915 ftrace events that are required for a detailed analysis of GPU utilization, your Linux kernel should be properly configured.

If VTune Profiler cannot start an analysis and you see an error message (Collection of GPU usage events cannot be enabled. i915 ftrace events are not available), you must rebuild and install the re-configured module i915.

NOTE:
Rebuilding the Linux kernel is only required if you need to see detailed information about GPU utilization. You can run GPU analyses and see high level information about GPU utilization without rebuilding your Linux kernel.

For kernel versions 4.14 and newer, enable these settings:

  • CONFIG_EXPERT=y
  • CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=y

If you update the kernel rarely, it is sufficient to configure and rebuild only module i915.

If you update the kernel often, build the special kernel for GPU analysis. Follow this procedure.

NOTE:

Installing the kernel requires root permissions.

  1. Add source package repositories for your Ubuntu version.

    For example, on Ubuntu Bionic Beaver* add:

    sudo add-apt-repository -s "deb http://ru.archive.ubuntu.com/ubuntu/ bionic main restricted"

  2. Install build dependencies:

    sudo apt -y build-dep linux linux-image-$(uname -r)
    sudo apt -y install libncurses-dev flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf

  3. Install kernel headers:

    sudo apt -y install linux-headers-$(uname -r)

  4. Create a folder for kernel source:

    mkdir -p /tmp/kernel
    cd !$

  5. Download kernel sources:

    apt -y source linux
    cd linux-*

    If you have a custom kernel, you need to find the corresponding source code the kernel belongs to.

  6. Create a .config file with the same configuration you have for your running kernel:

    cp /boot/config-$(uname -r) .config
    make olddefconfig

  7. In the new .config file, make sure the following settings are enabled:

    CONFIG_EXPERT=y

    CONFIG_FTRACE=y

    CONFIG_DEBUG_FS=y

    CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=y

    Update the file, if required, and save.

  8. Create a full .config file for the kernel:

    make olddefconfig

  9. Build objtool. This tool is required for building the sampling driver.

    make -C tools/ objtool

  10. Build the kernel with the new .config file:

    make -j `getconf _NPROCESSORS_ONLN` deb-pkg

    If you are using a custom kernel, use this command instead:

     make LOCALVERSION= -j `getconf _NPROCESSORS_ONLN` deb-pkg
  11. Install the kernel and kernel modules:

    sudo dpkg -i linux-*.deb

  12. Reboot the machine with the new kernel.