Faiss: FAISS on Raspberry Pi

Created on 30 Dec 2019  ·  9Comments  ·  Source: facebookresearch/faiss

Summary

Installing FAISS for python (from source) on raspberry pi throws an error:
Makefile:22: recipe for target 'swigfaiss.o' failed
The above error is thrown after a long list of errors, the first of which is:
swigfaiss.cpp:3348:3: error: #error "SWIG wrapped code invalid in 32 bit architecture, regenerate code using -DSWIGWORDSIZE32"
I have also attached the complete log.txt.

Any help would be appreciated.

Platform

Raspberry Pi 3B+

OS: Raspbian

Running on:

  • [x] CPU
  • [ ] GPU

Interface:

  • [ ] C++
  • [x] Python

Reproduction instructions

  1. Configured FAISS by ./configure --without-cuda (configuration file successfully recognizes python)
  2. Compiled and installed using: make -j4 & make install (Successfully compiles and installs)
  3. Try to install python wrapper using: make -C python (throws error)
question

Most helpful comment

We compiled FAISS successfully on Raspberry Pi 4B and integrated it into Milvus: https://github.com/milvus-io/milvus/tree/aarch64

Platform information:
CPU: Cortex-A72(armv8).
OS: Ubuntu 18.04

Main change is about compiling option.

Detailed change please refer to: https://github.com/milvus-io/milvus/commit/651b1224ae293262782b3e4a29418952baa135e9
FAISS located under directory: core/src/index/thirdparty/faiss

All 9 comments

I am quite pessimistic about the possibility to compile with a 32 bit arch. Can you compile with -m64 ?

Trying to do make -C python -m 64 end up giving make: *** No rule to make target '64'. Stop.

Any idea of what kind of changes I would need to do to make it work with 32 bit arch? What does the regenerate code using -DSWIGWORDSIZE32 refer to?

SWIGWORDSIZE32 is probably a flag needed for SWIG.

My point is that it might be easier to set up a compile chain in 64 bits than to port Faiss to 32 bits.

We compiled successfully on 64-bit Linux on Raspberry Pi.

If you feel like it, please share as much info as possible here on how to compile for Raspberry Pi.

I'm hitting the same error when trying to install faiss on a raspberry pi, with armv7l
Do you have any news on this?

We compiled FAISS successfully on Raspberry Pi 4B and integrated it into Milvus: https://github.com/milvus-io/milvus/tree/aarch64

Platform information:
CPU: Cortex-A72(armv8).
OS: Ubuntu 18.04

Main change is about compiling option.

Detailed change please refer to: https://github.com/milvus-io/milvus/commit/651b1224ae293262782b3e4a29418952baa135e9
FAISS located under directory: core/src/index/thirdparty/faiss

Excellent! Thanks.
Closing issue.

Hi, Can't Faiss run on 32-bit ARMV7?

Was this page helpful?
0 / 5 - 0 ratings