Skip to content

Commit ebabf52

Browse files
kirklandsignSS-JIA
andauthored
Android use new glslc (#14596)
Validated by workflow https://github.com/pytorch/executorch/actions/runs/18013292360 Currently download SDK each time when we build vulkan AAR. Co-authored-by: Stephen Jia <ssjia@meta.com>
1 parent 87c44c7 commit ebabf52

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

.github/workflows/android-release-artifacts.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ jobs:
9494
9595
FLAVOR="${{ inputs.flavor }}"
9696
if [[ "$FLAVOR" == "vulkan+xnnpack" || -z "$FLAVOR" ]]; then
97+
curl -O https://sdk.lunarg.com/sdk/download/1.4.321.1/linux/vulkansdk-linux-x86_64-1.4.321.1.tar.xz
98+
tar xf vulkansdk-linux-x86_64-1.4.321.1.tar.xz -C /tmp
99+
export PATH="/tmp/1.4.321.1/x86_64/bin:$PATH"
97100
export EXECUTORCH_BUILD_VULKAN=ON
98101
fi
99102

backends/vulkan/cmake/ShaderLibrary.cmake

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,17 @@ if(NOT EXECUTORCH_ROOT)
2424
message("WARNING: EXECUTORCH_ROOT is not set! A failure is likely imminent.")
2525
endif()
2626

27-
if(ANDROID)
28-
if(NOT ANDROID_NDK)
29-
message(FATAL_ERROR "ANDROID_NDK not set")
30-
endif()
31-
32-
if(NOT GLSLC_PATH)
33-
set(GLSLC_PATH
34-
"${ANDROID_NDK}/shader-tools/${ANDROID_NDK_HOST_SYSTEM_NAME}/glslc"
35-
)
36-
endif()
37-
else()
38-
find_program(GLSLC_PATH glslc PATHS $ENV{PATH})
27+
find_program(GLSLC_PATH glslc PATHS $ENV{PATH})
3928

40-
if(NOT GLSLC_PATH)
41-
message(FATAL_ERROR "USE_VULKAN glslc not found")
42-
endif()
29+
if(NOT GLSLC_PATH)
30+
message(
31+
FATAL_ERROR
32+
"glslc from the Vulkan SDK must be installed to build the Vulkan backend. "
33+
"Please install the Vulkan SDK 1.4.321.0 or newer from "
34+
"https://vulkan.lunarg.com/sdk/home and ensure that the glslc binary is in your PATH. "
35+
"Note that the glslc distributed with the Android NDK is not compatible since it "
36+
"does not support the GL_EXT_integer_dot_product extension. "
37+
)
4338
endif()
4439

4540
# Required to enable linking with --whole-archive

0 commit comments

Comments
 (0)