mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Console error message encountered: "No suitable Metal simulator can be found."

Open klundberg opened this issue 2 years ago • 2 comments

Environment

  • Xcode version: 13.4.1 (on a system that also has Xcode 14 beta 3 installed)
  • iOS version: 15.5
  • Devices affected: iPad 9th gen
  • Maps SDK Version: 10.6.0

Observed behavior and steps to reproduce

I'm trying to show a simple map with some outlines around some geojson shapes. Recently, I've noticed some error messages in the console that begin with "[Mapbox] [Error, maps-ios/MapView]: No suitable Metal simulator can be found.". It then tells me a few other errors like "Could not find vertex function" and "Can't create pipeline for clipping_mask shader." When this happens, the app the map is embedded in freezes and eventually crashes, as the main thread appears to be blocked. The map view shows its ornaments in the corners, but the map content itself doesn't show up.

Expected behavior

No freezing or crashing behavior, and show the map I'm trying to show properly.

Notes / preliminary analysis

I've noticed this happen a couple times now. The first time I was able to work around it by resetting my simulator with "Erase all content and settings" in the Devices menu, or the "restart" device menu, and it worked for a day or two but started back up soon after. I'm not sure if there's an issue with my simulator version, as I've installed Xcode 14 beta 3 and have run it , which I know can update the core simulator framework and might have some strange effects, but I'm unsure if its the cause.

Additional links and references

klundberg avatar Jul 19 '22 18:07 klundberg

@klundberg I too have Xcode 14 beta 3 and 13.4.1 running on my device and I'm not experiencing these error messages or crashes. Do you have a sample app that you can provide that reproduces this behavior?

ZiZasaurus avatar Jul 20 '22 13:07 ZiZasaurus

having xcode beta was just a guess and to be thorough with my report, it may not be the issue.

I don't have a sample app, since it depends on internal company data to draw some geojsons on the map at the moment (though even the map tiles don't ever draw when it happens). I do have a bit more of logging to the console I can share though (using my iPad 9th gen simulator running iOS 15.5, again after installing an xcode 14 beta if that's relevant):

2022-07-27 10:58:55.186256-0400 MyApp[40604:20533904] Metal API Validation Enabled
2022-07-27 10:58:55.237079-0400 MyApp[40604:20533904] [Mapbox] [Error, maps-ios/MapView]: No suitable Metal simulator can be found.
2022-07-27 10:58:55.260039-0400 MyApp[40604:20533904] [Mapbox] [Info, maps-core]: Using Metal render backend
2022-07-27 10:58:55.415402-0400 MyApp[40604:20533904] [Mapbox] [Error, maps-ios/Location]: <MapboxMaps.AppleLocationProvider: 0x600002659180> did fail with error: Error Domain=kCLErrorDomain Code=0 "(null)"
2022-07-27 10:58:55.440338-0400 MyApp[40604:20533904] [CAMetalLayer nextDrawable] returning nil because device is nil.
2022-07-27 10:58:55.441035-0400 MyApp[40604:20533904] [Mapbox] [Error, maps-ios/Location]: <MapboxMaps.AppleLocationProvider: 0x600002659180> did fail with error: Error Domain=kCLErrorDomain Code=0 "(null)"
2022-07-27 10:58:55.458922-0400 MyApp[40604:20533904] [CAMetalLayer nextDrawable] returning nil because device is nil.
2022-07-27 10:58:55.474063-0400 MyApp[40604:20533904] [CAMetalLayer nextDrawable] returning nil because device is nil.

After these log statements run, if I pause in the debugger it seems to be waiting on a semaphore, called by a c++ ::render() function that's called by this drawInMTKView method at this line:

#8	0x0000000147b2225b in -[MBMMetalViewDelegate drawInMTKView:] at /Users/<username redacted>/project/internal/platform/ios/src/metal/view_delegate.mm:9

klundberg avatar Jul 27 '22 15:07 klundberg