Is there any source of libTorch without NNPACK?


I wish to run libtorch for Conv1D layers on a robot. I used the CXX_ABI-12.1-cpu version. But it got stuck and produced the error of Could not initialize NNPACK! Reason: Unsupported hardware.

I searched for the issue and found that NNPACK requires avx2 instruction set, which might not be supported on my embedding system oriented CPU.

So I am searching for a way to re-compile libTorch without NNPACK. Is that possible? Do I need to replace the precompiled code source or just add some argument like USE_NNPACK=False to CMake? How will the running speed be influenced if I got rid of NNPACK?

Suggestions will be appreciated.

Yes, you can use USE_NNPACK=0 to disable the NNPACK usage during a source build.

I’m unsure what exactly the baseline would be, since your current approach isn’t working at all using NNPACK.