bCNC icon indicating copy to clipboard operation
bCNC copied to clipboard

bCNC is very slow on Rpi4

Open jdelahayes opened this issue 1 year ago • 7 comments

I've been working with bCNC on an Rpi3 for a while without any problems. I would like to install bCNC on a Rpi4. The last version of raspberrypi OS is a Debian 12.8 with Python 3.11.2 and I reinstalled bCNC without problem from the git repository.

But it is very slow, the tabs are displayed gradually and when you load a gcode it becomes unusable. Has anyone encountered the same kind of problem on a recent installation of bCNC on Rpi4?

jdelahayes avatar Dec 01 '24 14:12 jdelahayes

After testing and researching, the slowness is probably due to using xWayland since Debain Bookworm.

Similar problem found on Thonny project: https://github.com/thonny/thonny/issues/3036#issuecomment-1872394923

I downgrade to Debian bullseye. bCNC UI performance is as usual.

jdelahayes avatar Dec 01 '24 22:12 jdelahayes

Having the same problem. Mouse moves too slow to be used. Just moved from RPi 3b to 4. I had trouble downloading bCNC with pip (annoying but eventually working). Had bCNC working fine on 3b. It works ok on the 4 until I load a gcode file. Then it just about seizes up I see that Debian does not recommend downgrade. I am not seeing much on how the downgrade is done. Any help would be appreciated.
Thanks, Jack

Update: Got another SD card, loaded Debian bullseye using RPi imager. Downloaded and installed bCNC, worked like a charm. Thanks jdelahayes

WheeSci avatar Dec 14 '24 16:12 WheeSci

I can confirm the performance problems on a Raspberry Pi 5 with latest Raspberry Pi OS. The sluggishness seems to increase with the complexity of the job and rendering of the window.

Following blog post from the KiCAD project pointed into the direction of OpenGL call throttling caused by wayland: https://www.kicad.org/blog/2025/06/KiCad-and-Wayland-Support/ Indeed, the performance problems where resolved by switching from wayland to X11 through raspi-config.

rottaran avatar Jun 30 '25 20:06 rottaran

bCNC currently does not use OpenGL, that is where most problems are coming from. There's already issue for that https://github.com/vlachoudis/bCNC/issues/591

Harvie avatar Jun 30 '25 21:06 Harvie

Oh, didn't expect that. Still the performance problem was resolved by switching from wayland to X11.

Now that I think about it, the whole GUI was rendering slowly with wayland. I mean that all the buttons appeared individually slow enough on screen to be noticable. With the X11 system it is not noticable.

rottaran avatar Jul 01 '25 05:07 rottaran

bCNC is purely X11 application, on wayland it has to use Xwayland "emulation" layer, which obviously can introduce some extra latency... We are using Tkinter GUI library, there is ongoing discussion to add Wayland support on their side: https://core.tcl-lang.org/tk/tktview/3f58c0871c0be6b457cb

Harvie avatar Jul 01 '25 08:07 Harvie