Skip to content

Executorch Vulkan delegate fails to build vulkan_executor_runner without NDK #7343

Closed
@alexggener

Description

@alexggener

🐛 Describe the bug

Trying to use executorch Vulkan delegate 0.4.0 on a Jetson Orin with Vulkan installed.

Successfully installed executorch and tested without Vulkan delegate.
Configured CMAKE as:

(rm -rf cmake-vk-out && mkdir cmake-vk-out && cd cmake-vk-out && cmake .. -DEXECUTORCH_BUILD_VULKAN=ON)

CMAKE summary config is:

-- ******** Summary ********
--   CMAKE_BUILD_TYPE              : Debug
--   CMAKE_CXX_STANDARD            : 17
--   CMAKE_CXX_COMPILER_ID         : GNU
--   CMAKE_TOOLCHAIN_FILE          : 
--   BUCK2                         : /home/jetson/alex/executorch/cmake-vk-out/buck2-bin/buck2-49670bee56a7d8a7696409ca6fbf7551d2469787
--   PYTHON_EXECUTABLE             : python3
--   FLATC_EXECUTABLE              : flatc
--   EXECUTORCH_ENABLE_LOGGING              : ON
--   EXECUTORCH_ENABLE_PROGRAM_VERIFICATION : ON
--   EXECUTORCH_LOG_LEVEL                   : Info
--   EXECUTORCH_BUILD_ANDROID_JNI           : OFF
--   EXECUTORCH_BUILD_ARM_BAREMETAL         : OFF
--   EXECUTORCH_BUILD_COREML                : OFF
--   EXECUTORCH_BUILD_KERNELS_CUSTOM        : OFF
--   EXECUTORCH_BUILD_EXECUTOR_RUNNER       : ON
--   EXECUTORCH_BUILD_EXTENSION_DATA_LOADER : OFF
--   EXECUTORCH_BUILD_EXTENSION_MODULE      : OFF
--   EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL : OFF
--   EXECUTORCH_BUILD_EXTENSION_TENSOR      : OFF
--   EXECUTORCH_BUILD_FLATC                 : ON
--   EXECUTORCH_BUILD_GFLAGS                : ON
--   EXECUTORCH_BUILD_GTESTS                : OFF
--   EXECUTORCH_BUILD_HOST_TARGETS          : ON
--   EXECUTORCH_BUILD_MPS                   : OFF
--   EXECUTORCH_BUILD_PYBIND                : OFF
--   EXECUTORCH_BUILD_QNN                   : OFF
--   EXECUTORCH_BUILD_KERNELS_OPTIMIZED     : OFF
--   EXECUTORCH_BUILD_KERNELS_QUANTIZED     : OFF
--   EXECUTORCH_BUILD_DEVTOOLS              : OFF
--   EXECUTORCH_BUILD_SIZE_TEST             : OFF
--   EXECUTORCH_BUILD_XNNPACK               : OFF
--   EXECUTORCH_BUILD_VULKAN                : ON
--   EXECUTORCH_BUILD_PTHREADPOOL           : ON
--   EXECUTORCH_BUILD_CPUINFO               : ON

But failed when building the vulkan_executor_runner. See below the verbose log output of the error:

