Skia on iOS GPU

114 views
Skip to first unread message

Dirk Weltz

unread,
Sep 7, 2021, 6:26:53 AM9/7/21
to skia-d...@googlegroups.com
Hello,

we get in trouble with a library, that uses SkiaSharp for drawing. I’m not sure, if this is a Problem with our library, SkiaSharp, Skia or the GPU on iOS. To investigate this, I have a question.

We use SkiaSharp 2.80.3 (so we are on M80) on iOS.

We draw the canvas (a gl view) as fast as possible (redraw it again and again) with some draw_images and some draw_path. After some time, we get into trouble. The app freezes and isn’t redrawn anymore. On the iOS console we see the following messages:

IOReturn IOGPUDevice::new_resource(IOGPUNewResourceArgs *, struct IOGPUNewResourceReturnData *, IOByteCount, uint32_t *): PID 40079 likely leaking IOGPUResource (count=46000)
IOReturn IOGPUDevice::new_resource(IOGPUNewResourceArgs *, struct IOGPUNewResourceReturnData *, IOByteCount, uint32_t *): PID 40079 likely leaking IOGPUResource (count=47000)
IOReturn IOGPUDevice::new_resource(IOGPUNewResourceArgs *, struct IOGPUNewResourceReturnData *, IOByteCount, uint32_t *): PID 40079 likely leaking IOGPUResource (count=48000)
IOReturn IOGPUDevice::new_resource(IOGPUNewResourceArgs *, struct IOGPUNewResourceReturnData *, IOByteCount, uint32_t *): PID 40079 likely leaking IOGPUResource (count=49000)
This goes until count=60000 and than freezes. It seems to me, that iOS runs out of memory for the resources.

So the question is: did someone see this before? Where do we have to search, where the problem starts? Any problem with not correct released resources?

Any help is appreciated. Thank you in advance of your help.

Best regards
Dirk

Dirk Weltz

unread,
Sep 8, 2021, 4:33:06 AM9/8/21
to skia-d...@googlegroups.com
Some more information: the crash log of the iPhone.

Date/Time:           2021-09-05 09:52:52.5998 +0200
Launch Time:         2021-09-05 09:52:03.1987 +0200
OS Version:          iPhone OS 14.7.1 (18G82)
Release Type:        User
Baseband Version:    4.04.00
Report Version:      104

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Termination Description: SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: application<com.mapsui.MemoryProvider>:59325 exhausted real (wall clock) time allowance of 10.00 seconds | ProcessVisibility: Background | ProcessState: Running | WatchdogEvent: scene-update | WatchdogVisibility: Background | WatchdogCPUStatistics: ( | "Elapsed total CPU time (seconds): 4.980 (user 4.980, system 0.000), 8% CPU", | "Elapsed application CPU time (seconds): 0.386, 1% CPU" | ) reportType:CrashLog maxTerminationResistance:Interactive>
Triggered by Thread:  0

