Skip to content

VA sample: device autodetection changed#19560

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
mshabunin:va-sample-fix
Feb 18, 2021
Merged

VA sample: device autodetection changed#19560
opencv-pushbot merged 1 commit intoopencv:masterfrom
mshabunin:va-sample-fix

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

The code worked with assumption that PCI devices sorted by name match DRI devices order, i.e. device with ID 0000:00:02 should be represented by card0/renderD128 and device 0000:01:00 by card1/renderD129. But in reality this is wrong:

$ ls -l /dev/dri/by-path/
lrwxrwxrwx. 1 root root  8 Feb 18 16:30 pci-0000:00:02.0-card -> ../card1
lrwxrwxrwx. 1 root root 13 Feb 18 16:30 pci-0000:00:02.0-render -> ../renderD129
lrwxrwxrwx. 1 root root  8 Feb 18 16:30 pci-0000:01:00.0-card -> ../card0
lrwxrwxrwx. 1 root root 13 Feb 18 16:30 pci-0000:01:00.0-render -> ../renderD128

Instead we probe drm endpoint as it seem to contain correct DRI device names:

$ ls  /sys/bus/pci/devices/0000\:01\:00.0/drm
card0  controlD64  renderD128
$ ls  /sys/bus/pci/devices/0000\:00\:02.0/drm
card1  controlD65  renderD129

@opencv-pushbot opencv-pushbot merged commit 504ff97 into opencv:master Feb 18, 2021
@mshabunin mshabunin deleted the va-sample-fix branch February 19, 2021 09:00
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants