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
cannot start an analysis and you see an error message ( Profiler
Collection of GPU usage events cannot be enabled. i915 ftrace events are not available
), you must rebuild and install the re-configured module i915.
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.
Installing the kernel requires root permissions.
- 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"
- 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
- Install kernel headers:sudo apt -y install linux-headers-$(uname -r)
- Create a folder for kernel source:mkdir -p /tmp/kernel cd !$
- 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.
- Create a.configfile with the same configuration you have for your running kernel:cp /boot/config-$(uname -r) .config make olddefconfig
- In the new.configfile, make sure the following settings are enabled:CONFIG_EXPERT=yCONFIG_FTRACE=yCONFIG_DEBUG_FS=yCONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS=yUpdate the file, if required, and save.
- Create a full.configfile for the kernel:make olddefconfig
- Buildobjtool. This tool is required for building the sampling driver.make -C tools/ objtool
- Build the kernel with the new.configfile:make -j `getconf _NPROCESSORS_ONLN` deb-pkgIf you are using a custom kernel, use this command instead:make LOCALVERSION= -j `getconf _NPROCESSORS_ONLN` deb-pkg
- Install the kernel and kernel modules:sudo dpkg -i linux-*.deb
- Reboot the machine with the new kernel.