Executorch Vulkan delegate on embedded Linux

Hello. I’m using a embedded linux platform and want to deploy pytorch models on the ARM MALI GPU. I’m setting the Vulkan delegate but having problems when building the runner with Vulkan. All tutorials I’ve found are related to Android development and Vulkan linking of libraries is done automatically with the Android NDK, but I’m not able to link the CMAKE to my GLSL compiler. I have glslangValidator installed instead of glslc.

Is that supported? Are there any other limitations we should consider when using the Vulkan delegate out of Android?

Thanks in advance,
Alex.

@ssjia can you answer this one?

Hello @Alex_G_Gener, thanks for your interest in the Vulkan delegate and apologies for the super late reply. Anecdotally, I am able to compile and execute the Vulkan delegate on a Linux platform. You can try the same with the following commands

cd <executorch_root>

# Clean repo
./install_requirements.sh --clean
git submodule sync
git submodule update --init

# Install requirements
./install_requirements.sh --pybind

# Build ExecuTorch libs with Vulkan
(rm -rf cmake-out && \
  cmake . \
  -DCMAKE_INSTALL_PREFIX=cmake-out \
  -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
  -DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
  -DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
  -DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
  -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
  -DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
  -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
  -DEXECUTORCH_BUILD_TESTS=ON \
  -DEXECUTORCH_BUILD_VULKAN=ON \
  -Bcmake-out && \
  cmake --build cmake-out -j64 --target install)

# Build Vulkan test binary
(rm -rf cmake-out/backends/vulkan/test && \
  cmake backends/vulkan/test \
    -DCMAKE_INSTALL_PREFIX=cmake-out \
    -DPYTHON_EXECUTABLE=python \
    -Bcmake-out/backends/vulkan/test && \
  cmake --build cmake-out/backends/vulkan/test -j16)

# Execute test binary
cmake-out/backends/vulkan/test/vulkan_compute_api_test --gtest_filter="*"

As for glslc vs glslangValidator, there is currently an assumption that glslc is the shader compiler of choice since that is what’s included in the Android NDK. However, it should be easy to add a build configuration to specify that glslangValidator should be used instead.

1 Like