Repository navigation
Description
Current behavior 🐛
An iOS app that gets WebGPU from the NuGet packages can't start: the WebGPU backend can't find any wgpu function, and the app terminates.
- WebGpuGraphicsProvider/WebGpu: context factory threw (EntryPointNotFoundException) (System.InvalidOperationException)
*** Terminating app due to uncaught exception 'System.InvalidOperationException', reason: 'No registered backend could initialize on this host. ...'
Cause:
- On iOS, wgpu-native is linked statically and the WebGPU loader resolves
webgputo the main program handle, so it finds only exported symbols. - The package's
_UnoWebGpuLinkIosNative(Uno.WinUI.Composition.WebGpu.targets) addslibwgpu_native.aas aNativeReference, but doesn't list its functions asReferenceNativeSymbol. The final link only exports listed symbols. - Measured on the app:
nm -gUon the app binary finds 0wgpusymbols, while the package'siossimulator-arm64/libwgpu_native.ahas 228 publicwgpu*functions. - Uno's in-repo build doesn't have the problem:
_ProvisionWgpuNativeIosinwgpu-native.targetslists every publicwgpu*function asReferenceNativeSymbol. Uno's CI has no iOS WebGPU lane, so the package path isn't covered.
Expected behavior 🎯
An app that references WebGPU through the packages starts on iOS, as the in-repo SamplesApp does.
How to reproduce it (as minimally and precisely as possible) 🔬
-
iOS app with
<UnoFeatures>Skia;WebGpu</UnoFeatures>that registers the WebGPU backend:UnoPlatformHostBuilder.Create() .App(() => new App()) .UseAppleUIKit() .GraphicsBackend(WebGpuBackend.CreateGraphicsProvider()) .GeometryFactory(ManagedBackend.CreateGeometryFactory()) .Build();
-
Build it in Release for the simulator (
-r iossimulator-arm64) and run it: it terminates at startup with the exception above.
Seen with the Uno Gallery's WebGPU canary build on an iOS 26.5 simulator.
Workaround 🛠️
Export the symbols from the app, as the in-repo target does (needs macOS nm). Verified: with it, the app starts on WebGPU and the Gallery's runtime tests pass (9 passed, 1 skipped).
<Target Name="ExportWgpuSymbols" AfterTargets="_UnoWebGpuLinkIosNative"
Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And Exists('$(_UnoWgpuIosLib)')">
<Exec Command="nm -gUj '$(_UnoWgpuIosLib)' 2>/dev/null | grep '^_wgpu' | sed 's/^_//' | sort -u > '$(IntermediateOutputPath)wgpu.symbols'" />
<ReadLinesFromFile File="$(IntermediateOutputPath)wgpu.symbols">
<Output TaskParameter="Lines" ItemName="_WgpuSymbol" />
</ReadLinesFromFile>
<ItemGroup>
<ReferenceNativeSymbol Include="@(_WgpuSymbol)" SymbolType="Function" />
</ItemGroup>
</Target>A possible fix: the same ReferenceNativeSymbol list in the package's _UnoWebGpuLinkIosNative, generated at pack time.
Affected platforms 📱💻🖥️
iOS (and tvOS by code reading)
Uno.Sdk version (and other relevant versions) 📦
- Uno.Sdk 7.0.0-dev.87 (
Uno.WinUIandUno.WinUI.Composition.WebGpu7.0.0-dev.2420) - iOS 26.5 simulator; Xcode 27.0, iOS workload 26.5.10318 (
-p:ValidateXcodeVersion=false)
IDE version 🧑💻
None: dotnet CLI.
Anything else we need to know? 💬
Found while setting up the Uno Gallery's WebGPU canary.
Activity
ci(canary): Draw the iOS head with WebGPU in the WebGPU canary
build(samplesapp): Link iOS WebGPU through the package wiring
fix(webgpu): Export the wgpu functions from iOS apps
build(samplesapp): Link iOS WebGPU through the package wiring
build(samplesapp): Link iOS WebGPU through the package wiring
build(samplesapp): Link iOS WebGPU through the package wiring