gstreamer-media-SDK
gstreamer-media-SDK copied to clipboard
Select correct DRM dvice, when has several GPUs
Hello! I have to install on my PC NVidia P106 device. And also has second PC with NVidia GTX1050. On this both device, GST-MFX select wrong DRI device.
libva info: VA-API version 1.3.0 libva info: va_getDriverName() returns 0
libva info: User 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_3
DRM_IOCTL_I915_GEM_APERTURE failed: Недопустимый аргумент
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 1
I have solve it, this way:
--- gstreamer-media-sdk-2.1.1.orig/gst-mfx/gst-libs/mfx/gstmfxdisplay.c
+++ gstreamer-media-sdk-2.1.1/gst-mfx/gst-libs/mfx/gstmfxdisplay.c
@@ -72,6 +72,11 @@ get_display_fd (GstMfxDisplay * display)
continue;
}
+ if (strcmp (udev_device_get_driver(parent), "i915")!=0) {
+ udev_device_unref (device);
+ continue;
+ }
+
devpath = udev_device_get_devnode (device);
priv->display_fd = open (devpath, O_RDWR | O_CLOEXEC);
if (priv->display_fd < 0) {
But don't think, this way is correct, because theoretically, not only the i915 could be a device driver. But it working. Is is possible to solve it? Or get right way for select? Some issue about this in libva-tools https://github.com/intel/intel-vaapi-driver/issues/293
Perhaps a cleaner solution would be to use an environmental variable to set the path of the DRM device instead of this hack.
What variable i should use? LIBVA_DEVICE_NAME / LIBVA_RENDER_DEVICE_NAME some else?
Maybe LIBVA_DEVICE_PATH could be a good name.
Do you mean it can be added to the code? Or is it already done?
It's not done. Could be added to the code....
Any progress?