Commit ecd97d5
[ET-VK] Add etvk.use_existing_vma config to avoid duplicate VMA symbols
Pull Request resolved: #18522
Apps that already link VulkanMemoryAllocatorInstantiated (e.g. Stella, via IGL
or Diamond/Skia) get duplicate symbol errors when also linking ExecuTorch's
Vulkan backend, because vma_api.cpp defines VMA_IMPLEMENTATION independently.
Add a Buck config flag `etvk.use_existing_vma=1` that:
- Defines ETVK_USE_META_VMA, which makes vma_api.h match the third-party
VulkanMemoryAllocatorInstantiated config (Vulkan 1.2, dynamic function
loading) so struct layouts agree
- Skips VMA_IMPLEMENTATION in vma_api.cpp so no duplicate definitions are
emitted
- Swaps the Buck dep from VulkanMemoryAllocator_xplat (header-only) to
VulkanMemoryAllocatorInstantiated (pre-compiled)
Off by default — no behavior change for existing builds or OSS.
ghstack-source-id: 364855830
@exported-using-ghexport
Differential Revision: [D98250268](https://our.internmc.facebook.com/intern/diff/D98250268/)1 parent 6b63d3d commit ecd97d5
File tree
3 files changed
+43
-3
lines changed- backends/vulkan
- runtime/vk_api/memory
3 files changed
+43
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
16 | 42 | | |
17 | 43 | | |
18 | 44 | | |
| |||
56 | 82 | | |
57 | 83 | | |
58 | 84 | | |
| 85 | + | |
| 86 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
| 159 | + | |
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
| |||
185 | 190 | | |
186 | 191 | | |
187 | 192 | | |
188 | | - | |
189 | | - | |
190 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
191 | 201 | | |
192 | 202 | | |
193 | 203 | | |
| |||
0 commit comments