I was using Kubuntu 19.10, then switched to Ubuntu 20.04, and everything was fine. Then a situation appeared, and I had to reinstall Ubuntu in UEFI mode instead of BIOS mode. Now both mouse pointer and keyboard lag, and it's not just graphical: moving and resizing windows also lags, some letters written on the keyboard are lost. The issue is not present in the Live CD, which is super weird.
I have tried multiple things: made sure that zoom and slow keys are disabled, checked and updated drivers, nothing of it works. The only thing is that mouse and keyboard lag when they are plugged into back panel (which is I guess directly to the motherboard), when I plug those into the front panel they work perfectly.
The issue is also present in both Xorg and Wayland sessions and in the login screen, but is not present in UEFI settings menu.
Is there anything else to solve my problem?