[solved][Vulkan][Android] Loader of vulkan(module.loadlibrary_vulkan) is not presented


#1

Hi,

When trying to deploy to android with vulkan, I have the error at runtime:

Loader of vulkan(module.loadlibrary_vulkan) is not presented

although I did compile the tvm4j runtime with USE_VULKAN=1 in config.mk of the application’s jni folder, and Application.mk contains:

ifeq ($(USE_VULKAN), 1)
    APP_CPPFLAGS += -DTVM_VULKAN_RUNTIME=1
    APP_LDFLAGS += -lvulkan
endif

The device I am using is a Galaxy S7 with android version 8.0, vulkan is installed and working (I ran a vulkan demo app).
Why is vulkan failing to load by TVM runtime?


#3

Solved:
apps/android_deploy/app/src/main/jni/tvm_runtime.h does not include the vulkan module headers.
Adding:

#ifdef TVM_VULKAN_RUNTIME
#include "../src/runtime/vulkan/vulkan_device_api.cc"
#include "../src/runtime/vulkan/vulkan_module.cc"
#endif

to the file solves the problem.
I will make a pull request on outdated android examples once I got them running properly.