[ 23%] Building CXX object kernels/portable/CMakeFiles/portable_kernels.dir/cpu/op_clamp.cpp.o
cd /home/jetson/alex/executorch/cmake-vk-out/kernels/portable && /usr/bin/c++ -DET_MIN_LOG_LEVEL=Info -I/home/jetson/alex/executorch/.. -std=c++17 -O0 -g -std=gnu++17 -Wno-deprecated-declarations -fPIC -MD -MT kernels/portable/CMakeFiles/portable_kernels.dir/cpu/op_clamp.cpp.o -MF CMakeFiles/portable_kernels.dir/cpu/op_clamp.cpp.o.d -o CMakeFiles/portable_kernels.dir/cpu/op_clamp.cpp.o -c /home/jetson/alex/executorch/kernels/portable/cpu/op_clamp.cpp
In file included from /home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:9:
/home/jetson/alex/executorch/backends/vulkan/../../../executorch/backends/vulkan/runtime/graph/containers/Types.h:22:6: warning: elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword
   22 | enum class TypeTag : uint32_t {
      | ~~~~ ^~~~~
      |      -----
/home/jetson/alex/executorch/backends/vulkan/../../../executorch/backends/vulkan/runtime/graph/containers/Types.h:22:20: error: found ‘:’ in nested-name-specifier, expected ‘::’
   22 | enum class TypeTag : uint32_t {
      |                    ^
      |                    ::
/home/jetson/alex/executorch/backends/vulkan/../../../executorch/backends/vulkan/runtime/graph/containers/Types.h:22:12: error: ‘TypeTag’ has not been declared
   22 | enum class TypeTag : uint32_t {
      |            ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/../../../executorch/backends/vulkan/runtime/graph/containers/Types.h:22:31: error: expected unqualified-id before ‘{’ token
   22 | enum class TypeTag : uint32_t {
      |                               ^
/home/jetson/alex/executorch/backends/vulkan/../../../executorch/backends/vulkan/runtime/graph/containers/Types.h:42:51: error: ‘TypeTag’ does not name a type
   42 | std::ostream& operator<<(std::ostream& out, const TypeTag& tag);
      |                                                   ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:18:51: error: ‘TypeTag’ does not name a type
   18 | std::ostream& operator<<(std::ostream& out, const TypeTag& tag) {
      |                                                   ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp: In function ‘std::ostream& vkcompute::operator<<(std::ostream&, const int&)’:
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:20:5: note: in expansion of macro ‘PRINT_CASE’
   20 |     PRINT_CASE(NONE)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:21:5: note: in expansion of macro ‘PRINT_CASE’
   21 |     PRINT_CASE(INT)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:22:5: note: in expansion of macro ‘PRINT_CASE’
   22 |     PRINT_CASE(DOUBLE)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:23:5: note: in expansion of macro ‘PRINT_CASE’
   23 |     PRINT_CASE(BOOL)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:24:5: note: in expansion of macro ‘PRINT_CASE’
   24 |     PRINT_CASE(TENSOR)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:25:5: note: in expansion of macro ‘PRINT_CASE’
   25 |     PRINT_CASE(STAGING)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:26:5: note: in expansion of macro ‘PRINT_CASE’
   26 |     PRINT_CASE(TENSORREF)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:27:5: note: in expansion of macro ‘PRINT_CASE’
   27 |     PRINT_CASE(INTLIST)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:28:5: note: in expansion of macro ‘PRINT_CASE’
   28 |     PRINT_CASE(DOUBLELIST)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:29:5: note: in expansion of macro ‘PRINT_CASE’
   29 |     PRINT_CASE(BOOLLIST)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:30:5: note: in expansion of macro ‘PRINT_CASE’
   30 |     PRINT_CASE(VALUELIST)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:31:5: note: in expansion of macro ‘PRINT_CASE’
   31 |     PRINT_CASE(STRING)
      |     ^~~~~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:14:8: error: ‘TypeTag’ has not been declared
   14 |   case TypeTag::name:    \
      |        ^~~~~~~
/home/jetson/alex/executorch/backends/vulkan/runtime/graph/containers/Types.cpp:32:5: note: in expansion of macro ‘PRINT_CASE’
   32 |     PRINT_CASE(SYMINT)
      |     ^~~~~~~~~~
gmake[3]: *** [backends/vulkan/CMakeFiles/vulkan_backend.dir/build.make:191: backends/vulkan/CMakeFiles/vulkan_backend.dir/runtime/graph/containers/Types.cpp.o] Error 1

Seems like C++17 standard was not well configured, but it can be seen in the command that the flags -std=c++17 -O0 -g -std=gnu++17 are set.

Extra information about the device:
Ubuntu 22.04
Jetpack 6.1
GCC-13.1
Python 3.10
Vulkan 1.3.204
glslc info:
shaderc 2023.2-1
spirv-tools 2022.4+1.3.236.0-1
glslang 11.13.0-1
Target: SPIR-V 1.0

Versions

Error in cpuinfo: prctl(PR_SVE_GET_VL) failed
Collecting environment information...
PyTorch version: 2.5.0
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.5 LTS (aarch64)
GCC version: (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0
Clang version: Could not collect
CMake version: version 3.31.2
Libc version: glibc-2.35

Python version: 3.10.12 (main, Nov  6 2024, 20:22:13) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.148-tegra-aarch64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: 12.2.140
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: Orin (nvgpu)
Nvidia driver version: 540.4.0
cuDNN version: Probably one of the following:
/usr/lib/aarch64-linux-gnu/libcudnn.so.8.9.4
/usr/lib/aarch64-linux-gnu/libcudnn.so.9.3.0
/usr/lib/aarch64-linux-gnu/libcudnn_adv.so.9.3.0
/usr/lib/aarch64-linux-gnu/libcudnn_adv_infer.so.8.9.4
/usr/lib/aarch64-linux-gnu/libcudnn_adv_train.so.8.9.4
/usr/lib/aarch64-linux-gnu/libcudnn_cnn.so.9.3.0
/usr/lib/aarch64-linux-gnu/libcudnn_cnn_infer.so.8.9.4
/usr/lib/aarch64-linux-gnu/libcudnn_cnn_train.so.8.9.4
/usr/lib/aarch64-linux-gnu/libcudnn_engines_precompiled.so.9.3.0
/usr/lib/aarch64-linux-gnu/libcudnn_engines_runtime_compiled.so.9.3.0
/usr/lib/aarch64-linux-gnu/libcudnn_graph.so.9.3.0
/usr/lib/aarch64-linux-gnu/libcudnn_heuristic.so.9.3.0
/usr/lib/aarch64-linux-gnu/libcudnn_ops.so.9.3.0
/usr/lib/aarch64-linux-gnu/libcudnn_ops_infer.so.8.9.4
/usr/lib/aarch64-linux-gnu/libcudnn_ops_train.so.8.9.4
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       aarch64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
CPU(s):                             8
On-line CPU(s) list:                0-3
Off-line CPU(s) list:               4-7
Vendor ID:                          ARM
Model name:                         Cortex-A78AE
Model:                              1
Thread(s) per core:                 1
Core(s) per cluster:                4
Socket(s):                          -
Cluster(s):                         1
Stepping:                           r0p1
CPU max MHz:                        1984.0000
CPU min MHz:                        115.2000
BogoMIPS:                           62.50
Flags:                              fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp uscat ilrcpc flagm paca pacg
L1d cache:                          256 KiB (4 instances)
L1i cache:                          256 KiB (4 instances)
L2 cache:                           1 MiB (4 instances)
L3 cache:                           2 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-3
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:           Mitigation; __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; CSV2, but not BHB
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] executorch==0.4.0a0+6a085ff
[pip3] numpy==1.21.3
[pip3] torch==2.5.0
[pip3] torchaudio==2.5.0
[pip3] torchsr==1.0.4
[pip3] torchvision==0.20.0
[conda] Could not collect

Metadata

Metadata

Assignees

Labels

module: vulkanIssues related to the Vulkan delegate and code under backends/vulkan/triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions