Raspberry pi 3 model B high cpu usage
Software Versions
- Python:3.9.2
- OS: Raspberry Pi OS with desktop 32-bit
- Kivy: 2.0.0
- Kivy installation method: like the documentation
Describe the bug I have a raspberry pi 3 model B+, but when i start the kivy's paint example (https://kivy.org/doc/stable/tutorials/firstwidget.html), during the execution when i make circles and lines the CPU usage goes to 200% or more, and i have already enabled opengl
Expected behavior The CPU usage less than 100%
To Reproduce
from random import random
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.graphics import Color, Ellipse, Line
class MyPaintWidget(Widget):
def on_touch_down(self, touch):
color = (random(), 1, 1)
with self.canvas:
Color(*color, mode='hsv')
d = 30.
Ellipse(pos=(touch.x - d / 2, touch.y - d / 2), size=(d, d))
touch.ud['line'] = Line(points=(touch.x, touch.y))
def on_touch_move(self, touch):
touch.ud['line'].points += [touch.x, touch.y]
class MyPaintApp(App):
def build(self):
parent = Widget()
self.painter = MyPaintWidget()
clearbtn = Button(text='Clear')
clearbtn.bind(on_release=self.clear_canvas)
parent.add_widget(self.painter)
parent.add_widget(clearbtn)
return parent
def clear_canvas(self, obj):
self.painter.canvas.clear()
if __name__ == '__main__':
MyPaintApp().run()
Code and Logs and screenshots

Hi @franciscogneto did you seen #7805?
no, i will try... later i come with the response
@misl6 still the same cpu usage...
Image while i using the app

I resolved the problem, for someone how see this issue in the future, kivy it's not good in raspberry cause the events, effects and animations are too cost to raspberry pi 3 cpu (weak), so if you wanna work with shapes or video in raspberry pi 3 i recommend you to use C++. But if you're working with something simple (screens, show data, inputs, iot) just avoid animations like screen transitions ( use NoTransition ) and enable opengl