Summary: | media-video/ffmpeg-4.3.1 compilation fails without mmxext cpuflag | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Maiken Akka <maikenakka> |
Component: | Current packages | Assignee: | Gentoo Media-video project <media-video> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | bugs, jstein, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | build.log |
Description
Maiken Akka
2020-11-03 13:08:29 UTC
It was a bug in ffmpeg. https://trac.ffmpeg.org/ticket/8986 The ffmpeg-developer was not a fan of the Gentoo generated configure options. I'm in over my head as it is. Check the link if you are interested. AFAIK, this is an ebuild bug: X86_CPU_REQUIRED_USE=" cpu_flags_x86_avx2? ( cpu_flags_x86_avx ) cpu_flags_x86_fma4? ( cpu_flags_x86_avx ) cpu_flags_x86_fma3? ( cpu_flags_x86_avx ) cpu_flags_x86_xop? ( cpu_flags_x86_avx ) cpu_flags_x86_avx? ( cpu_flags_x86_sse4_2 ) cpu_flags_x86_aes? ( cpu_flags_x86_sse4_2 ) cpu_flags_x86_sse4_2? ( cpu_flags_x86_sse4_1 ) cpu_flags_x86_sse4_1? ( cpu_flags_x86_ssse3 ) cpu_flags_x86_ssse3? ( cpu_flags_x86_sse3 ) cpu_flags_x86_sse3? ( cpu_flags_x86_sse2 ) cpu_flags_x86_sse2? ( cpu_flags_x86_sse ) cpu_flags_x86_sse? ( cpu_flags_x86_mmxext ) cpu_flags_x86_mmxext? ( cpu_flags_x86_mmx ) cpu_flags_x86_3dnowext? ( cpu_flags_x86_3dnow ) cpu_flags_x86_3dnow? ( cpu_flags_x86_mmx ) There are a bunch of assumptions here which are wrong. SSE does not require MMXext. In fact, MMXext is deprecated in recent chips like Apollo Lake/Goldmont. FMA4 is AMD specific (Buldozzer) and also independent of AVX, though current architectures that support it will support AVX. It is deprecated in ZEN cores and later. AES should not go with SSE4.2 (Nehalem+), as there are Pentium/Celeron from Core 3rd gen which support it but not AESNI. I don't think a package should be doing this kind of checks on a user set variable. At most, it should filter down configurations ffmpeg itself doesn't support. I haven't looked at the code but would be very surprised if MMXext is tied to SSE (and conversely up to SSE4.2). (In reply to Tiago Marques from comment #2) > FMA4 is AMD specific (Buldozzer) and also independent of AVX, though current > architectures that support it will support AVX. It is deprecated in ZEN > cores and later. It seems to me you are reading the constraints the opposite way. What should be read is "ffmpeg assumes an FMA4 capable cpu will have AVX" as you noted here, but the other comments are confusing to me. I think I'm reading it right but indeed FMA4 is really what doesn't matter. AES is also a mistake on my part, as it is not a dependency, so it's not an issue. The problem here is that SSE is requiring MMXext. You have recent cores without MMXext and only MMX. These cores support various versions of SSE and an example is Intel Goldmont and more recent. So the line: cpu_flags_x86_sse? ( cpu_flags_x86_mmxext ) Is not valid nowadays. This causes a recent core not being able to enable SSE and later instructions. (In reply to Tiago Marques from comment #4) > The problem here is that SSE is requiring MMXext. You have recent cores > without MMXext and only MMX. These cores support various versions of SSE and > an example is Intel Goldmont and more recent. So the line: > > cpu_flags_x86_sse? ( cpu_flags_x86_mmxext ) + + cpu_flags_x86_mmxext : Use the Extended MMX instruction set (a subset of SSE) ([mmxext] or [sse] in cpuinfo) ? (In reply to Alexis Ballier from comment #5) > (In reply to Tiago Marques from comment #4) > > The problem here is that SSE is requiring MMXext. You have recent cores > > without MMXext and only MMX. These cores support various versions of SSE and > > an example is Intel Goldmont and more recent. So the line: > > > > cpu_flags_x86_sse? ( cpu_flags_x86_mmxext ) > > > + + cpu_flags_x86_mmxext : Use the Extended MMX instruction set (a subset > of SSE) ([mmxext] or [sse] in cpuinfo) > > > ? Ok. I looked at it and while some sources say the full MMXext isn't in SSE, it seems to be included. Is it possible to remove it to follow CPUID flags correctly? As it is it will not compile on recent archs that don't announce MMXext and we auto create CPU_FLAGS_X86. I imagine this bug will keep popping up. (In reply to Tiago Marques from comment #6) > (In reply to Alexis Ballier from comment #5) > > (In reply to Tiago Marques from comment #4) > > > The problem here is that SSE is requiring MMXext. You have recent cores > > > without MMXext and only MMX. These cores support various versions of SSE and > > > an example is Intel Goldmont and more recent. So the line: > > > > > > cpu_flags_x86_sse? ( cpu_flags_x86_mmxext ) > > > > > > + + cpu_flags_x86_mmxext : Use the Extended MMX instruction set (a subset > > of SSE) ([mmxext] or [sse] in cpuinfo) > > > > > > ? > > Ok. I looked at it and while some sources say the full MMXext isn't in SSE, > it seems to be included. > > Is it possible to remove it to follow CPUID flags correctly? As it is it > will not compile on recent archs that don't announce MMXext and we auto > create CPU_FLAGS_X86. > I imagine this bug will keep popping up. cpuid2cpuflags handles it properly here $ cpuid2cpuflags CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3 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 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d |