ggerganov / whisper.cpp

Port of OpenAI's Whisper model in C/C++
MIT License
35.59k stars 3.63k forks source link

make call falls on debian in virtual box #1363

Open baeckerman83 opened 1 year ago

baeckerman83 commented 1 year ago

Hi! I run Virtual Box on my intel mac. In virtual box I run a debian.

Now I tried to make whisper. But it failed. What can I do?

ben@debian:~/test/whisper.cpp-master$ make base.en
I whisper.cpp build info: 
I UNAME_S:  Linux
I UNAME_P:  unknown
I UNAME_M:  x86_64
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3
I LDFLAGS:  
I CC:       cc (Debian 12.2.0-14) 12.2.0
I CXX:      g++ (Debian 12.2.0-14) 12.2.0

cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3   -c ggml.c -o ggml.o
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/include/immintrin.h:105,
                 from ggml.c:315:
/usr/lib/gcc/x86_64-linux-gnu/12/include/fmaintrin.h: In function ‘ggml_vec_dot_q4_0_q8_0’:
/usr/lib/gcc/x86_64-linux-gnu/12/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
ggml.c:2499:15: note: called from here
 2499 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/12/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
ggml.c:2499:15: note: called from here
 2499 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/12/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
ggml.c:2499:15: note: called from here
 2499 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/12/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
ggml.c:2499:15: note: called from here
 2499 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:299: ggml.o] Fehler 1
bobqianic commented 1 year ago

Could you please provide the console output of the lscpu command (inside virtual box)?

baeckerman83 commented 1 year ago

Hi!

Yes I can:

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 39 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Vendor ID: GenuineIntel Model name: Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz CPU family: 6 Model: 69 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 Stepping: 1 BogoMIPS: 5634,59 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xto pology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm invp cid_single pti fsgsbase bmi1 avx2 bmi2 invpcid md_clear flush_l1d Virtualization features: Hypervisor vendor: KVM Virtualization type: full Caches (sum of all):
L1d: 64 KiB (2 instances) L1i: 64 KiB (2 instances) L2: 512 KiB (2 instances) L3: 6 MiB (2 instances) NUMA:
NUMA node(s): 1 NUMA node0 CPU(s): 0,1 Vulnerabilities:
Gather data sampling: Not affected Itlb multihit: KVM: Mitigation: VMX unsupported L1tf: Mitigation; PTE Inversion Mds: Mitigation; Clear CPU buffers; SMT Host state unknown Meltdown: Mitigation; PTI Mmio stale data: Unknown: No mitigations Retbleed: Not affected Spec rstack overflow: Not affected Spec store bypass: Vulnerable Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Spectre v2: Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected Srbds: Unknown: Dependent on hypervisor status Tsx async abort: Not affected

joeyrobert commented 10 months ago

I'm using VirtualBox to run a Ubuntu 22.04 guest on a Windows 11 host. I also experienced this:

➜  Repos git clone https://github.com/ggerganov/whisper.cpp.git
Cloning into 'whisper.cpp'...
remote: Enumerating objects: 6470, done.
remote: Counting objects: 100% (1534/1534), done.
remote: Compressing objects: 100% (194/194), done.
remote: Total 6470 (delta 1399), reused 1423 (delta 1335), pack-reused 4936
Receiving objects: 100% (6470/6470), 9.98 MiB | 19.39 MiB/s, done.
Resolving deltas: 100% (4120/4120), done.
➜  Repos cd whisper.cpp 
➜  whisper.cpp git:(master) bash ./models/download-ggml-model.sh base.en
Downloading ggml model base.en from 'https://huggingface.co/ggerganov/whisper.cpp' ...
ggml-base.en.bin                                                    100%[==================================================================================================================================================================>] 141.11M  29.9MB/s    in 4.8s    
Done! Model 'base.en' saved in '/home/joey/Repos/whisper.cpp/models/ggml-base.en.bin'
You can now use it like this:

  $ ./main -m /home/joey/Repos/whisper.cpp/models/ggml-base.en.bin -f samples/jfk.wav

