From: Gour <go...@go...> - 2009-11-28 10:59:02
Attachments:
signature.asc
|
Hiya! Everything started with crashes I experienced with dvdwizard which lead us to transcode. However, transcode dev says it's the problem with libmpeg2 lib. What is the issue? When invoking transcode I get the following: > cmove asm decode_mpeg2.c libmpeg2 acceleration: mmxext which means that libmpeg2 says that mmxext instruction set can be uses, although my CPU (i7 860) does not support it, according to cpuinfo: 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 rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm ida tpr_shadow vnmi flexpriority ept vpid Inspecting the libmpeg2 code I've found the following: #if defined(ARCH_X86) || defined(ARCH_X86_64) static inline uint32_t arch_accel (uint32_t accel) { if (accel & (MPEG2_ACCEL_X86_3DNOW | MPEG2_ACCEL_X86_MMXEXT)) accel |= MPEG2_ACCEL_X86_MMX; if (accel & (MPEG2_ACCEL_X86_SSE2 | MPEG2_ACCEL_X86_SSE3)) accel |= MPEG2_ACCEL_X86_MMXEXT; if (accel & (MPEG2_ACCEL_X86_SSE3)) accel |= MPEG2_ACCEL_X86_SSE2; in cpu_accel.c which, if I read C correctly means, that libmpeg2 sets MMXEXT set if the following is true: (MPEG2_ACCEL_X86_SSE2 | MPEG2_ACCEL_X86_SSE3) which is not the case with my cpu having support for SSE2, but not MMXEXT. Am I right, or something else is going on that libmpeg2 sends 'wrong' info about acceleration to the transcode? Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- |
From: Gour <go...@go...> - 2009-11-28 14:58:13
Attachments:
signature.asc
|
On Sat, 28 Nov 2009 13:22:21 +0200 >>>>>> "Rémi" == "Rémi Denis-Courmont" <re...@re...> wrote: Rémi> AFAIK, MMX extensions are the subset of SSE which is safe on Rémi> operating systems that don't support SSE. Hence, it is perfectly Rémi> normal that you don't find it in the CPU flags - it is implied by SSE. Here is the reply I got on transcode list which confirms my 'theory'... <quote> >Francesco> `mmxext' is deep jargon (mostly found on linux field AFAIK) >Francesco> for some MMX extended instructions that aren't explicitly >Francesco> advertised; I can't recall the exact details but those were >Francesco> added together with the first round of SSE or something like >Francesco> that. >Francesco> So, unless I missing something huge, the core i7 definitley >Francesco> support them :) I'm afraid you're missing something. (: MMXEXT (like 3DNow!) is an AMD-specific extension that was added in some old AMD CPUs back before AMD and Intel settled on a common SIMD instruction set. The MMXEXT instructions have since been superseded by SSE in both AMD and Intel CPUs, so Intel never added support for them. The solution to this particular problem is to fix the following bug in libmpeg2: >#if defined(ARCH_X86) || defined(ARCH_X86_64) >static inline uint32_t arch_accel (uint32_t accel) >{ [...] > if (accel & (MPEG2_ACCEL_X86_SSE2 | MPEG2_ACCEL_X86_SSE3)) > accel |= MPEG2_ACCEL_X86_MMXEXT; "MMXEXT" should be changed to "MMX" here (or the clause should be deleted entirely if the MMX flag is not needed in SSE environments). </quote> Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- |
From: Michel L. <wa...@zo...> - 2009-12-06 09:28:21
|
On Sat, Nov 28, 2009 at 03:58:00PM +0100, Gour wrote: > The solution to this particular problem is to fix the following bug in > libmpeg2: > > >#if defined(ARCH_X86) || defined(ARCH_X86_64) > >static inline uint32_t arch_accel (uint32_t accel) > >{ > [...] > > if (accel & (MPEG2_ACCEL_X86_SSE2 | MPEG2_ACCEL_X86_SSE3)) > > accel |= MPEG2_ACCEL_X86_MMXEXT; > > "MMXEXT" should be changed to "MMX" here (or the clause should be deleted > entirely if the MMX flag is not needed in SSE environments). > </quote> * Does your crash go away if you clear the MPEG2_ACCEL_X86_MMXEXT flag ? * Do you know what CPU instruction the crash happens on ? In libmpeg2, MMXEXT indicates the availability of pshufw and pavgb instructions. My understanding is that CPUs advertising the SSE capability must support these instructions. -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies. |
From: Joo M. <joo...@us...> - 2009-12-07 17:45:28
|
Hello Michel, ---- Am Sun, 6 Dec 2009 01:04:41 -0800 schrieb Michel Lespinasse <wa...@zo...>: > * Does your crash go away if you clear the MPEG2_ACCEL_X86_MMXEXT flag ? Gour had tested this with a patch for libmpeg2 and it don't crash anymore. > In libmpeg2, MMXEXT indicates the availability of pshufw and > pavgb instructions. My understanding is that CPUs advertising the > SSE capability must support these instructions. It seems there are a difference between AMD-CPUs and Intel-CPUs. But over the all, there is an option "--accel" in transcode, with which I could manual define the usable cpu accelerations. But libmpeg2 (or transcode ?) ignore this manual definition. So its not possible for user to disable the using of cpu accelerations inside transcode / libmpeg2. Or is there another way? This option would be a simple solution for dvdwizard. Ciao, Joo |