Set Up Your System for GPU Analysis
To analyze Intel Graphics hardware events on a GPU,
- You must install and configure drivers for your operating system.
- You must have relevant permissions.
- Your system must have the Intel Metric Discovery (MD) API library installed on it.
Install and Configure GPU Drivers
You can find more information about appropriate drivers for Linux in the GPGPU Installation Guides and for Windows in the Download Center.
Enable Permissions
Typically, you should run GPU profiling analyses, like the GPU Compute/Media Hotspots or the GPU related parts of XPU Offload analysis, with root privileges on Linux or as an Administrator on Windows.
If you lack root permissions on Linux, enable the collection of GPU hardware metrics for non-privileged users.
You can use the ./install/bin64/prepare-gpu-hardware-metrics.sh script running it with root privileges to automatically enable permissions.
Alternatively, you can follow these steps:
Add your username to the video and rendergroups.
To check whether your username is part of the video group, enter: groups | grep video.
To add your username to the video group, enter: sudo usermod -a -G video <username>.
Set the value of dev.i915.perf_stream_paranoidsysctl option to 0 as follows:
sysctl -w dev.i915.perf_stream_paranoid=0
This command makes a temporary change that is lost after reboot. To make a permanent change, enter:
echo dev.i915.perf_stream_paranoid=0 > /etc/sysctl.d/60-mdapi.conf
If you have installed the Xe driver instead of the i915 driver, make sure to set dev.xe.observation_paranoid = 0.
For successful data collection in a GPU analysis, set dev.i915.perf_stream_paranoid to 0. This action has a security implication.
GPU performance counters and context switch reports are global data. When you run a data collection with VTune Profiler, the counters contain information on how applications from other users loaded the GPU.
The perf_event_paranoid knob controls access to information obtained from CPU while the perf_stream_paranoid knob controls access to information obtained from the GPU. Both knobs allow unprivileged users to access a specific resource. Note that dev.i915.perf_stream_paranoid can only influence the access to GPU performance counters.
For a deeper understanding of the nature of perf security, read these articles:
Install Intel Metric Discovery API Library on Windows* OS
On Windows, Intel Metric Discovery API library is part of the official Intel Graphics driver package. You can install a driver for your system from https://www.intel.com/content/www/us/en/download-center/home.html.
If you run GPU analysis via a Remote Desktop connection, make sure your software fits these requirements:
Intel® Graphics driver version 15.36.14.64.4080, or higher
target analysis application runnable via RDC
Install Intel Metrics Discovery API Library on Linux* OS
To install the Intel Metrics Discovery API library, make sure to use a Linux operating system with kernel version that is 4.14 or newer.
Follow instructions in GPGPU Installation Guides to meet prerequisites and setup repositories.Then you can install the API library using these package managers:
| Package Manager | Instruction |
|---|---|
| RHEL | sudo dnf install -y intel-metrics-discovery |
| SLES | sudo zypper install -y intel-metrics-discovery |
| Ubuntu | sudo apt install -y intel-metrics-discovery |
| Build from source code |
Alternatively, you can build the Intel Metrics Discovery API libraryfrom source: https://github.com/intel/metrics-discovery.
If the library installation is incorrect, VTune Profiler may not be able to collect GPU hardware metrics and may subsequently display an error message.