intel / libva

Libva is an implementation for VA-API (Video Acceleration API)
http://intel.github.io/libva/
Other
660 stars 300 forks source link

Loads media-driver on unsupported Intel GPUs #466

Open sebastinas opened 4 years ago

sebastinas commented 4 years ago

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.

dvrogozh commented 3 years ago

@XinfengZhang : if we have media-driver and i965 driver on the platform which is not supported by media-driver, then what's the expected load sequence? Do we expect media-driver loaded first, failed to initialize, and then i965 driver will be tried by libva in turn?

From the Debian bug report:

Thread 25 "vlc" received signal SIGILL, Illegal instruction.
[Switching to Thread 0x8b7ffb40 (LWP 7832)]
0x86f9d6fb in ?? () from /usr/lib/i386-linux-gnu/dri/iHD_drv_video.so

Model name:                      Pentium(R) Dual-Core CPU       T4300  @ 2.10GHz
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe nx lm constant_tsc arch_perfmon pebs bts cpuid aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm dtherm

The issue with illegal instruction is likely (I am 99% sure) happens because of media-driver compilation flags. It populates sse4+ instruction set while Penryn supports only sse3: https://github.com/intel/media-driver/blob/92b912da0cbfa1d511b706be9f0b2e898e35e275/media_driver/cmake/linux/media_compile_flags_linux.cmake#L47 Even if driver does not use sse4 intrinsics, c++ std library implementation has dependency from sse. Hence this issue.

Per my mind issue is not in libva. Libva is transparent in the relevance to underlying CPU/GPU. For what it cares it tries to load more or less relevant driver corresponding to the identified vendor gpu. For intel it tries media-driver, then i965 in this order. So, driver should be capable to be called and kind of queried whether it supports current CPU and GPU. Effectively, we need to avoid compiling load/query part of the driver with specific sse instruction set.

sebastinas commented 3 years ago

ACK, if this is not considered a bug in libva, then media-driver needs to ensure that its __vaDriverInit is compiled without any additional flags.

dvrogozh commented 3 years ago

Filed intel/media-driver#1081 to track changes on driver level.

dvrogozh commented 3 years ago

Pay attention on https://github.com/intel/media-driver/issues/1081#issuecomment-768544197. Shortly:

hilga007 commented 2 years ago

Pay attention on intel/media-driver#1081 (comment). Shortly:

* Try media-driver `>= intel-media-21.1.0` - this contains partial fix

* gmmlib might have similar issue which would result in ultimate SIGILL failure on media stack, but in different place. We are working on a fix.

Filed intel/media-driver#1081 to track changes on driver level.

Link throws a 404 error for some reason. Just checking in to confirm this is still replicable in 2022 using Penryn, with the same situation as the person who posted this issue. Searched for the error; this was the top result.

No resolution, guessing?