intel / libva

Libva is an implementation for VA-API (Video Acceleration API)
http://intel.github.io/libva/
Other
659 stars 302 forks source link

r600/crocus: Libva 2.14.0 problems with r600 and crocus based hybrid systems #592

Open lorn10 opened 2 years ago

lorn10 commented 2 years ago

Hi all

It looks that there exist some problems with Libva at multi GPU systems. Currently I have Mesa 22.2.0-devel (git-3dae544 2022-04-18 focal-oibaf-ppa) installed. The involved GPU drivers are r600 and crocus. The Intel iGPU is a Gen6 "Sandy Bridge" Intel HD 2000 while the dGPU is a Radeon HD 6770M one.

In my case I get at the Intel iGPU:

test@test-iMac:~$ LIBVA_DRIVER_NAME=i965 DRI_PRIME=1 vainfo
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_6
DRM_IOCTL_I915_GEM_APERTURE failed: No such file or directory
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/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

While the Radeon dGPU works fine:

test@test-iMac:~$ LIBVA_DRIVER_NAME=r600 DRI_PRIME=0 vainfo
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'r600'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 22.2.0-devel for AMD TURKS (DRM 2.50.0 / 5.13.0-39-generic, LLVM 14.0.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

System information:

test@test-iMac:~$ inxi -b
System:    Host: test-iMac Kernel: 5.13.0-39-generic x86_64 bits: 64 Desktop: KDE Plasma 5.18.8 
           Distro: Ubuntu 20.04.4 LTS (Focal Fossa) 
Machine:   Type: Desktop System: Apple product: iMac12,2 v: 1.0 serial: <superuser/root required> 
           Mobo: Apple model: Mac-942B59F58194171B v: iMac12,2 serial: <superuser/root required> UEFI: Apple 
           v: IM121.88Z.0047.B1F.1201241648 date: 01/24/12 
CPU:       Quad Core: Intel Core i5-2500S type: MCP speed: 1596 MHz min/max: 1600/3700 MHz 
Graphics:  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel 
           Device-2: Advanced Micro Devices [AMD/ATI] Whistler [Radeon HD 6730M/6770M/7690M XT] driver: radeon v: kernel 
           Display: x11 server: X.Org 1.20.13 driver: modesetting,radeon FAILED: ati unloaded: fbdev,vesa 
           resolution: 2560x1440~60Hz 
           OpenGL: renderer: AMD TURKS (DRM 2.50.0 / 5.13.0-39-generic LLVM 14.0.0) 
           v: 3.3 Mesa 22.2.0-devel (git-3dae544 2022-04-18 focal-oibaf-ppa) 
Network:   Device-1: Broadcom and subsidiaries NetXtreme BCM57765 Gigabit Ethernet PCIe driver: tg3 
           Device-2: Qualcomm Atheros AR93xx Wireless Network Adapter driver: ath9k 
Drives:    Local Storage: total: 931.51 GiB used: 117.06 GiB (12.6%) 
Info:      Processes: 211 Uptime: 5d 15h 35m Memory: 7.74 GiB used: 2.75 GiB (35.5%) Shell: bash inxi: 3.0.38 

Note there exist a bug report at Mesa, see #6326 which shows also Libva problems in conjunction with an Intel Gen5 iGPU and a Radeon HD 6470M. That report may be related to my problems described here. :wink:

lorn10 commented 2 years ago

Okay, it looks that the DRM_IOCTL_I915_GEM_APERTURE failed is a quite known one. This can be seen for example also in the bug report here #195.

So pinging user @HeFan2017 and @XinfengZhang regarding the status of a fix in this matter. :wink:

lorn10 commented 11 months ago

A new addition for the end of the year 2023.

The situation (on Kubuntu 22.04 LTS) is unfortunately still the same, no VA-API support is exposed for my Intel Gen6 "Sandy Bridge" Intel HD 2000 iGPU. This might be because of the old libva library, currently installed version is the somewhat newer but still old VA-API version: 1.19 (libva 2.12.0).

However, the vainfo output is slightly different:

test@test-iMac:~$ LIBVA_DRIVER_NAME=i965 DRI_PRIME=1 vainfo
libva info: VA-API version 1.19.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_8
DRM_IOCTL_I915_GEM_APERTURE failed: No such file or directory
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [13]
param: 4, val: 0
i915 does not support EXECBUFER2
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit

The i915 does not support EXECBUFER2 information was not present before. And instead of get chip id failed: -1 [22] I have now get chip id failed: -1 [13].

This may indicate that my hardware is not properly configured (in the firmware). Whatever, this is true for my iMac 12,2 computer which comes with a quite special (or even strange) Multi-GPU config.

lorn10 commented 11 months ago

Good news, it looks that I found in https://github.com/intel/libva-utils/pull/46 a vainfo command which works. It is, vainfo --display drm --device /dev/dri/renderD129.

This gives in my case:

test@test-iMac:~$ vainfo --display drm --device /dev/dri/renderD129
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_8
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.19 (libva 2.12.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Sandybridge Desktop - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

And the same is true for the Radeon card, which is identified as renderD128 device (should be the opposite I think):

test@test-iMac:~$ vainfo --display drm --device /dev/dri/renderD128
libva info: VA-API version 1.19.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_1_19
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.19 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 24.0~git2312100600.df6247~oibaf~j for AMD TURKS (DRM 2.50.0 / 5.15.0-91-generic, LLVM 15.0.7)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High10             : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

So pinging @xhaihao about that. Maybe this information is of some interest for you. :wink: