Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable DRM Acceleration and Intel VPU #11692

Open
wants to merge 2 commits into
base: 3.0-dev
Choose a base branch
from

Conversation

rlmenge
Copy link
Contributor

@rlmenge rlmenge commented Dec 23, 2024

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

New feature.
This enables the Intel VPU on x86_64. VPU stands for Versatile Processing Unit. This driver is used in the Intel Core Ultra processors to support their AI processing. This driver leans on the DRM Accel framework which requires the Direct Rendering Manager (DRM) subsystem.

Since AI accelerators share many similarities with GPUs, they leverage the existing DRM infrastructure. Therefore as a result of https://github.com/microsoft/azurelinux/pull/10612/files, the accelerator drivers need to be packaged with the subpackage kernel-drivers-gpu. If in the generic kernel package, it will result in errors when modprobed:

$ insmod /lib/modules/6.6.57.1-8.azl3/kernel/drivers/accel/ivpu/intel_vpu.ko.xz
insmod: ERROR: could not insert module /lib/modules/6.6.57.1-8.azl3/kernel/drivers/accel/ivpu/intel_vpu.ko.xz: Unknown symbol in module
$ dmesg 
...
[ 3926.249382] intel_vpu: Unknown symbol drm_poll (err -2)
[ 3926.249393] intel_vpu: Unknown symbol drm_dev_enter (err -2)
[ 3926.249401] intel_vpu: Unknown symbol accel_open (err -2)
[ 3926.249412] intel_vpu: Unknown symbol drm_gem_get_pages (err -2)
[ 3926.249416] intel_vpu: Unknown symbol drm_mm_remove_node (err -2)
[ 3926.249438] intel_vpu: Unknown symbol drm_mm_takedown (err -2)
...

The specific changes being added are
DRM_ACCEL=y
Kconfig
DRM_ACCEL_IVPU=m
Kconfig

Change Log
  • Enable Intel VPU
Does this affect the toolchain?

YES

Associated issues
Test Methodology

Booted in Azure

Welcome to Microsoft Azure Linux 3.0 (x86_64)
Last login: Wed Jan  1 02:00:18 2025 from 20.230.14.159
azureuser@test-ivpu3 [ ~ ]$ systemd-analyze
Startup finished in 1.504s (kernel) + 1.339s (initrd) + 7.095s (userspace) = 9.939s 
graphical.target reached after 6.729s in userspace.
azureuser@test-ivpu3 [ ~ ]$ uname -a
Linux test-ivpu3 6.6.57.1-8.azl3 #1 SMP PREEMPT_DYNAMIC Wed Jan  1 01:09:01 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
azureuser@test-ivpu3 [ ~ ]$ sudo modprobe intel_vpu
azureuser@test-ivpu3 [ ~ ]$ modinfo intel_vpu
filename:       /lib/modules/6.6.57.1-8.azl3/kernel/drivers/accel/ivpu/intel_vpu.ko.xz
version:        1.0.
license:        GPL and additional rights
description:    Driver for Intel Versatile Processing Unit (VPU)
author:         Intel Corporation
firmware:       intel/vpu/vpu_40xx_v0.0.bin
firmware:       intel/vpu/vpu_37xx_v0.0.bin
import_ns:      DMA_BUF
srcversion:     A172A7EE27D5CE1E449C83D
alias:          pci:v00008086d0000643Esv*sd*bc*sc*i*
alias:          pci:v00008086d0000AD1Dsv*sd*bc*sc*i*
alias:          pci:v00008086d00007D1Dsv*sd*bc*sc*i*
depends:        drm
retpoline:      Y
intree:         Y
name:           intel_vpu
vermagic:       6.6.57.1-8.azl3 SMP preempt mod_unload modversions 
sig_id:         PKCS#7
signer:         
sig_key:        
sig_hashalgo:   unknown
signature:      
parm:           disable_recovery:Disables recovery when VPU hang is detected (bool)
parm:           tdr_timeout_ms:Timeout for device hang detection, in milliseconds, 0 - default (uint)
parm:           ivpu_log_level:VPU firmware default trace level: debug=1 info=2 warn=3 error=4 fatal=5 (uint)
parm:           firmware:VPU firmware binary in /lib/firmware/.. (charp)
parm:           dbg_mask:Driver debug mask. See IVPU_DBG_* macros. (int)
parm:           test_mode:Test mode: 0 - normal operation, 1 - fw unit test, 2 - null hw (int)
parm:           pll_min_ratio:Minimum PLL ratio used to set VPU frequency (byte)
parm:           pll_max_ratio:Maximum PLL ratio used to set VPU frequency (byte)
parm:           disable_mmu_cont_pages:Disable MMU contiguous pages optimization (bool)
azureuser@test-ivpu3 [ ~ ]$ lsmod | grep intel_vpu
intel_vpu             192512  0
drm                   663552  1 intel_vpu

Arm64 (does not have ivpu)

Welcome to Microsoft Azure Linux 3.0 (aarch64)
Last login: Tue Dec 31 23:41:09 2024 from 172.200.70.35
azureuser@marinerV3960 [ ~ ]$ uname -r
6.6.57.1-8.azl3
azureuser@marinerV3960 [ ~ ]$ uname -a
Linux marinerV3960 6.6.57.1-8.azl3 #1 SMP Mon Dec 23 23:18:53 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
azureuser@marinerV3960 [ ~ ]$ systemd-analyze
Startup finished in 2.169s (kernel) + 1.405s (initrd) + 7.049s (userspace) = 10.624s 
graphical.target reached after 6.784s in userspace.
azureuser@marinerV3960 [ ~ ]$

@rlmenge rlmenge changed the base branch from 3.0 to 3.0-dev December 31, 2024 22:31
@microsoft-github-policy-service microsoft-github-policy-service bot added the 3.0-dev PRs Destined for AzureLinux 3.0 label Dec 31, 2024
@rlmenge rlmenge marked this pull request as ready for review December 31, 2024 23:51
@rlmenge rlmenge requested a review from a team as a code owner December 31, 2024 23:51
@rlmenge rlmenge marked this pull request as draft January 1, 2025 00:27
@rlmenge rlmenge force-pushed the rlmenge/3.0/kernel/ivpu branch from 3a7829c to 8186c3d Compare January 1, 2025 01:48
@rlmenge rlmenge marked this pull request as ready for review January 1, 2025 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0-dev PRs Destined for AzureLinux 3.0 3.0 PRs Destined for 3.0 Packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant