Repository navigation
Commit c36b06a
authored
[Vulkan] Fix Ninja build failure by removing wildcard dependencies (pytorch#16394)
### Summary
Fixes Ninja build support for the Vulkan backend by removing wildcard
usage in `DEPENDS`.
Fixes pytorch#16354
Fixes pytorch#14984
The
[backends/vulkan/cmake/ShaderLibrary.cmake](cci:7://file:///Users/srirambharadwaj/Documents/iiitb/moonlight/executorch/backends/vulkan/cmake/ShaderLibrary.cmake:0:0-0:0)
file previously used a wildcard (`${shaders_path}/*`) in the `DEPENDS`
clause of a custom command. Ninja does not support wildcard expansion in
dependencies, which caused the build to fail with:
`ninja: error: '.../glsl/*', needed by 'vk_compute_shaders/spv.cpp',
missing and no known rule to make it`.
This PR replaces the wildcard usage with an explicit [file(GLOB
...)](cci:1://file:///Users/srirambharadwaj/Documents/iiitb/moonlight/executorch/examples/portable/executor_runner/executor_runner.cpp:165:0-180:1)
command to resolve the source files before passing them to `DEPENDS`,
making the build compatible with the Ninja generator.
### Test plan
Verified the fix by rebuilding the Android `executor_runner` using
Ninja:
1. **Clean Build:** `rm -rf cmake-out-android`
2. **Configure:**
```bash
cmake . -G Ninja -DCMAKE_INSTALL_PREFIX=cmake-out-android \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake
\
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-26 \
-DEXECUTORCH_BUILD_VULKAN=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=OFF \
-DPYTHON_EXECUTABLE=$(which python) \
-Bcmake-out-android
```
3. **Build:** `ninja -C cmake-out-android` -> **Success** (previously
failed).
4. **Runtime Verification:** Pushed the built `executor_runner` to an
Android device and executed a MobileNetV2 model to ensure the binary
loads and runs (confirmed same runtime behavior as the Make build).
cc @SS-JIA @manuelcandales @digantdesai @cbilgin1 parent 09b5bdb commit c36b06a
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
73 | | - | |
| 78 | + | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| |||
0 commit comments