intel / libva-utils

Libva-utils is a collection of tests for VA-API (VIdeo Acceleration API)
https://01.org/linuxmedia
Other
199 stars 164 forks source link

vainfo discrete GPU not detected on wayland laptop with hybrid graphics #253

Open nnuel opened 2 years ago

nnuel commented 2 years ago

System information

System:
  Host: laptop Kernel: 5.15.7-1-MANJARO x86_64 bits: 64 compiler: gcc
    v: 11.1.0 Desktop: sway 1.6.1 dm: N/A Distro: Manjaro Linux
    base: Arch Linux
CPU:
  Info: dual core model: Intel Core i7-4500U bits: 64 type: MT MCP
    arch: Haswell rev: 1 cache: L1: 128 KiB L2: 512 KiB L3: 4 MiB
  Speed (MHz): avg: 1647 high: 1818 min/max: 800/3000 cores:
    1: 1536 2: 1440 3: 1796 4: 1818 bogomips: 19163
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel Haswell-ULT Integrated Graphics
    vendor: Hewlett-Packard driver: i915 v: kernel bus-ID: 00:02.0
    chip-ID: 8086:0a16
  Device-2: AMD Mars [Radeon HD 8730M]
    vendor: Hewlett-Packard FirePro M4100 driver: amdgpu v: kernel
    bus-ID: 03:00.0 chip-ID: 1002:6601
  Display: wayland server: N/A compositor: sway driver:
    loaded: amdgpu note: n/a (using device driver)
    resolution: <missing: xdpyinfo>
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4400 (HSW GT2)
    v: 4.5 Mesa 21.2.5 compat-v: 3.0 direct render: Yes

Describe the issue

LIBVA_DRIVER_NAME=radeonsi vainfo gives:

kmsro: driver missing
libva error: /usr/lib/dri/radeonsi_drv_video.so init failed
vaInitialize failed with error code 2 (resource allocation failed),exit

While the driver is installed correctly and shows up in /usr/lib/dri/ and confirmed this with mpv and radeontop and intel_gpu_top. so the hardware decoding works on the AMDGPU, however, the application Parsec expects the VAAPI and for the radeonsi it crashes for some reason.

Is there a way to force the use of VAAPI on the other renderer, in this case renderD129?

Because it works with the following flags: vainfo --display drm --device /dev/dri/card1 gives the correct vainfo output.

> vainfo --display drm --device /dev/dri/renderD129
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Mesa Gallium driver 21.2.5 for AMD Radeon HD 8500M / 8700M (OLAND, DRM 3.42.0, 5.15.7-1-MANJARO, LLVM 13.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
eero-t commented 11 months ago

I'm myself using containerization, and map just the relevant device to it: docker run --device /dev/dri/renderD129:/dev/dri/renderD129 ...