libva icon indicating copy to clipboard operation
libva copied to clipboard

Add new interface vaGetDeviceInfo

Open AntonGrishin opened this issue 5 years ago • 4 comments

For get specific information about device from the backend driver

Signed-off-by: Anton Grishin [email protected]

AntonGrishin avatar Mar 05 '20 11:03 AntonGrishin

what's the purpose to get such information?

XinfengZhang avatar Mar 06 '20 06:03 XinfengZhang

@XinfengZhang

what's the purpose to get such information?

I think that such an API and nicely selected information to expose would be useful. I have few cases when this is needed in mind:

  1. To answer classic questions like: "I have just installed driver, does it work?", "I have dual GPU system, which GPU works?" As of now we need to explain a pretty low level theory of operation - see below. But for the user who just installed something and typed 'vainfo' we can significantly simplify life by just printing out device ID!
  2. In case of X11 or Wayland displays such info is more trickier to get - again printing this out in vainfo will help.
  3. Sometimes higher level libraries differentiate features depending on device IDs and device caps - that's what mediasdk is doing and that's where this request comes from. As of now mediasdk is limited to i915 driver only and such API will permit to relax this restiction.

You might have 2 cards available as: /dev/dri/card0 /dev/dri/card1 /dev/dri/renderD128 /dev/dri/renderD129

D128 corresponds to card0. Make sure that you user login can access both devices – check that your account is a member of groups which own above devices. If not – add to both. Usually that’s render and video groups: sudo usermod -aG video sudo usermod -aG render Don’t forget to relogin to the system for above commands take effect.

To identify which card is which run this: # cat /sys/class/drm/card0/device/device xxxx # cat /sys/class/drm/card1/device/device yyyy The output is device ID. Check against device ID lists what is what.

dvrogozh avatar Mar 06 '20 16:03 dvrogozh

hi @dvrogozh

  1. all component has such question, not only media, so I think you may need another standalone method which is not related with media or 3d or ocl
  2. application will convey the device fd into media , such as vainfo --device .
  3. feature set should depend on the capability report , not device id

XinfengZhang avatar Apr 30 '20 09:04 XinfengZhang

I reviewed this PR and did not have concern about the specific code changes. Just not very clear about the motivation of code changes although I saw simliar code changes in MSDK(the usage of MSDK is in sample app which demonstrates to the user how to use dual adapter).

If it is for workload submission to the different device, app can query caps and submit the corresponding workload. Currently, iHD does not expose the specific features which is related to local memory.

Thanks, Furong

FurongZhang avatar Jul 20 '20 02:07 FurongZhang