Skip to content
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

ARMV7 (ARM 32bits) support #4870

Open
b3n-h4il opened this issue Feb 8, 2025 · 5 comments
Open

ARMV7 (ARM 32bits) support #4870

b3n-h4il opened this issue Feb 8, 2025 · 5 comments
Labels
compiler Issues related to building from source files, clang-tidy, and other compiler tech question Further information is requested

Comments

@b3n-h4il
Copy link

b3n-h4il commented Feb 8, 2025

Hello,

I'm developing a C++ application and plan on using Kùzu DB. Really like how easy it is to use the C++ library. I was wondering if it's possible to run Kùzu also in an ARM 32bits processor. The docs say that the precompiled files are for aarch64 and amd64. If I build them locally, on device, could I use the C++ library in a ARMV7 device?

@mewim
Copy link
Member

mewim commented Feb 8, 2025

Hi @b3n-h4il,

Kùzu should be compatible with 32-bit architecture. We recently launched a WebAssembly version which is 32-bit (wasm32). The source code can be compiled targeting 32 bit without change. However, whether it can work on your device will depend on your specific setup. If you would like to compile locally and push to device you will need to setup a cross-compilation tool chain. Also, since Kùzu uses some system calls internally, if you are using a customized lite version of the kernel (e.g. on an embedded system) it may not work for you.

@mewim mewim added question Further information is requested compiler Issues related to building from source files, clang-tidy, and other compiler tech labels Feb 8, 2025
@b3n-h4il
Copy link
Author

b3n-h4il commented Feb 8, 2025

Thank you for your quickly reply.
I tried building Kùzu from source, just finished. Built directly on the ARMV7 device I intend to run my app on, no cross-compiling, using it's own local packages. I can invoke the kuzu executable, and load data from the example in the docs in it. But when I query the db, I get Bus error. And the program just stops.
I'm using an Android device running Termux, and on top of it, Proot-Distro to have an openSUSE system.
This is the output of clang -dumpmachine: armv7hl-suse-linux-gnueabihf. Also, after creating a build folder inside the downloaded Git repo, I used this cmake command: cmake .. -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -D OS_NAME=linux -D OS_ARCH=armv7hl -G Ninja. Do you think I can't really run Kùzu on this system, or I've made a mistake somewhere? Should I not use the executable and just use the C++ libs built for this system (which is my main goal)?

@mewim
Copy link
Member

mewim commented Feb 10, 2025

I think if the CLI does not work correctly, it is not very likely that the C++ library will work correctly on this device. Bus error seems to be a memory error. One thing you can try is to use an alternative version of the buffer manager which is based on malloc instead of the default memory-mapping based buffer manager, which we use in 32-bit WASM environment. You can do this by changing

#define BM_MALLOC __WASM__
to #define BM_MALLOC true.

@b3n-h4il
Copy link
Author

Thanks again, I'll try that.

@b3n-h4il
Copy link
Author

b3n-h4il commented Feb 10, 2025

No luck,
I'm getting the bus error again:

kuzu> MATCH (a:User)-[f:Follows]->(b:User) RETURN a.name, b.name, f.since; Pipelines Finished: 1/2 Current Pipeline Progress: 100% [1] 27561 bus error ./kuzu ./demo_db

The build finishes without errors, and I can use the kuzu executable normally, and import csv data from the demo_db, but when I try to run a query, bus error.

I've created a fork based on the main branch in my personal account and changed the file you've pointed. You can ckeck it here, if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Issues related to building from source files, clang-tidy, and other compiler tech question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants