Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support load of media-driver on unsupported platforms #1081

Open
dvrogozh opened this issue Nov 9, 2020 · 15 comments
Open

Support load of media-driver on unsupported platforms #1081

dvrogozh opened this issue Nov 9, 2020 · 15 comments
Assignees
Labels
Bug Issue: identify as a bug CM C for media In Progress PR: still under discussion

Comments

@dvrogozh
Copy link
Contributor

dvrogozh commented Nov 9, 2020

From intel/libva#466

Forwarding a bug report from Debian: libva tries to load media-driver on Penryn. Since that platform is not supported by media-driver, it should not be loaded in this case.

What we need to do:

  1. Remove cpu-specific flags from gmmlib build
  2. Remove cpu-specific flags from driver build

@sebastinas : fyi

@dvrogozh
Copy link
Contributor Author

dvrogozh commented Nov 9, 2020

Places in driver which uses specific cpu instructions:

egorovdanil added a commit to egorovdanil/media-driver that referenced this issue Nov 12, 2020
egorovdanil added a commit to egorovdanil/media-driver that referenced this issue Nov 12, 2020
egorovdanil added a commit to egorovdanil/media-driver that referenced this issue Nov 12, 2020
egorovdanil added a commit to egorovdanil/media-driver that referenced this issue Nov 17, 2020
@XinfengZhang XinfengZhang linked a pull request Nov 18, 2020 that will close this issue
egorovdanil added a commit to egorovdanil/media-driver that referenced this issue Nov 25, 2020
@eero-t
Copy link

eero-t commented Dec 8, 2020

Is there some plan on doing run-time CPU feature detection & conditional SSE/AVX usage, for things where performance matters (such as CPU side format conversions)?

@paulmenzel
Copy link

This is also Debian bug report 974772.

I am seeing this on a GM45 device with Pentium Dual-Core CPU T4500.

$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub [8086:2a40] (rev 07)
00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a42] (rev 07)
00:02.1 Display controller [0380]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a43] (rev 07)
[…]

Any idea, what commit introduced the regression? VLC didn’t crash in the past to my knowledge.

@sebastinas
Copy link
Contributor

@paulmenzel I think you need to install i965-va-driver and remove intel-media-va-driver.

@paulmenzel
Copy link

@paulmenzel I think you need to install i965-va-driver and remove intel-media-va-driver.

Yes, thank you. i965-va-driver-shaders is already installed, and MPEG2 decoding is available. (H264 support was never finished.)

@XinfengZhang XinfengZhang added P2 Medium priority Bug Issue: identify as a bug CM C for media In Progress PR: still under discussion labels Dec 31, 2020
@dvrogozh
Copy link
Contributor Author

While installing i965-va-driver might provide a workaround, our side desire is to get this behavior fixed in intel-media-va-driver since that's the driver we have on a new platforms.

As a step to the ultimate fix we've merged ff55f78. This change removes cpu instruction set specific compile options from driver build. Those few places which really require specific instruction sets are compiled separately and we added code to dynamically check whether underlying instruction set is actually supported by the CPU. This fix is available starting from >= intel-media-21.1.0 release. I recommend to update.

This being said, I suspect that issue might not be fully solved yet for the reason that gmmlib from which driver depends on was not fixed in the same way. Hence, if there is any call to gmmlib (and it has similar issue) we will see similar SIGILL failure, but in different place. We would appreciate a help if someone will try this out and report the actual behavior back to us.

@paulmenzel
Copy link

Thank you for the update. You might be able to reproduce this issue in QEMU.

@egorovdanil
Copy link
Contributor

I tried to run vainfo on an unsupported platform (amd) and found out that the exit from intel-media-va-driver occurs before any entry into gmmlib:
DdiMedia__Initialize() exit location: media_libva.cpp#L1736
gmmlib entry point location in DdiMedia__Initialize(): media_libva.cpp#L1823

@XinfengZhang XinfengZhang removed the P2 Medium priority label Oct 26, 2021
@XinfengZhang
Copy link
Contributor

#1446 as first step

@sebastinas
Copy link
Contributor

The approach in #1446 does not help us (Debian). Intrinsics can be used and that's not the problem. The build just needs to ensure that vaDriverInit is able to detect whether the GPU is supported without using those features. After that it's perfectly fine to use them.

@dvrogozh
Copy link
Contributor Author

dvrogozh commented May 9, 2023

@XinfengZhang : when we last looked into this story 2 years ago, we left in a state that changes to media-driver were done, but follow up was needed for gmmlib. Maybe something has changed during 2 years, but I still think that the pattern we followed should be continued: we need runtime checks for supported features for both media driver and gmmlib.

@XinfengZhang
Copy link
Contributor

#1446 is using to enable media driver on non-x86 CPU platform, it is for D-graphics which is plugged in non-x86 platform. but it could be used to remove the dependencies of x86 intrinsics, gmmlib also have such flags to remove the dependencies.

@sebastinas I suppose you want a auto CPU (not GPU)feature detection in runtime? if it is GPU feature, vaDriverInit will failed on un-support GPU.

so, a quick summary, you want a runtime check of CPU feature to enable/disable some media driver feature which depend on these CPU feature. :)

@sebastinas
Copy link
Contributor

No. We need that vaDriverInit is able to run without any additional CPU features. If the GPU is supported, the CPU features are automatically supported. If the GPU is not supported, vaDriverInit need bails out. But all the checks if the GPU is supported or not, may not use any additional CPU features beyond the baseline.

@eero-t
Copy link

eero-t commented May 10, 2023

If the GPU is supported, the CPU features are automatically supported.

@sebastinas I think you mean that all the intrinsics currently used in the driver are supported on all HW where media driver supported GPUs can be currently used (i.e. Broadwell and up for iGPUs, and x86 machines supporting the Intel dGPUs)?

However, after media driver supports Intel dGPUs also on other than x86 machines, that's not any more true (Xe kernel driver brings Intel dGPU support for other architectures than x86).

@sebastinas
Copy link
Contributor

@eero-t Okay, this may have changed. Last time I looked at it (2-3 years ago), that would have been enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issue: identify as a bug CM C for media In Progress PR: still under discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants