Closed AlexanderKomarov closed 6 years ago
Hi Alexander: Could you explain more your use case? Is intel graphic card not exposed as renderD128 at your env? thanks
Hi xuguangxin, My PC has Nvidia GPU and Intel GPU. Nvidia is exposed as renderD128. Intel GPU is exposed as renderD129.
This is interesting. I run both GPUs together often. I never seen Nvidia create a D128 file. What driver are you using for Nvidia? This is also a problem for libva. The DRM open logic is the same as vainfo. t would be easy enough to use an environment variable.
Hi Jsorg thanks for the information.
Hi Alexander: It may need some efforts to add support for this. To quick work around your problem you can do:
Here is a quick patch if you want to use environment variable.
diff --git a/vaapi/vaapidisplay.cpp b/vaapi/vaapidisplay.cpp
index 0651be1..f9663e7 100644
--- a/vaapi/vaapidisplay.cpp
+++ b/vaapi/vaapidisplay.cpp
@@ -19,6 +19,7 @@
#endif
#include "vaapi/vaapidisplay.h"
+#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
@@ -130,7 +131,12 @@ class NativeDisplayDrm : public NativeDisplayBase{
if (acceptValidExternalHandle(display))
return true;
- m_handle = open("/dev/dri/renderD128", O_RDWR);
+ m_handle = -1;
+ char* device_env = getenv("VA_DRM_DEVICE");
+ if (device_env)
+ m_handle = open(device_env, O_RDWR);
+ if (m_handle < 0)
+ m_handle = open("/dev/dri/renderD128", O_RDWR);
if (m_handle < 0)
m_handle = open("/dev/dri/card0", O_RDWR);
m_selfCreated = true;
@jsorg71 , you are so fast. :) thanks for the patch, you can consider submit.
Not fast, just had this one laying around. I create #811 for this.
Hi @jsorg71 I use a driver from repo. Thanks for helping. I will try to use it.
libyami doesn't support choosing a device for executing. It uses a default device.