➜  whisper.cpp git:(master) make
I whisper.cpp build info: 
I UNAME_S:  Linux
I UNAME_P:  x86_64
I UNAME_M:  x86_64
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3
I LDFLAGS:  
I CC:       cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
I CXX:      g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3   -c ggml.c -o ggml.o
cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3   -c ggml-alloc.c -o ggml-alloc.o
cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3   -c ggml-backend.c -o ggml-backend.o
cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -pthread -mavx -mavx2 -msse3 -mssse3   -c ggml-quants.c -o ggml-quants.o
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:99,
                 from ggml-impl.h:75,
                 from ggml-quants.h:3,
                 from ggml-quants.c:1:
ggml-quants.c: In function ‘ggml_vec_dot_q4_0_q8_0’:
/usr/lib/gcc/x86_64-linux-gnu/11/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
ggml-quants.c:2865:15: note: called from here
 2865 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:99,
                 from ggml-impl.h:75,
                 from ggml-quants.h:3,
                 from ggml-quants.c:1:
/usr/lib/gcc/x86_64-linux-gnu/11/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
ggml-quants.c:2865:15: note: called from here
 2865 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:99,
                 from ggml-impl.h:75,
                 from ggml-quants.h:3,
                 from ggml-quants.c:1:
/usr/lib/gcc/x86_64-linux-gnu/11/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
ggml-quants.c:2865:15: note: called from here
 2865 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/11/include/immintrin.h:99,
                 from ggml-impl.h:75,
                 from ggml-quants.h:3,
                 from ggml-quants.c:1:
/usr/lib/gcc/x86_64-linux-gnu/11/include/fmaintrin.h:63:1: error: inlining failed in call to ‘always_inline’ ‘_mm256_fmadd_ps’: target specific option mismatch
   63 | _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
      | ^~~~~~~~~~~~~~~
ggml-quants.c:2865:15: note: called from here
 2865 |         acc = _mm256_fmadd_ps( d, q, acc );
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:308: ggml-quants.o] Error 1
➜  whisper.cpp git:(master) lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               GenuineIntel
  Model name:            13th Gen Intel(R) Core(TM) i7-1355U
    CPU family:          6
    Model:               186
    Thread(s) per core:  1
    Core(s) per socket:  4
    Socket(s):           1
    Stepping:            3
    BogoMIPS:            5222.42
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq vmx ssse3 cx16 sse4_1 sse4_2 x2apic movb
                         e popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 bmi2 invpcid rdseed clflushopt md_clear flush_l1d arch_capabilities
Virtualization features: 
  Virtualization:        VT-x
  Hypervisor vendor:     KVM
  Virtualization type:   full
Caches (sum of all):     
  L1d:                   128 KiB (4 instances)
  L1i:                   256 KiB (4 instances)
  L2:                    8 MiB (4 instances)
  L3:                    48 MiB (4 instances)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-3
Vulnerabilities:         
  Gather data sampling:  Not affected
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec rstack overflow:  Not affected
  Spec store bypass:     Vulnerable
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Retpolines, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Not affected
  Tsx async abort:       Not affected

I have Hyper-V disabled on my host and am using VT-x from virtualbox. Was hoping to transcribe some WAVs. 😄

joyyang1215 commented 6 months ago

Same error in VirtualBox Ubuntu18.04.

Here is the lscpu:

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 1 On-line CPU(s) list: 0 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 154 Model name: 12th Gen Intel(R) Core(TM) i7-1260P Stepping: 3 CPU MHz: 2495.998 BogoMIPS: 4991.99 Virtualization: VT-x Hypervisor vendor: KVM Virtualization type: full L1d cache: 48K L1i cache: 32K L2 cache: 1280K L3 cache: 18432K NUMA node0 CPU(s): 0 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single tpr_shadow flexpriority fsgsbase avx2 invpcid rdseed clflushopt md_clear flush_l1d arch_capabilities

VirtualBox has enabled "V": image