-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Risc-V compilation fails with "c++: error: '-march=native': ISA string must begin with rv32 or rv64" #91
Comments
hi,
as you wrote, to solve the problem of GCC hanging, simply add some swap
space.
For the "Illegal Instruction" problem, can you try deleting the build
directory and rerunning cmake by specifying MAX_SPEED=OFF? This should
build a binary using only generic RISC-V instructions (in GCC, this is
equivalent to not specifying march at all).
Vito
|
Thanks for the suggestion, I tried yesterday but I didn't delete the files, for some reason I thought it was sufficient.
|
Thanks for your patience: from the --ops-printf output, it's clear that this is an XNNPACK issue. Can you try specifying "-DXNNPACK_ENABLE_RISCV_VECTOR=OFF" when you run cmake (when building XNNPACK)? Ie: cmake -DXNNPACK_BUILD_TESTS=OFF -DXNNPACK_BUILD_BENCHMARKS=OFF -DXNNPACK_ENABLE_RISCV_VECTOR=OFF .. PS: please remove and recreate the XNNPACK "build" directory, before executing the command. Thank you, Vito |
Awesome, thanks, we are making progress, although it still fails generation on the Diffusion step with an error coming from this line. Full pastebin here, last relevant lines:
Commands i've run for XNNPACK, as you asked:
and for OnnxStream:
|
So yes, using |
Awesome!
The need to specify "--rpi" is due to the fact that this particular
processor does not support native fp16 arithmetic.
Vito
|
Full error after executing this step using CPU SG2000 on the Milk-V Duo S.:
In file
OnnxStream/src/build/CMakeFiles/sd.dir/flags.make
the 9th line readsCXX_FLAGS = -std=gnu++20 -O3 -march=native
.I edited it even if it was autogenerated and told me not to edit it, sue me.
Changing that line to
CXX_FLAGS = -std=gnu++20 -O3 -march=rv64imafdc_zicsr_zifencei
makes it compile successfully (after adding a swapfile as the device only has 512MB of RAM) with some warnings:It does unfortunately explode when executed, as follows:
Last few lines of strace:
I see you mention in #10 that the compilation hangs in certain circumstances and also
Illegal Instruction
error in Termux, in this case both happen but I don't have any occurrence of-march=native
.Not sure if I should continue troubleshooting this, imma throw the towel for today, opening this issue to help someone else that might find this same error and suffer with me in the meantime.
p.s. love this project, thanks ❤️
The text was updated successfully, but these errors were encountered: