Skip to content

iOS: an app using WebGPU from the NuGet packages can't start (EntryPointNotFoundException): the package doesn't export the wgpu symbols #25657

Closed

Description

@agneszitte

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 webgpu to the main program handle, so it finds only exported symbols.
  • The package's _UnoWebGpuLinkIosNative (Uno.WinUI.Composition.WebGpu.targets) adds libwgpu_native.a as a NativeReference, but doesn't list its functions as ReferenceNativeSymbol. The final link only exports listed symbols.
  • Measured on the app: nm -gU on the app binary finds 0 wgpu symbols, while the package's iossimulator-arm64/libwgpu_native.a has 228 public wgpu* functions.
  • Uno's in-repo build doesn't have the problem: _ProvisionWgpuNativeIos in wgpu-native.targets lists every public wgpu* function as ReferenceNativeSymbol. 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) 🔬

  1. 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();
  2. 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&gt;/dev/null | grep '^_wgpu' | sed 's/^_//' | sort -u &gt; '$(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.WinUI and Uno.WinUI.Composition.WebGpu 7.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.

Metadata

Metadata

Assignees

Labels

7.0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions