Android build and vulkan_wrapper.h

I’m trying to build libtorch for Android, using the build_pytorch_android.sh script, but am getting errors due to Vulkan:

  Cannot find source file:

    /Users/steve/Library/Android/sdk/ndk/25.1.8937393/sources/third_party/vulkan/src/common/vulkan_wrapper.h

And indeed, that file does not exist there.

Can someone point me to some up-to-date instructions on how to build the native library for Android?

1 Like

For anyone coming across this with the same question, I had to specifically disable both Vulkan and XNNPACK support to build the native code for Android (-DUSE_VULKAN=OFF -DUSE_XNNPACK=OFF).

I would be interested in any tips on how to build without disabling those features, though, since I’m not sure what the consequences is of disabling them!

1 Like

I built with version 21 of the NDK, and I no longer had to turn off those features.

1 Like