I am writing a Kivy graphics program on a Raspberry Pi with KivyPie OS (Linux is preconfigured for Kivy development).
For some reason, it runs very slowly if it is started using sudo. Usually, by running "python main.py", the program runs at a speed of about 30 cycles per second. However, if I do "sudo python main.py", it runs as slowly as 1 loop in 5-10 seconds.
I need to use sudo to access the Raspberry GPIO. (unless I try another way to do this, I see people discussing).
I am wondering, however, what could be causing such a huge drop in performance with sudo? And is it possible to get around this?
PS: Running the same program on my PC (Linux) with and without sudo does not seem to cause such a problem. Only on raspberries.
source share