linux – Ubuntu 21.04 second screen issue

A few days ago ubuntu restarted unexpectedly and after rebooting the second screen was not recognised at all. It has been working for some weeks without any problem and it is plugged through HDMI.

After browsing the web I found a quick solve using this command.

$sudo dpkg-reconfigure LightDM
it opens a screen with following options

  1. LightDM
  2. gdm3
  3. lightdm

It was setted up to gdm3 and I changed it to lightdm
After switching to lightdm the second screen is working again, when I plug it in it seems is working but it is really laggy. Tabs take ages to open, webcam is really slow and cuts the video. Typing takes a lot of time to appear on the screen. Switching between tabs is incredibly slow… It does not work at all even though it looks like it is.

So I decided to try setting up back to gdm3 and despite monitor is being recognised as well, it shows up just half screen and I cannot see the bottom part.As well as if I use the other option LightDM.

screen

I have also tried to change nvidia driver version but computer got blocked while installing them…

Do you know how can I fix this? or at least what the problem is so I can browse the internet for a solution???

Thanks in advance