Thread 0 name:  tid_103  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001aebdd908 0x1aebda000 + 14600
1   libsystem_kernel.dylib        	0x00000001aebdcd0c 0x1aebda000 + 11532
2   IOKit                         	0x000000018d3c9bb8 0x18d34e000 + 506808
3   IOKit                         	0x000000018d355c94 0x18d34e000 + 31892
4   IOGPU                         	0x00000001bd8279fc 0x1bd817000 + 68092
5   IOGPU                         	0x00000001bd821fd8 0x1bd817000 + 45016
6   IOGPU                         	0x00000001bd818a9c 0x1bd817000 + 6812
7   AGXMetalA11                   	0x00000001cc3cb298 0x1cc38c000 + 258712
8   AppleMetalGLRenderer          	0x00000001cb7c7364 0x1cb7c5000 + 9060
9   AppleMetalGLRenderer          	0x00000001cb7c7480 0x1cb7c5000 + 9344
10  AppleMetalGLRenderer          	0x00000001cb7d3138 0x1cb7c5000 + 57656
11  GLEngine                      	0x00000001b468ff44 0x1b4668000 + 163652
12  GLEngine                      	0x00000001b468feb0 0x1b4668000 + 163504
13  libSkiaSharp                  	0x000000010b3c87c8 0x10b114000 + 2836424
14  libSkiaSharp                  	0x000000010b2daf38 0x10b114000 + 1863480
15  libSkiaSharp                  	0x000000010b3460dc 0x10b114000 + 2302172
16  libSkiaSharp                  	0x000000010b307ce8 0x10b114000 + 2047208
17  libSkiaSharp                  	0x000000010b3459b4 0x10b114000 + 2300340
18  libSkiaSharp                  	0x000000010b2e0134 0x10b114000 + 1884468
19  libSkiaSharp                  	0x000000010b2ea1dc 0x10b114000 + 1925596
20  libSkiaSharp                  	0x000000010b2d1cf4 0x10b114000 + 1826036
21  libSkiaSharp                  	0x000000010b2d185c 0x10b114000 + 1824860
22  libSkiaSharp                  	0x000000010b2d2048 0x10b114000 + 1826888
23  libSkiaSharp                  	0x000000010b2f5824 0x10b114000 + 1972260
24  libSkiaSharp                  	0x000000010b38f17c 0x10b114000 + 2601340
25  MemoryProvider.iOS            	0x00000001096cf9dc 0x104cf4000 + 77445596
26  MemoryProvider.iOS            	0x0000000109559fe4 0x104cf4000 + 75915236
27  MemoryProvider.iOS            	0x00000001094e78c8 0x104cf4000 + 75446472
28  MemoryProvider.iOS            	0x00000001056d34a0 0x104cf4000 + 10351776
29  MemoryProvider.iOS            	0x000000010a234f30 0x104cf4000 + 89394992
30  MemoryProvider.iOS            	0x000000010a2ef5c4 0x104cf4000 + 90158532
31  MemoryProvider.iOS            	0x000000010a2f2e04 0x104cf4000 + 90172932
32  MemoryProvider.iOS            	0x0000000104dd5ce4 0x104cf4000 + 924900
33  MemoryProvider.iOS            	0x0000000104e11d28 0x104cf4000 + 1170728
34  GLKit                         	0x00000001b3349b20 0x1b332c000 + 121632
35  MemoryProvider.iOS            	0x0000000106713680 0x104cf4000 + 27391616
36  MemoryProvider.iOS            	0x0000000105cb5f90 0x104cf4000 + 16523152
37  MemoryProvider.iOS            	0x00000001094a9bf0 0x104cf4000 + 75193328
38  MemoryProvider.iOS            	0x00000001061d8824 0x104cf4000 + 21907492
39  MemoryProvider.iOS            	0x00000001056d34a0 0x104cf4000 + 10351776
40  MemoryProvider.iOS            	0x000000010a234f30 0x104cf4000 + 89394992
41  MemoryProvider.iOS            	0x000000010a2ef5c4 0x104cf4000 + 90158532
42  MemoryProvider.iOS            	0x000000010a2f2e04 0x104cf4000 + 90172932
43  MemoryProvider.iOS            	0x0000000104dc0374 0x104cf4000 + 836468
44  MemoryProvider.iOS            	0x0000000104dc5088 0x104cf4000 + 856200
45  Foundation                    	0x00000001840cdee8 0x183f69000 + 1461992
46  CoreFoundation                	0x0000000182d1a8a8 0x182c80000 + 633000
47  CoreFoundation                	0x0000000182d1a7a8 0x182c80000 + 632744
48  CoreFoundation                	0x0000000182d19afc 0x182c80000 + 629500
49  CoreFoundation                	0x0000000182d14018 0x182c80000 + 606232
50  CoreFoundation                	0x0000000182d137d0 0x182c80000 + 604112
51  GraphicsServices              	0x0000000199455570 0x199452000 + 13680
52  UIKitCore                     	0x00000001856402d0 0x184b10000 + 11731664
53  UIKitCore                     	0x000000018564584c 0x184b10000 + 11753548
54  MemoryProvider.iOS            	0x00000001068bea68 0x104cf4000 + 29141608
55  MemoryProvider.iOS            	0x0000000105fc5140 0x104cf4000 + 19730752
56  MemoryProvider.iOS            	0x0000000105fc4fc4 0x104cf4000 + 19730372
57  MemoryProvider.iOS            	0x0000000104e2ecc0 0x104cf4000 + 1289408
58  MemoryProvider.iOS            	0x00000001056d34a0 0x104cf4000 + 10351776
59  MemoryProvider.iOS            	0x000000010a234f30 0x104cf4000 + 89394992
60  MemoryProvider.iOS            	0x000000010a2ef5c4 0x104cf4000 + 90158532
61  MemoryProvider.iOS            	0x000000010a2f5878 0x104cf4000 + 90183800
62  MemoryProvider.iOS            	0x000000010a213488 0x104cf4000 + 89257096
63  MemoryProvider.iOS            	0x000000010a3fb8d0 0x104cf4000 + 91257040
64  MemoryProvider.iOS            	0x0000000104e2ebc8 0x104cf4000 + 1289160
65  libdyld.dylib                 	0x00000001829f2140 0x1829f1000 + 4416

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000003   x2: 0x00000000000000b4   x3: 0x00000000000010bc
    x4: 0x000000000000aa07   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x00000000fffffbbf   x9: 0x0000000000000000  x10: 0x0000000000000010  x11: 0x0000000000000000
   x12: 0x0000000000001000  x13: 0x0000000000000000  x14: 0x0000000000000000  x15: 0x0000000000000048
   x16: 0xffffffffffffffe1  x17: 0x00000001bd81df1c  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x0000000000000000  x21: 0x000000000000aa07  x22: 0x00000000000010bc  x23: 0x000000016b1058a8
   x24: 0x0000000000000003  x25: 0x00000000000000b4  x26: 0x0000000000000003  x27: 0x00000001d5327f98
   x28: 0x000000016b105828   fp: 0x000000016b105880   lr: 0x00000001aebdcd0c
    sp: 0x000000016b105830   pc: 0x00000001aebdd908 cpsr: 0x80000000
   esr: 0x56000080  Address size fault
Perhaps this helps.

Best regards
Dirk

Am 07.09.2021 um 12:26 schrieb Dirk Weltz <w...@weltz-online.de>:

Hello,

Jim Van Verth

unread,
Sep 14, 2021, 9:51:31 AM9/14/21
to skia-d...@googlegroups.com
It's hard to say without knowing more about your sample. It looks like the GL driver is continually allocating some sort of resource. However, it's not clear to me whether that's a bug in the driver, or SkiaSharp, or your sample.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/332FA801-D782-4027-B12C-FFDB8C6DFDE6%40weltz-online.de.


--

Jim Van Verth | Software Engineer | jvan...@google.com | 919-210-7664

Dirk Weltz

unread,
Sep 14, 2021, 4:16:35 PM9/14/21
to skia-d...@googlegroups.com
Thank you for your help.

It would be very helpful to know, which type of resources are allocated. Then it would be much easier to search for the problem.

Is there a possibility to get an information about what resource is used?

Best regards,
Dirk

Am 14.09.2021 um 15:51 schrieb 'Jim Van Verth' via skia-discuss <skia-d...@googlegroups.com>:


Reply all
Reply to author
Forward
0 new messages