abhiTronix / raspberry-pi-cross-compilers

Latest GCC Cross Compiler & Native (ARM & ARM64) CI generated precompiled standalone toolchains for all Raspberry Pis. 🍇
https://sourceforge.net/projects/raspberry-pi-cross-compilers
GNU General Public License v3.0
594 stars 104 forks source link

[Solved] Bullseye Toolchain Error: selected processor does not support `vsdot.s8 q10,q9,d4[0]' in ARM mode #90

Closed distlibs closed 2 years ago

distlibs commented 2 years ago

I was trying to compile tensorflow-lite 2.7 with Raspberry Pi GCC Cross-Compiler Toolchains (Bullseye). I got error:

...
[ 73%] Building C object _deps/xnnpack-build/CMakeFiles/XNNPACK.dir/src/qc8-igemm/gen/1x16c4-minmax-fp32-neondot.c.o
[ 73%] Building C object _deps/xnnpack-build/CMakeFiles/XNNPACK.dir/src/qc8-igemm/gen/4x8c4-minmax-fp32-neondot.c.o
[ 73%] Building C object _deps/xnnpack-build/CMakeFiles/XNNPACK.dir/src/qc8-igemm/gen/4x16c4-minmax-fp32-neondot.c.o
/tmp/ccLir1WO.s: Assembler messages:
/tmp/ccLir1WO.s:60: Error: selected processor does not support `vsdot.s8 q8,q11,d7[0]' in ARM mode
/tmp/ccLir1WO.s:62: Error: selected processor does not support `vsdot.s8 q10,q9,d7[0]' in ARM mode
/tmp/ccLir1WO.s:65: Error: selected processor does not support `vsdot.s8 q8,q9,d7[1]' in ARM mode
/tmp/ccLir1WO.s:69: Error: selected processor does not support `vsdot.s8 q10,q9,d7[1]' in ARM mode
/tmp/ccLir1WO.s:141: Error: selected processor does not support `vsdot.s8 q10,q9,d7[0]' in ARM mode
/tmp/ccLir1WO.s:144: Error: selected processor does not support `vsdot.s8 q8,q11,d7[0]' in ARM mode
make[2]: *** [_deps/xnnpack-build/CMakeFiles/XNNPACK.dir/build.make:5458: _deps/xnnpack-build/CMakeFiles/XNNPACK.dir/src/qc8-gemm/gen/1x8c4-minmax-fp32-neondot.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/tmp/ccpalmhZ.s: Assembler messages:

Using Buster toolchain tensorflow-lite compiles without any errors.

It can be related with:

Maybe you can apply patch like you did here https://github.com/abhiTronix/raspberry-pi-cross-compilers/issues/89

abhiTronix commented 2 years ago

Using Buster toolchain tensorflow-lite compiles without any errors.

It can be related with:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101723 Cross-compilation for RPi3 (armv7) fails on assembly google/XNNPACK#1465 CMake build error on armv7 with latest gcc google/XNNPACK#2003

@distlibs Thanks for bug report. What I'm understanding is that GCC 9-to-11 series is affected by this bug when Binutils >2.33 is used. More specifically Binutils 2.35.1 used in Bullseye is causing this bug in our case. And, this bug is already fixed in master branch of GCC >9 but haven't been included in releases branches like releases/gcc-10.3.0 which was updated 8 months ago.

Solution:

This patch will be released with upcoming version of GCC-10 and GCC-11. Untill then, we can clone patched releases/gcc-10 branch directly for compiling GCC >=10.3.0 binaries for Bullseye to resolve this bug. But we cannot do the same for GCC-10.2.0 since, master branch will also override its version to >10.2.0 rendering it useless for cross-compiling. So just use >=10.3.0 for compiling & cross-compiling tensorflow.

distlibs commented 2 years ago

Binaries cross-compiled with GCC 10.3.0 will be compatible with Raspberry Pi 4 which runs Bullseye with GCC 10.2.1?

abhiTronix commented 2 years ago

Yes, aren't you using Raspberry Pi GCC-10.3.0 Native-Compiler Toolchains (Bullseye) right now? The GCC version doesn't matter, but only GLIBC, KERNEL and BINUTILS version matters, which remains the same.

distlibs commented 2 years ago

I am using right now GCC-10.2.0 Raspberry Pi Cross-Compiler Toolchains (Bullseye). I made mistake, I updated original post. Download link.

abhiTronix commented 2 years ago

Yes, you can use GCC-10.3.0 instead.

distlibs commented 2 years ago

So I need to wait until you clone patched releases/gcc-10 branch directly and pre-compile GCC 10.3.0 binaries for Bullseye? New Raspberry Pi GCC 10.3.0 Cross-Compiler Toolchains (Bullseye) binaries will be uploaded SourceForge where I can download?

abhiTronix commented 2 years ago

You need to wait untill v3.1.0 Toolchains are released, and thereby uploaded to Sourceforge after successful compiling. You should watch this repository to get notify when that happens.

abhiTronix commented 2 years ago

@distlibs Patch has been added. Please wait for CI workflows to finish and then I'll make the release.

abhiTronix commented 2 years ago

@distlibs v3.1.0-alpha toolchains are in build and soon be available on Sourceforge.

abhiTronix commented 2 years ago

This issue has been resolved in the latest Toolchains version v3.1.0-alpha and GCC-10.3.0. Download it from here: https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.3.0/

distlibs commented 2 years ago

Thanks. Compilation finished successfully using GCC-10.3.0 Raspberry Pi Cross-Compiler Toolchains (Bullseye).