[Debian-science-sagemath] Problems with CPU extensions used by dependencies

Ximin Luo infinity0 at debian.org
Wed Aug 10 16:37:00 UTC 2016


Ximin Luo:
> Tobias Hansen:
>> On 08/09/2016 11:27 PM, Jerome BENOIT wrote:
>>>
>>>
>>> On 09/08/16 23:18, Tobias Hansen wrote:
>>>> sse, avx2 and so on are instruction set extensions that not every CPU
>>>> supports. Since yours (and Ximins) do not support avx2 and fma and mine
>>>> does, and some packages were apparently built using these instructions,
>>>> it makes sense that you have more failing tests than me.
>>>
>>> deb-sci-sage packages ? unstable ones ?
>>>
>>
>> fflas-ffpack, which is in unstable. And possibly givaro and linbox,
>> because they all belong together. Ximin wrote today he will rebuild them
>> locally and see if that helps.
>>
> 
> I built fflas-ffpack locally today and I'm still getting "illegal instruction" in the tests. It's possible we'll have to rebuild its dependencies too, but I didn't get around to that yet.
> 
> I also filed #833846 for fflas-ffpack which has been fixed, so Debian should see it soon.
> 

Here is how to detect AVX/FMA more directly (instead of guessing based on the pkg-config):

$ objdump -S /usr/lib/x86_64-linux-gnu/liblinboxsage.so | grep '\b\(ymm\|zmm\|vfm\)' | head -n3
   b3016:	c4 e2 d9 99 04 d8    	vfmadd132sd (%rax,%rbx,8),%xmm4,%xmm0
   b7d4b:	c4 e2 e9 b9 c1       	vfmadd231sd %xmm1,%xmm2,%xmm0
   b7dcb:	c4 e2 e9 b9 c1       	vfmadd231sd %xmm1,%xmm2,%xmm0

$ objdump -S /usr/lib/x86_64-linux-gnu/liblinbox.so | grep '\b\(ymm\|zmm\|vfm\)' | head -n3
   16336:	c4 e2 f1 99 05 41 f1 	vfmadd132sd 0xf141(%rip),%xmm1,%xmm0        # 25480 <_ZTSN6LinBox18PreconditionFailedE@@Base+0x20>
   1639c:	c4 e2 f9 a9 0d f3 f0 	vfmadd213sd 0xf0f3(%rip),%xmm0,%xmm1        # 25498 <_ZTSN6LinBox18PreconditionFailedE@@Base+0x38>
   168d8:	c4 e2 f9 99 54 24 10 	vfmadd132sd 0x10(%rsp),%xmm0,%xmm2

ymm/zmm are AVX registers [1] and vfm* are FMA instructions [2].

So, we will need to upload a new linbox. OTOH givaro appears to be fine. I'm unlikely to have time myself in the next few weeks, so feel free to jump in ahead of me. If you get any more "illegal instructions", you can proceed along similar lines to the above.

You can also grep for "\bxmm" to check for SSE, xmm* are SSE registers. Note that for Debian SSE is good for amd64, bad for i386, so it would be a shame to disable it completely. For example, m4ri enables SSE when DEB_HOST_ARCH_CPU is amd64.

More generally, I filed #833850 as a broader and cleaner solution to this problem.

X

[1] https://en.wikipedia.org/wiki/Advanced_Vector_Extensions
[2] https://en.wikipedia.org/wiki/FMA_instruction_set

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git



More information about the Debian-science-sagemath mailing list