Github messages for voidlinux
 help / color / mirror / Atom feed
From: gt7-void <gt7-void@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [ISSUE] openblas: illegal instruction (nehalem)
Date: Sat, 20 Mar 2021 04:44:55 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-29604@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2376 bytes --]

New issue by gt7-void on void-packages repository

https://github.com/void-linux/void-packages/issues/29604

Description:
The cpu is a [xeon E5520](https://ark.intel.com/content/www/us/en/ark/products/40200/intel-xeon-processor-e5520-8m-cache-2-26-ghz-5-86-gt-s-intel-qpi.html) (nehalem EP)
The following short program shows the issue:
```
#include "cblas.h"

int main ()
{
        double a[4] = {1.,2.,3.,4.};
        double b[4] = {4.,3.,2.,1.};
        double c[4];
        cblas_dgemm(CblasRowMajor, CblasNoTrans,CblasNoTrans,2,2,2,1., a,2,b,2,0.,c,2);
        if ( (c[0]!=8.) && (c[1]!=5.) && (c[2]!=20.) && (c[3]!=13))
                return -1;
        else
                return 0;
}
```

Compile and run with
```
$ gcc test-blas.c -I /usr/include/openblas -lopenblas -o test-blas
$ ./test-blas 
Illegal instruction
```

debugging shows the fault is in `cblas_dgemm ()` from `/usr/lib/libopenblas.so.0`, more precisely at `cblas_dgemm+20`:
```
   0x00007ffff6427d80 <+0>:     push   %r15
   0x00007ffff6427d82 <+2>:     mov    %edx,%r10d
   0x00007ffff6427d85 <+5>:     push   %r14
   0x00007ffff6427d87 <+7>:     push   %r13
   0x00007ffff6427d89 <+9>:     push   %r12
   0x00007ffff6427d8b <+11>:    push   %rbp
   0x00007ffff6427d8c <+12>:    push   %rbx
   0x00007ffff6427d8d <+13>:    sub    $0xa8,%rsp
=> 0x00007ffff6427d94 <+20>:    vmovsd %xmm0,0x8(%rsp)
   0x00007ffff6427d9a <+26>:    mov    0xe0(%rsp),%rdx
   0x00007ffff6427da2 <+34>:    mov    0xf0(%rsp),%r11
   0x00007ffff6427daa <+42>:    vmovsd %xmm1,(%rsp)
   0x00007ffff6427daf <+47>:    mov    0x100(%rsp),%rax
   0x00007ffff6427db7 <+55>:    mov    %fs:0x28,%rbx
```

Instruction is `vmovsd` -- I guess not available in this cpu (how would I know? is this avx? if so, how did this instruction end up there?)

Here are my cpuflags:
```
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 syscall nx rdtscp lm con
                                 stant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pd
                                 cm dca sse4_1 sse4_2 popcnt lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm ida flush_l1d
```



             reply	other threads:[~2021-03-20  3:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20  3:44 gt7-void [this message]
2021-03-20  4:21 ` ericonr
2021-03-21  4:20 ` gt7-void
2021-03-21  4:23 ` ericonr
2021-03-21  4:35 ` gt7-void
2021-03-21 13:28 ` ericonr
2021-03-21 13:29 ` [ISSUE] [CLOSED] " ericonr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-29604@inbox.vuxu.org \
    --to=gt7-void@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).