intel / media-driver

Intel Graphics Media Driver to support hardware decode, encode and video processing.
https://github.com/intel/media-driver/wiki
Other
1.01k stars 346 forks source link

[Bug]: VAAPI iHD Driver Fails to Initialize on Kernel 6.8.0-40-generic #1845

Closed aerosteon closed 3 months ago

aerosteon commented 3 months ago

Which component impacted?

Video Processing

Is it regression? Good in old configuration?

Yes, it's good in old version

What happened?

I’m encountering an issue with VAAPI using the iHD driver on my system after a recent kernel update to 6.8.0-40-generic.

System Details:

Kernel Version: 6.8.0-40-generic VAAPI Version: 1.14.0 Driver in Use: intel-media-va-driver-non-free (iHD) CPU: Intel Core i7-13700 Issue:

Since the kernel update, running vainfo results in the following errors:

libva info: VA-API version 1.14.0 libva info: User environment variable requested driver 'iHD' libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_14 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed libva info: va_openDriver() returns 18 vaInitialize failed with error code 18 (invalid parameter),exit

Everything was working fine before the update. The issue appears to be related to the i915 module not functioning properly with VAAPI.

What I've Tried:

Reinstalled intel-media-va-driver-non-free. Verified the presence of /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so. Checked kernel logs and confirmed the issue started after the kernel update. Attempted using i965 as an alternative without success, but I prefer to use iHD.

What's the usage scenario when you are seeing the problem?

Transcode for media delivery

What impacted?

No response

Debug Information

  1. libva2 2.14.0-1 libva-utils dpkg-query: no packages found matching libva-utils libigdgmm12 22.1.2+ds1-1 intel-media-va-driver-non-free 22.3.1+ds1-1ubuntu0.1

  2. by-path card0 card1 card2 renderD128 renderD129

  3. 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:a780] (rev 04) 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:2786] (rev a1)

  4. libva info: VA-API version 1.14.0 libva info: User environment variable requested driver 'iHD' libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_14 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed libva info: va_openDriver() returns 18 vaInitialize failed with error code 18 (invalid parameter),exit

Do you want to contribute a patch to fix the issue?

No.

Jexu commented 3 months ago

This is caused by opening NV drm node but using intel backend IHD driver since you have 2 GPU existing on machine. Use NV backend driver or open Intel drm node vainfo --display drm --device "/dev/dri/renderD12xx"

Jexu commented 3 months ago

Good solution is to handle error inside application to try each drm node, try to open next available node if vaapi initial failed.