msdk: Dual GPU (AMD + Intel) fails to initialize Intel iHD driver
$ sudo cat /sys/kernel/debug/dri/128/name
i915 dev=0000:00:02.0 unique=0000:00:02.0
$ sudo cat /sys/kernel/debug/dri/129/name
amdgpu dev=0000:01:00.0 unique=0000:01:00.0
$ GST_DEBUG=msdk*:6 LIBVA_DRIVER_NAME=iHD gst-launch-1.0 videotestsrc num-buffers=10 \
! msdkh264enc ! h264parse ! filesink location=output.h264
0:00:00.010741374 1652 0x2292a90 INFO msdk msdk.c:186:msdk_open_session: MSDK implementation: 0x0402 (HARDWARE)
0:00:00.010779904 1652 0x2292a90 INFO msdk msdk.c:187:msdk_open_session: MSDK version: 1.28
Setting pipeline to PAUSED ...
0:00:00.012784792 1652 0x2292a90 INFO msdk msdk.c:186:msdk_open_session: MSDK implementation: 0x0402 (HARDWARE)
0:00:00.012795367 1652 0x2292a90 INFO msdk msdk.c:187:msdk_open_session: MSDK version: 1.28
0:00:00.013294940 1652 0x2292a90 DEBUG msdkcontext gstmsdkcontext.c:107:get_device_id: Opened the drm device node /dev/dri/renderD129
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /home/media/sandbox/media/install/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_4
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 [2]
param: 4, val: 0
libva error: /home/media/sandbox/media/install/lib/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
0:00:00.014246521 1652 0x2292a90 ERROR msdkcontext gstmsdkcontext.c:151:gst_msdk_context_use_vaapi: Couldn't initialize VA DRM display
free(): double free detected in tcache 2
Aborted (core dumped)
$ LIBVA_DRIVER_NAME=iHD vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.4.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /home/media/sandbox/media/install/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.4 (libva 2.4.0.pre1)
vainfo: Driver version: Intel iHD driver - 1.0.0
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointFEI
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD