I did a couple of interesting things on the Raspberry Pi before but this is the first time I’m really looking at the GPU.
I always took for granted that the Raspberry Pi 3 is a cheap mini computer with GPU that can play 1080p video. Cool right? Until I started running things that require WebGL, then the headache comes. I must admit it’s also due to my lack of knowledge on WebGL.
I shall put everything here quickly and not talk about the headache.
- Check GPU setting.
If not enabled, go to Settings –> Advanced –> Enable “Use hardware acceleration when available“
Check the GPU again. If still not enabled, continue.
For Raspberry Pi / Raspbian only, look for this file:
Inside this file contains the flags for Chromium
[email protected]:~# cat /etc/chromium-browser/customizations/00-rpi-vars CHROMIUM_FLAGS="--ignore-gpu-blacklist --disable-quic --enable-fast-unload --enable-tcp-fast-open" #CHROMIUM_FLAGS="--ignore-gpu-blacklist --disable-quic --enable-fast-unload --enable-tcp-fast-open --disable-gpu-compositing --ppapi-flash-version=22.214.171.124"
Insert “–ignore-gpu-blacklist” and remove “–disable-gpu-compositing”
In this case, we were actually doing an animation using Phaser.io which uses GPU and WebGL extensively. Do bear in mind that each GPU has a max texture it can render. In the case of Raspberry Pi, it’s 2048 x 2048. ie your images must not be bigger than this size or Phaser will not render it.