OnnxStream icon indicating copy to clipboard operation
OnnxStream copied to clipboard

compiling on rpi zero 2

Open novaspirit opened this issue 1 year ago • 13 comments

i'm following the instrcutions trying to compile xnnpack on raspberry pi zero 2 and running into issues am i missing something else i need to install?

`Scanning dependencies of target microkernels-prod [ 5%] Building C object CMakeFiles/microkernels-prod.dir/src/amalgam/gen/scalar.c.o [ 5%] Building C object CMakeFiles/microkernels-prod.dir/src/amalgam/gen/scalar-aarch32.c.o [ 5%] Building C object CMakeFiles/microkernels-prod.dir/src/amalgam/gen/armsimd32.c.o /home/pi/XNNPACK/src/amalgam/gen/armsimd32.c: In function ‘xnn_qs8_gemm_minmax_fp32_ukernel_1x2c4__armsimd32’: /home/pi/XNNPACK/src/amalgam/gen/armsimd32.c:48:13: error: unknown type name ‘int8x4_t’ const int8x4_t va0 = (int8x4_t) unaligned_load_s32(a0); a0 += 4; ^~~~~~~~ /home/pi/XNNPACK/src/amalgam/gen/armsimd32.c:48:29: error: ‘int8x4_t’ undeclared (first use in this function); did you mean ‘int64_t’? const int8x4_t va0 = (int8x4_t) unaligned_load_s32(a0); a0 += 4; ^~~~~~~~ int64_t

make[2]: *** [CMakeFiles/microkernels-prod.dir/build.make:89: CMakeFiles/microkernels-prod.dir/src/amalgam/gen/armsimd32.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:468: CMakeFiles/microkernels-prod.dir/all] Error 2
make: *** [Makefile:130: all] Error 2`

novaspirit avatar Jul 22 '23 21:07 novaspirit

just a follow up, rpi os 64bit - unable to compile xnnpack rpi os 32bit - unable to compile xnnpack due to binutils ubuntu 22.04 32bit - compiles xnnpack

novaspirit avatar Jul 23 '23 05:07 novaspirit

hi,

I just tried with a semi-fresh install of Raspberry Pi OS Lite 64-bit, and it works.

Can you do a test with a fresh install of this OS?

Thanks, --Vito

vitoplantamura avatar Jul 23 '23 06:07 vitoplantamura

you are correct, I am able to compile XNNpack with RpiOS 64bit if you don't do apt update && apt upgrade since that will update the kernel and break compile.

novaspirit avatar Jul 23 '23 14:07 novaspirit

hi,

I did an update, an upgrade, a reboot and a full rebuild of XnnPack, and it works...

The problem is elsewhere.

Can you do a test with a fresh install of Raspberry Pi OS Lite 64-bit, and let me know?

thanks, Vito

vitoplantamura avatar Jul 23 '23 21:07 vitoplantamura

hi, I did an update, an upgrade, a reboot and a full rebuild of XnnPack, and it works... The problem is elsewhere. Can you do a test with a fresh install of Raspberry Pi OS Lite 64-bit, and let me know? thanks, Vito

i did a fresh install of raspberry pi os lite 64bit, here are the steps i took.

sudo apt update && sudo apt upgrade -y
sudo raspi-config -> performace -> gpu 16mb
sudo reboot

followed your instructions to compile XNNPACK

modified dphys memory from 100mb to 512mb to compile OnnxStream

WindowsTerminal_Y1QkFytT4f

each step is about 26mins

novaspirit avatar Jul 24 '23 23:07 novaspirit

I'm running into similar problems, would you be willing to share exact OS versions/image hashes and the XNNPACK git commit hash that led to a successful compile?

jarombouts avatar Jul 25 '23 18:07 jarombouts

I'm running into similar problems, would you be willing to share exact OS versions/image hashes and the XNNPACK git commit hash that led to a successful compile?

using raspberry pi os lite (64bit) Release 2023-05-03 bf982e56b0374712d93e185780d121e3f5c3d5e33052a95f72f9aed468d58fa7

XNNPACK git checkout 3f56c91b492c93676a9b5ca4dd51f528b704c309

novaspirit avatar Jul 25 '23 18:07 novaspirit

Thanks a lot! Will report back if I run into failures.

jarombouts avatar Jul 25 '23 19:07 jarombouts

@novaspirit,

thank you for your feedback and for your time,

Vito

vitoplantamura avatar Jul 26 '23 01:07 vitoplantamura

@novaspirit, thank you for your feedback and for your time, Vito

no problem gald to help, i'm acutally working on a youtube video for this and should be up on my channel in a few days https://youtube.com/novaspirittech

novaspirit avatar Jul 26 '23 01:07 novaspirit

Very cool!!!

Just subscribed!

vitoplantamura avatar Jul 26 '23 02:07 vitoplantamura

faruk@raspberrypi:~/OnnxStream/src/build $ cmake -DMAX_SPEED=ON -DXNNPACK_DIR= /home/faruk/XNNPACK .. I wrote this line but I still got this error "Please specify XNNPACK_DIR." What should I do?

ofarukdemirtas avatar Sep 17 '23 16:09 ofarukdemirtas

@ofarukdemirtas, please remove the space after "-DXNNPACK_DIR="

Vito

vitoplantamura avatar Sep 18 '23 03:09 vitoplantamura