eglInitialize giving an 'EGL_BAD_ALLOC' error

I have multiple beagle boards. They are all BeagleBoard xM Rev C.

Most of them I am able to run the PowerVR demos with no problems. Yet,
there are some exceptions:

I have already run into two boards that I get the following prompts
during the boot log:

OMAP36XX/37XX-GP ES2.1, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
OMAP3 Beagle board + LPDDR/NAND

and

No SGX hardware, not starting PVR

On these boards whenever I try to run a PowerVR demo I get the
following error prior to exiting the demo app:

PVRShell: EGL Error (EGL_BAD_ALLOC)
InitAPI failed!
PVRShell: Unable to initialise EGL

To fix this problem you can edit this file on the beagleBoard:
/usr/bin/cpuType

and replace the following line:

sed -e 's/0x00005C00/OMAP3503/' -e 's/0x00001C00/OMAP3515/' -e 's/
0x00004C00/OMAP3525/' -e 's/0x00000C00/OMAP3530/'

with the following line:

sed -e 's/0x00005C00/OMAP3503/' -e 's/0x00001C00/OMAP3515/' -e 's/
0x00004C00/OMAP3525/' -e 's/0x00000C00/OMAP3530/' -e 's/0x00000E00/
OMAP3530/'

which is effectively adding -e 's/0x00000E00/OMAP3530/' to such line.

After this change proceed to reboot and you should be able to run the
PowerVR demos without any trouble.

If anybody is interested on why this work please let me know and I
could elaborate more.

Thank you for posting this! I had the same error on my xM Rev C. I had gotten as far as seeing the CPU type being 0x00000e00 (causing the PVR startup script to fail), but I didn't know about /usr/bin/cpuType.

I would be very interested in hearing more about why this is needed on some boards and not on others.
-Ed-

I am glad somebody find this useful. I do not know exactly why is
occurring in some boards and not in others. My guess is that they are
mounting a newer processor in the boards with the problem, but is hard
to tell as the processors are mounted underneath the memory,
therefore, I cannot compare the part number of one chip to the other.

Maybe somebody involved with the development of these boards will be
able to answer this question.

Luis