hardware-perfcounter icon indicating copy to clipboard operation
hardware-perfcounter copied to clipboard

Out of memory error in example

Open JakeDaynes opened this issue 3 years ago • 1 comments

Compiled for Android using Readme, and getting:

crate context: Out of memory

When I try to run the mali_common_c_example on a Pixel 6 Pro 99% of the time.

JakeDaynes avatar Jun 17 '22 18:06 JakeDaynes

Modifying lines 54-56 to:

int status = -1; while (status < 0) { status = hpc_gpu_mali_common_create_context(num_counters, counters, &allocator, &context); }

Has fixed it so it starts running now, but obviously this isn't a good solution.

EDIT:

Dug a little and it looks like line 130 of /lib/gpu/mali/context.c is failing to open the counter reader, which takes me to line 147 of the lib/gpu/mali/driver_ioctl.c file's hpc_gpu_mali_ioctl_open_counter_reader method.

Changing the buffer_count to 8 from 16 seems to have fixed the issue entirely.

JakeDaynes avatar Jun 17 '22 18:06 JakeDaynes