Platform:
App:
/kivy/examples/demo/showcase/main.py
Short description:
In the showcase demo, testing "Screenmanager" with "Fade Transition" and "Wipe Transition" produces some weird errors.
As you can see from the video below, for every "FadeTransition" transition, the error glGetError 0x502
is thrown in the shell... then, after 12 transitions, a black screen suddenly appears and the folowing warning is shown: [WARNING] stderr: Exception ignored in: 'kivy.graphics.fbo.Fbo.raise_exception'
[WARNING] stderr: Exception: FBO Initialization failed: Incomplete attachment (36054)
Kivy log: kivy_16-10-07_3--fade-transition-error.txt
Video: https://www.youtube.com/watch?v=lu4Rh55EK1E
Screenshot:
Similarly, for every "WipeTransition" transition, the error glGetError 0x502
is thrown in the shell... then, after 12 transitions, a black screen suddenly appears and the folowing warning is shown: [WARNING] stderr: Exception ignored in: 'kivy.graphics.fbo.Fbo.raise_exception' [WARNING] stderr: Exception: FBO Initialization failed: Incomplete attachment (36054)
Kivy log:kivy_16-10-07_8--wipe-transition-error.txt
Video:https://www.youtube.com/watch?v=GWGgR7etw5w
Screenshot:
might be related to #4542
Try increasing the GPU memory. You can edit /boot/config.txt
and append gpu_mem=256
. More information here
I'm experiencing this too, with Kivy 1.9.1. Increasing gpu_mem from 128 to 512 makes no difference.
I've noticed that it doesn't occur with the Swap and Slide transitions.
I use Animation() in other parts of my app, and this works fine too, giving me a fade-like effect when changing window opacities.
FWIW I stumbled upon these OpenGL error codes:
https://www.khronos.org/opengl/wiki/OpenGL_Error
Apparently it's 0x0505 that means "out of memory", while 0x0502 means "invalid operation".
Has there been any solutions to this glGetError 0x502 and crashing problem? I'm having the same issue but can't find a solution. I tried the 512M gpu_mem config but there was no difference, still error and crash.
I was experiencing this same shader link problem and with the help of others was able to determine a memory leak in one of the kivy modules that has been fixed. If you can pull the latest kivy master files, you can test to see if this latest version solves this issue. For more information about a repetitive glGetError 0x502 messages, reference #5581. This revision should also fix #4542.
Fixed by #5664 - Please reopen if it is not the case.
I still get this issue on a RPi 3 with Kivy installed on a vanilla Raspbian stretch image. I followed the installation instructions described on the Kivy homepage for the raspberry pi. I am using Python 3.5.3 and compiled kivy from master branch (Kivy: v1.10.1.dev0, git-2efa46a, 20180516). This is the log I get when running the kivy showcase demo, switching between two screens, exactly as bionid does in the youtube video:
This is with Legacy OpenGL driver activated with 256MB memory split. I also get glGetError x0505 and x0502 not shown in the log. I get the same errors when activating FullKMS OpenGL driver.
@pro90 On my Pi2 I've set in /boot/config.txt
-> gpu_mem=190
Hope it helps.
hi @kuzeyron, thanks for your answer. I've already tried to set the gpu_mem to 256, but it doesn't seem to solve the problem. I still get the errors.
Perhaps you could install the missing packages so you don't have to see them again.
But the FBO part seems like it doesn't fit your stuffs. Depends on what you are using for monitor.
You should check your setup on the Pi. That it's actually setup correctly.
I have on my Raspberry Pi2: Official screen and I run Kivy with Python 3.6.5. Distribution is Raspbian.
And everything is working just fine.
Controlling the env..
Could also help. May the force be with you!
What screen resolution do you use? Can you maybe post a step by step guide for your working kivy setup? I followed the steps exactly as described in this Kivy manual link, starting with the most recent raspbian distro i found on raspberrypi.org. I only changed the python packages to python3 packages and changed gpu_memory to 256MB via raspi-config
@pro90 are you on HDMI or official screen?
You could try go through their Config Tutorial for the HDMI/Display.
What I've learned with Raspberry Pi is, you should put everything in the /boot/config.txt instead of messing around with other things.
If you have another Micro-SD card. You could try running KivyPie, to see if it works there. I usually go with KivyPie instead of using Raspbian. It's easier to setup with KivyPie.
Edit: I can't remember but run sudo raspi-config
. You might find anything about the display in there.
Since this issue is still being discussed, I would like to say that it should be opened again because after further testing the fix mentioned above, I got the same glGetErrors. The reason I found it to work after it was fixed was because my test code was running without an HDMI monitor attached. Once I ran my test code with the monitor, the same problem returned and I gave up. If this can be fixed to support this configuration change (HDMI monitor), I will be glad to continue testing with kivy. Otherwise, I'm currently migrating my code to pi3d, which also has GPU memory problems but doesn't crash my app like it does with kivy screenmanager.
All of you who have this problem.
Write down in details how you installed Kivy (step by step..).
I'm going to run some tests to see if I get the same problem as you.
Here is my Linux distribution version info:
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
script used to install kivy:
cd /home/pi
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev pkg-config libgl1-mesa-dev libgles2-mesa-dev python-setuptools libgstreamer1.0-dev git-core gstreamer1.0-plugins-{bad,base,good,ugly} gstreamer1.0-{omx,alsa} python-dev libmtdev-dev xclip xsel
git clone https://github.com/kivy/kivy
cd /home/pi/kivy
make
echo "export PYTHONPATH=$(pwd):\$PYTHONPATH" >> ~/.profile
source ~/.profile
@kuzeyron i was doing some tests myself
Exception: FBO Initialization failed: Incomplete attachment (36054)
Exception Exception: Exception('FBO Initialization failed: Incomplete attachment (36054)',) in 'kivy.graphics.fbo.Fbo.raise_exception' ignored
glGetError 0x505
when the transition doesn't work (black), which is after as few as 2 transitions of wipetransition.
OpenGL docs have a pretty detailed list of possible reasons:
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT (source)
Not all framebuffer attachment points are framebuffer attachment complete. This means that at least one attachment point with a renderbuffer or texture attached has (1) its attached object no longer in existence or (2) has an attached image with a width or height of zero, or (3) the color attachment point has a non-color-renderable image attached, or (4) the depth attachment point has a non-depth-renderable image attached, or (5) the stencil attachment point has a non-stencil-renderable image attached.
Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.
Hopefully some of these can be ruled out relatively easily? ScreenManager uses an FBO with stencilbuffer, could that be related to (5)?
Can someone gist a log with KIVY_GL_DEBUG=1
? Maybe it contains clues. Another thought is to run tito's apitrace script from the last time around, in case nobody tried that yet
How I did install Kivy in Raspbian
Raspbian: v8, Python: 2.7.9 and 3.6.5
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev pkg-config libgl1-mesa-dev libgles2-mesa-dev python-setuptools libgstreamer1.0-dev git-core gstreamer1.0-plugins-{bad,base,good,ugly} gstreamer1.0-{omx,alsa} python-dev libmtdev-dev xclip xsel
sudo pip install cython==0.25.2
pip install git+https://github.com/kivy/kivy.git@master
And that's it. Nothing else to do.
And my /boot/config.txt
:
lcd_rotate=2
disable_splash=1
gpu_mem=190
arm_freq=1050
gpu_freq=470
force_turbo=1
over_voltage=6
temp_limit=80
gpu_mem_256=142
gpu_mem_512=398
dtparam=audio=on
coherent_pool=6M smcsc95xx.turbo_mode=N
start_x=0
core_freq=500
sdram_freq=500
A little bonus to add: pip install rpi_backlight
@kuzeyron Which screen are you using at which resolution? As @frankgould pointed out, this bug seems to be output or resolution dependent.
@pro90 I'm using the Raspberry Pi's official 7" screen.
can you maybe try a LCD display via HDMI with a resolution of at least 1280x1024?
@pro90 Yes, but I would like to read more how you guys have installed Kivy on the Pi's(before I begin the tests).
What you guys could try is: /home/pi/.kivy/config.ini and lower the FPS.
my installation routine: started out with a vanilla "Raspbian Stretch with Desktop" image, April 2018 version (4.14-34 kernel)
sudo apt-get update
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \
pkg-config libgl1-mesa-dev libgles2-mesa-dev \
python3-setuptools libgstreamer1.0-dev git-core \
gstreamer1.0-plugins-{bad,base,good,ugly} \
gstreamer1.0-{omx,alsa} python3-dev libmtdev-dev \
xclip xsel
sudo pip3 install -U Cython==0.28.2
sudo pip3 install git+https://github.com/kivy/kivy.git@master
Afterwards I tested the my own application as well as kivy demo applications with different combinations of memory split (128 / 256 MB) and OpenGL drivers (Legacy or Full KMS OGL desktop driver).
On the Pi2 with a old version of KivyPie
running on it and output is HDMI:
sysop@kivypie:~/RpiScreen$ python3 main.py
[WARNING] [Config ] Older configuration version detected (15 instead of 16)
[WARNING] [Config ] Upgrading configuration in progress.
[INFO ] [Logger ] Record log in /home/sysop/.kivy/logs/kivy_18-05-23_0.txt
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO ] [Kivy ] v1.9.2-dev0
[INFO ] [Python ] v3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1]
[INFO ] [Factory ] 193 symbols loaded
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: egl_rpi
[INFO ] [GL ] OpenGL version <b'OpenGL ES 2.0'>
[INFO ] [GL ] OpenGL vendor <b'Broadcom'>
[INFO ] [GL ] OpenGL renderer <b'VideoCore IV HW'>
[INFO ] [GL ] OpenGL parsed version: 2, 0
[INFO ] [GL ] Shading version <b'OpenGL ES GLSL ES 1.00'>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <8>
[INFO ] [Shader ] fragment shader: <b'Compiled'>
[INFO ] [Shader ] vertex shader: <b'Compiled'>
[INFO ] [Base ] Adding binding for mouse move
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Shader ] fragment shader: <b'Compiled'>
[INFO ] [Shader ] fragment shader: <b'Compiled'>
[INFO ] [Shader ] fragment shader: <b'Compiled'>
[INFO ] [OSC ] using <multiprocessing> for socket
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [MTD ] Read event from </dev/input/event0>
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [MTD ] Read event from </dev/input/event1>
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [Base ] Start application main loop
[INFO ] [MTD ] </dev/input/event0> range position X is 0 - 0
[INFO ] [MTD ] </dev/input/event0> range position Y is 0 - 0
[INFO ] [MTD ] </dev/input/event0> range touch major is 0 - 0
[INFO ] [MTD ] </dev/input/event0> range touch minor is 0 - 0
[INFO ] [MTD ] </dev/input/event0> range pressure is 0 - 255
[INFO ] [MTD ] </dev/input/event0> axes invertion: X is 0, Y is 0
[INFO ] [MTD ] </dev/input/event0> rotation set to 0
[INFO ] [MTD ] </dev/input/event1> range position X is 0 - 0
[INFO ] [MTD ] </dev/input/event1> range position Y is 0 - 0
[INFO ] [MTD ] </dev/input/event1> range touch major is 0 - 0
[INFO ] [MTD ] </dev/input/event1> range touch minor is 0 - 0
[INFO ] [MTD ] </dev/input/event1> range pressure is 0 - 255
[INFO ] [MTD ] </dev/input/event1> axes invertion: X is 0, Y is 0
[INFO ] [MTD ] </dev/input/event1> rotation set to 0
[INFO ] [HIDMotionEvent] using <b'Microsoft Comfort Curve Keyboard 2000\x00 '>
[INFO ] [HIDMotionEvent] using <b'Microsoft Comfort Curve Keyboard 2000\x00 '>
[INFO ] [HIDMotionEvent] using <b'Microsoft Comfort Curve Keyboard 2000\x00 '>
[INFO ] [HIDMotionEvent] using <b'Microsoft Comfort Curve Keyboard 2000\x00 '>
Next test will be the newest release of KivyPie.
Edit: Have tried 3 times flashing KivyPie 1.0 and the boot sector seems damaged. I tried sudo dd
. It's the tool I've always used for flashing. And flashing Raspbian's newest release was a success.
Okay, tested with the release 2018-04-18
of Raspbian and here is the log output:
pi@raspberrypi:~/test $ python main.py
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_18-05-23_2.txt
[INFO ] [Kivy ] v1.10.1.dev0, git-6c7fce6, 20180523
[INFO ] [Python ] v2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: egl_rpi
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used <gl>
[INFO ] [GL ] OpenGL version <OpenGL ES 2.0>
[INFO ] [GL ] OpenGL vendor <Broadcom>
[INFO ] [GL ] OpenGL renderer <VideoCore IV HW>
[INFO ] [GL ] OpenGL parsed version: 2, 0
[INFO ] [GL ] Shading version <OpenGL ES GLSL ES 1.00>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <8>
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
Unable to init server: Could not connect: Connection refused
(main.py:7264): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Unable to init server: Could not connect: Connection refused
(main.py:7264): Gtk-CRITICAL **: gtk_clipboard_get_for_display: assertion 'display != NULL' failed
[INFO ] [Clipboard ] Provider: gtk3(['clipboard_dbusklipper'] ignored)
xclip version 0.12
Copyright (C) 2001-2008 Kim Saunders et al.
Distributed under the terms of the GNU GPL
[INFO ] [Cutbuffer ] Provider: xclip
[INFO ] [CutBuffer ] cut buffer support enabled
[INFO ] [GL ] NPOT texture support is available
[INFO ] [OSC ] using <multiprocessing> for socket
Unable to connect to X server
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [Base ] Start application main loop
[INFO ] [HIDMotionEvent] using <Microsoft Comfort Curve Keyboard 2000>
[INFO ] [HIDMotionEvent] using <Microsoft Comfort Curve Keyboard 2000>
And to mention, I ran this from the desktop itself rather fullscreen.
which application do you use for testing? can you maybe share the code of your test app? can you also test it with python3?
@pro90 First program I tried was just a simple RecycleView that @tshirtman helped me with.
My 2nd attempt to make it harder for the Pi I used this code: main.py
The log:
pi@raspberrypi:~/test $ python main.py
[INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_18-05-23_4.txt
[INFO ] [Kivy ] v1.10.1.dev0, git-6c7fce6, 20180523
[INFO ] [Python ] v2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Window ] Provider: egl_rpi
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used <gl>
[INFO ] [GL ] OpenGL version <OpenGL ES 2.0>
[INFO ] [GL ] OpenGL vendor <Broadcom>
[INFO ] [GL ] OpenGL renderer <VideoCore IV HW>
[INFO ] [GL ] OpenGL parsed version: 2, 0
[INFO ] [GL ] Shading version <OpenGL ES GLSL ES 1.00>
[INFO ] [GL ] Texture max size <2048>
[INFO ] [GL ] Texture max units <8>
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Text ] Provider: sdl2
[INFO ] [OSC ] using <multiprocessing> for socket
Unable to connect to X server
[INFO ] [ProbeSysfs ] device match: /dev/input/event1
[INFO ] [HIDInput ] Read event from </dev/input/event1>
[INFO ] [ProbeSysfs ] device match: /dev/input/event2
[INFO ] [HIDInput ] Read event from </dev/input/event2>
[INFO ] [ProbeSysfs ] device match: /dev/input/event0
[INFO ] [HIDInput ] Read event from </dev/input/event0>
[INFO ] [Base ] Start application main loop
[INFO ] [HIDMotionEvent] using <Microsoft Comfort Curve Keyboard 2000>
[INFO ] [HIDMotionEvent] using <YSTEK G Mouse>
[INFO ] [HIDMotionEvent] using <Microsoft Comfort Curve Keyboard 2000>
[INFO ] [Base ] Leaving application in progress...
Still I haven't got the same error messages as you got. I kinda wish I had a Raspberry Pi 3/3+ for the moment.
Edit: If anyone of you could try set in /boot/config.txt
:
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
And use the Pi3 only through Ethernet if needed. Does it react in the same way?
Edit 2: Try upgrading the firmware: sudo rpi-update
@kuzeyron, I offered to purchase and send and RPi3 to someone who can help fix these kinds of problems. Since it was fixed once and failed somewhere else, it probably will need someone who can get past any more of these anomalies. So, if you are willing and can help get everything working over a period of time, please let me know and I'll get you a RPi3.
As for the disabling wifi and bluetooth, I have tested these and there is no difference to the app.
As for upgrading the firmware, I've seen posts that say not to do that. I have no idea if that's accurate but I tried it and couldn't determine any value in it. Again, I didn't experience a difference with or without the rpi-update. From my tests, it appears to be a memory leak like last time (without HDMI).
If you need me to setup kivy to test on RPi, let me know. I'll have to rebuild a drive from backup.
Thanks for your help!
@frankgould I can't answer on the purchase of a Pi3. It gets me speechless!
I would need a Pi3 so I can do more of those tests I can't with the Pi2 (obviously).
But I hope we will find a solution.
I do have a friend that has a Pi3(3h from here).
I could ask him if he have the time. But yesterday he wrote that he's kinda busy with his business.
But I'll ask him anyway!
Edit: I got a hold on my friend. Sent the request so hopefully he might will help!
Edit 2: Got in touch with my friend. Unfortunately the answer is no. But I have contacted @frankgould !
What is needed to fix this would be a updated VC4 (VideoCore IV) and then update the graphic drivers.
I saw a VC4 version here on Github but latest changes are about two years old.
This is a dead end unless the foundation themself (Raspberry Pi) marks this as important.
When I've been testing, I've tried using Gl4es and Mesa. I might have forgotten a few names.
Hi, just putting my hand up as another dead-in-the-water Pi user (3B+, Rasbian Stretch Lite, Kivy).
@Neex101 Joining the club here too. Created a Kivy app running on my windows pc and everything worked perfectly. Raspberry Pi 3B+ using Raspbian just broke down on the 3rd screen. First screen had a button which worked fine except that there was no fade transition. Second screen had a button too. The third screen had a text input and here's where things go south. I skipped this screen by hardcoding it into the 2nd screen's button. The 4th screen had two buttons, the second button had no text and was filled black. Going any further would crash the program.
I had only tested Kivy on RPI once before (tried the demo of course) with a 2 screen app which jumps from one to the other by pressing a button. Now that I have tried running it again, I found out that jumping 3-4+ times causes undesired behavior, stuttering, and eventually crashing. Four month's work down the drain..
I'm returning to this club to say I've been down a wayward path and have found a light in the tunnel. First off, Kivy screenmanager crashes due to memory leaks caused by the outdated Raspbian graphics drivers. To fix this, I migrated to Ubuntu-Mate 18.04 and am able to install opencv that I couldn't on Raspbian. Second, RPi 3B+ has compatibility problems with some Linux distributions and I've had two die on me. I now use RPi 3B models exclusively and am satisfied with the quality and reliability so far.
I have spent 5 months migrating from Android to Mate and it has been one long arduous task. Keep trying different solutions and eventually something will work. I'm happy to share more if it helps.
@frankgould Thank you for your suggestion. I flashed Ubuntu 16.04 on my Raspberry pi 3B and tried installing Kivy. Can you please send me which commands you used to install Kivy? I had used the official commands when installing on Raspbian before. Trying them on Ubuntu lead to installing Cython but when I try to "make" kivy, it says Cython is not installed. Anyways, it'd be great if you could share the commands you used for installing kivy. Thank you! 馃槃
@JamilHaidar I wish I could remember specifically what I did to install but it's just too many times I tried and failed that I don't recall. I have notes that includes cython install but when I run cython --version, I get not installed message. I know I followed the instructions in the link below and cython is not included. You might want to join Discord Kivy for IRC support and you'll see me there too. We can then have side conversations and I can share with you what I know and have working.
https://kivy.org/doc/stable/installation/installation-linux.html
After several tests across multiple linux distributions, like Ubuntu Mate 16.04 and 18.04, Gentoo, and Arch, we determined there are graphics driver problem on all of them. My buddy Kuzeyron and I have tried all possible combinations of graphics driver (legacy, KMS, and fake KMS) with these distributions. Kuzeyron has even attempted to compile the open source versions to update the drivers with newer releases but was unable to get the drivers to install correctly.
At this point, I have fallen back to my pi3d driven SlideShow app so that it can manage the GPU memory and reboot Raspbian after months running continuously. Going forward, we would like to find someone who can help us get past this graphics driver memory leak in Raspbian so that the Kivy screenmanager works without crashing the Raspberry Pi.
Is there anyone who can help us with this anomaly? If so, you can usually find one of us on the Kivy channel on Discord.
Mostly just subscribing to this thread but I likewise have had problems related to "insufficient gpu memory" for want of a better description. I posted in another (closed) issue #5581 for what it's worth.
gstplayer
):import os
os.environ['KIVY_VIDEO'] = 'ffpyplayer'
This pull request should fix it.
May be this pull request will fix it https://github.com/kivy/kivy/pull/6713
Also increase memory for gpu should to 512 RAM
"Also increase memory for gpu should to 512 RAM"
For a Pi3B? It only has 1GB. I would recommend starting at 256MB, testing and raising that value until the FBOs stop, then increase it by 20% and call it a day.
Also, with respect to code changes to fix FBO exceptions, it would be really great if these simply _weren't_ raised python exceptions at all. Report a warning, return a None
object but raising exceptions really prevent a kiosk-style application from continuing to work.