whisper.cpp
whisper.cpp copied to clipboard
issue #470 - working 32-bit ARM
Fixes Illegal instruction at runtime.
NOTE not tested on Raspberry. Only on Armbian with OdroixXU4.
Tested with neon fpu flag. Also had success with:
-mfpu=neon-fp16-mfpu=neon-vfpv3
We need a way to detect 32-bit ARM in the Makefile and choose the respective flags
That's what this PR does, the original code did not do this. Can you clarify in case I'm missing something?
My Raspberry Pi 4 reports armv7l, but I can use -mfpu=neon-fp-armv8 successfully.
It has much better performance compared to the proposed -mfpu=neon.
Does -mfpu=neon-fp-armv8 not work for you?
My Raspberry Pi 4 reports
armv7l, but I can use-mfpu=neon-fp-armv8successfully. It has much better performance compared to the proposed-mfpu=neon.
Ahhh, sounds like you have a 64-bit board but a 32-bit Operating System? Can you confirm?
Does
-mfpu=neon-fp-armv8not work for you?
No it does not, I do NOT have a 64-bit Pi 4, I have an armv7 board with no v8 extensions (see https://forums.raspberrypi.com/viewtopic.php?t=282791 for Pi4 self reporting, it reports as v7 in a 32-bit OS but allows access to v8 instructions). My board is ONLY 32-bit.
New idea/proposal (assuming you have a really have pi4 board with 32-bit OS), in the 32-bit OS (v7) code block we add an additional conditional for detecting a raspberry pi board? Thoughts?
Slightly off topic, you might find moving to a 64-bit OS gains you some extra performance else where for your board, then the makefile would drop into the next "if" check.
Yes, it looks like I am using a 32-bit OS on my 64-bit RPi4. Thanks for clearing this up. It would be very useful to have a branch in the Makefile for my use case, since I don't see mysql upgrading the OS anytime soon. But if there is no clean way to do it, we can merge it like this and I will simply modify the Makefile locally when working on my RPi4
What do you get for:
cat /proc/cpuinfo |grep 'model name'
(| head -1) ?
If you get ARMv7 Processor rev 4 (v7l) (4 or above) that might be the (slightly messy) heuristic that could work 🤞 .
I don't have a Pi4 to check with 😿 This might also work for Pi 3b+ boards too.
$ cat /proc/cpuinfo |grep 'model name'
model name : ARMv7 Processor rev 3 (v7l)
Hmmm, that completely surprised me. Sadly, I think your idea of a private change is the safest :-( I was really hoping we could automate this nicely.
Alternative idea, mention pi 4 can use v8 extensions in a comment (e.g. the ones that worked for you) so its documented as a potential option?