Skip to content

Latest commit

 

History

History
156 lines (115 loc) · 6.85 KB

intel-gpu-dkms.rst

File metadata and controls

156 lines (115 loc) · 6.85 KB

Intel GPU DKMS

It is required to install special Kernel Mode Drivers (KMD) to enable support of some new Intel GPUs. This article describes setup of these KMDs targeting the following GPUs:

  • Intel® Data Center GPU Flex Series (products formerly Arctic Sound)

Overall, the following should be taken care of:

DKMS packages are being built against specific kernel version. Please, refer to documentation in above projects for the full list of supported Operating Systems and kernels. In this article we will demonstrate installation for the specific version of Ubuntu 20.04 OEM kernel.

How to Generate DKMS Packages

To generate DKMS packages you can use helper dockers available in media-delivery repository:

OS Dockerfile
Ubuntu 20.04 docker/ubuntu20.04/dkms/Dockerfile
Ubuntu 22.04 docker/ubuntu22.04/dkms/Dockerfile

Run the following from the top level of media-delivery cloned copy:

# To build DKMS for Ubuntu 20.04
docker build \
  $(env | grep -E '(_proxy=|_PROXY)' | sed 's/^/--build-arg /') \
  --file docker/ubuntu20.04/dkms/Dockerfile \
  --tag dkms \
  .

# To build DKMS for Ubuntu 22.04
docker build \
  $(env | grep -E '(_proxy=|_PROXY)' | sed 's/^/--build-arg /') \
  --file docker/ubuntu22.04/dkms/Dockerfile \
  --tag dkms \
  .

Copy Intel GPU DKMS packages to the host system:

sudo mkdir -p /opt/packages/
sudo chown -R $(id -u):$(id -g) /opt/packages
docker run -it --rm -u $(id -u):$(id -g) -v /opt/packages/:/opt/packages/ dkms \
  /bin/bash -c "cp -rd /opt/dist/* /opt/packages/"

How to Install

First, install the following Ubuntu 20.04 OEM kernel (this kernel version corresponds to the version used below to build DKMS packages) and its headers:

sudo apt-get update

# for Ubuntu 20.04
sudo apt-get install linux-headers-5.14.0-1045-oem linux-image-unsigned-5.14.0-1045-oem

# for Ubuntu 22.04
sudo apt-get install linux-image-unsigned-5.17.0-1013-oem linux-headers-5.17.0-1013-oem

Once done, check kernel boot order in grub to make sure to boot into the installed kernel, adjust if needed, then reboot:

sudo reboot

Install Intel GPU Firmware and DKMS packages:

sudo apt-get install dkms bison flex gawk

sudo mkdir -p /lib/firmware/updates/i915/
sudo cp /opt/packages/firmware/*.bin /lib/firmware/updates/i915/
sudo dpkg -i /opt/packages/intel-i915-dkms_*.deb \
  /opt/packages/intel-platform-cse-dkms-*.deb \
  /opt/packages/intel-platform-pmt-dkms-*.deb

Once done, reboot:

sudo reboot

That's it. Now you should be able to use Intel GPU targeted by these DKMS packages.

How to Update

To install new version of DKMS packages, just follow the usual installation steps. Package manager automatically uninstalls previous version, then installs a new one.

When updating the entire kernel, make sure to install the corresponding kernel headers. DKMS installation builds kernel modules which requires corresponding kernel headers. So, when updating the kernel, make sure to always install both kernel and its headers. For example, to update from Ubuntu 20.04 5.14.0-1042-oem to 5.14.0-1047-oem kernel do:

sudo apt-get update
sudo apt-get install linux-headers-5.14.0-1047-oem linux-image-unsigned-5.14.0-1047-oem

Verify

To verify that DKMS were installed correctly, check dmesg logs right after the boot. First, verify that DKMS driver backports got recognized and loaded:

$ sudo dmesg |grep -i backport
[    5.578889] COMPAT BACKPORTED INIT
[    5.582781] Loading modules backported from DII_5606_prerelease
[    5.589185] Backport generated by backports.git UBUNTU_2004_OEM_5606_PRERELEASE_220414.2
[    5.685969] [drm] I915 BACKPORTED INIT
[    9.013124] [drm] I915 SPI BACKPORTED INIT

Then, check that GPU stack got initialized for your platform:

$ dmesg | grep drm
[    5.685969] [drm] I915 BACKPORTED INIT
[    5.690792] i915 0000:03:00.0: [drm] Bumping pre-emption timeout from 640 to 7500 on rcs'0.0 to allow slow compute pre-emption
[    5.703466] i915 0000:03:00.0: [drm] Disabling pre-emption timeout to work around forced preemption for rcs'0.0
[    5.714910] i915 0000:03:00.0: [drm] Bumping pre-emption timeout from 640 to 7500 on ccs'1.0 to allow slow compute pre-emption
[    5.727654] i915 0000:03:00.0: [drm] Disabling pre-emption timeout to work around forced preemption for ccs'1.0
[    5.754678] fb0: switching to inteldrmfb from EFI VGA
[    5.772069] i915 0000:03:00.0: [drm] Local memory available: 0x000000017c800000
[    5.838137] i915 0000:03:00.0: [drm] Finished loading DMC firmware i915/dg2_dmc_ver2_02.bin (v2.2)
[    5.847256] i915 0000:03:00.0: [drm] GuC firmware i915/dg2_guc_70.1.1.bin version 70.1
[    5.855165] i915 0000:03:00.0: [drm] HuC firmware i915/dg2_huc_7.10.0_gsc.bin version 7.10
[    5.876453] i915 0000:03:00.0: [drm] GuC submission enabled
[    5.882033] i915 0000:03:00.0: [drm] GuC SLPC enabled
[    5.887362] i915 0000:03:00.0: [drm] GuC RC: enabled
[    5.945017] [drm] Initialized i915 1.6.0 20201103 for 0000:03:00.0 on minor 0
[    6.003734] fbcon: i915drmfb (fb0) is primary device
[    6.073715] i915 0000:03:00.0: [drm] fb0: i915drmfb frame buffer device
[    8.141065] systemd[1]: Condition check resulted in Load Kernel Module drm being skipped.
[    9.013124] [drm] I915 SPI BACKPORTED INIT
[    9.174574] i915 0000:03:00.0: [drm] HuC authenticated

In the above log make sure that:

  • GuC, HuC and DMC Firmware was loaded (note: ATS-M reuses DG2 firmware)
  • HuC got authenticated

Once host setup is done, you can try media-delivery sample included in this repository. Refer to the top level README for details. In short, to build docker compatible with the host setup we just did, execute (from the top level of media-delivery cloned copy):

docker build \
  $(env | grep -E '(_proxy=|_PROXY)' | sed 's/^/--build-arg /') \
  --file docker/ubuntu20.04/selfbuild-prodkmd/Dockerfile \
  --tag intel-media-delivery \
  .