27

I have a Laptop with a GeForce GTX 1050 Ti. Additionally, I have connected two displays to my Laptop via Displayport and installed the nvidia driver via sudo apt-get install nvidia-384 nvidia-settings. When I use the "Intel power saving mode" , then the mouse extremely flickers in some cases (usually only on the main screen of the laptop, but sometimes also on the others). Now I tried to switch to the "Nvidia performance mode" via prime-select nvidia. However, now I have the problem that there is a lagging box around the cursor, which does not show the updated graphics beneath the mouse and still is there for about a second when moving the mouse away. I made a screenshot, where I marked the text and unmarked it; the graphics of the marked text is still there:

enter image description here

The rest is working fine (no mouse flickering) and I would like to keep the nvidia mode. How can I solve the problem?

One addition: The box goes away after disconnecting the displayport (i.e. removing the two additional displays).

Rolch2015
  • 428

11 Answers11

17

I also had this annoying problem, and I was able to solve it by running:

sudo service lightdm restart

(This was suggested in a comment by m00am. At first I had tried to restart sddm, but it displayed a message saying I did not have that service. Installing the sddm package didn't help, but finally chosing the lightdm service worked.)

I clicked OK, and my computer restarted. Finally the lagging and cursor not updating problems were solved.

Eliah Kagan
  • 117,780
leileilei
  • 181
7

I had this problem with an AOC portable monitor in Linux Mint 19.1. The solution to restart lightdm worked for me but it was annoying to restart on after every fresh boot. Hence I figured that lightdm is starting too early in the boot sequence, so I modified systemd service config files for a less annoying solution.

In /lib/systemd/system/displaylink-driver.service:

Changed the line After=display-manager.service to Before=display-manager.service

In /etc/systemd/system/display-manager.service:

Modified ExecStartPre to

ExecStartPre=/bin/sh -c '/bin/sleep 10 && [ "$(basename $(cat /etc/X11/default-display-manager 2>/dev/null))" = "lightdm" ]'

For Ubuntu 18.04 you can do the same edit, except to /lib/systemd/system/lightdm.service

  • 1
    Hi Tom! I think your answer may be good to fix this annoying issue, but I'm not sure what to change, nor I find these lines in the files you mention. Could you check the answer is correct? And could you elaborate on what are the changes doing? Thanks! Edit: I managed to fix it I believe. Mainly problem is the files are swapped (first line is from the second file), and the second line has a "to to `Before=display-manager.service" which shouldn't be there I believe. – cgc512 Jul 08 '19 at 18:30
  • Yes I did mix up the lines. Fixed answer thanks. – Tom Berghuis Jul 09 '19 at 10:35
  • 2
    Perfect, it worked perfect for me, thank you very much for finding this! – cgc512 Jul 09 '19 at 13:54
  • 1
    Hey, DisplayLink Ubuntu users, this is THE solution to the problem. – Aram Paronikyan Apr 07 '20 at 18:07
6

Environment: Ubuntu 18.04 GTX1650 nvidia-430-driver(installed from ubuntu software)

Fixed the square around mouse problem by:

sudo apt install lightdm

Configure lightdm as default and reboot

sudo dpkg-reconfigure lightdm
sudo reboot

After rebooting, you will still see the square around mouse, then

sudo apt remove lightdm
sudo reboot

After rebooting, you will be in commandline.

sudo service gdm start

it will bring you into graphical mode again, and you will find that the square around mouse disappear

sudo dpkg-reconfigure gdm3

Then you do not need to type sudo service gdm start every time.

Hope it can help.

  • In the second last command, by lightm3, do you mean gdm3 or lightdm? – Kulfy Oct 11 '19 at 20:01
  • sorry, it was a typo – Yang Zhou Oct 12 '19 at 21:05
  • Just fyi, for anyone else who may run into same issue: after installing/removing lightdm and then rebooting my Ubuntu box started up at the terminal, no UI. Rebooting again loaded with gdm, no issue. Running nvidia-driver-435. – davemackey Jan 06 '20 at 17:25
  • This almost broke my system on ubuntu 20.04, locked me out before logging in, don't follow this advice. – Armin Jan 10 '21 at 17:23
4

Restarting sddm worked for me, artifacts gone.

sudo systemctl restart sddm

This will terminate your current session, log you out, and restart the display manager. After logging back in, the problem are gone.

(source)

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Oleksii
  • 49
  • 2
    I am running Ubuntu 17.04 with the standard display manager lightdm. When I try to restart the sddm service, it states that there is no such service. Restarting lightdm does not help either. – Rolch2015 Sep 08 '17 at 11:09
  • try to reinstall xserver-xorg* packages, restarting sddm is anyway not a permanent solution. I had to reinstall xorg packages in order to make it work with nvidia card – Oleksii Sep 08 '17 at 15:25
  • 2
    Please edit the answer to include the relevant bits. Links tends to go away with time, rendering such answers useless. – Hi-Angel Sep 08 '17 at 18:21
  • Unfortunately, it's not an option when I have two user accounts running simultaneously and the square appears every time I launch the second session. – int_ua Nov 23 '17 at 16:01
3

I had the same issue in parallel to having the issue described in here: External monitor turns off for several seconds every 5-10 minutes

After setting my refresh rate to 58 Hz and logging out/logging in the lagging box around my mouse disappeared. External screen timeout persists though, but that's another issue.

This worked for me, YMMV. I'm using Ubuntu 16.04 and Nvidia drivers.

  • With 18.04 can't logout/login. It either restarts or goes into login screen loop. – Velkan Jul 23 '18 at 08:45
  • I don't know if the logout/login did the trick or that I applied a new refresh rater, restored the original rate and then performed a logout/login, but it did the trick. – tylersDisplayName Mar 27 '19 at 14:31
  • Random screen turn off come from PulseAudio idle detection, to fix it comment line load-module module-suspend-on-idle in file /etc/pulse/default.pa – AppyGG Apr 15 '20 at 08:06
3

Solutions working for me are the following...

ON KUBUNTU (KDE) :

  • use XRender instead of OpenGL
  • or with OpenGL, disable "vsync"

display properties window

ON UBUNTU (GNOME) :

  1. Install CompizConfiguration Settings Manager (CCSM) with Aplication Center
  2. Run CompizConfig
  3. Check both "Composite" and "OpenGL" !

Compiz Config Manager

  1. Let's go in "Composite" tab, uncheck the "automatic refresh detection" and fix your refresh rate to 60.

composite config

Hope it help someone.

Note: I'm using Lenovo L380 Intel Graphics on Kubuntu 18.10 Cosmic, with 3 VGA displays (1 USB-C Lenovo Docking Station + 2 DisplayLink adapters).

Meloman
  • 271
2

I had this exact issue on ubuntu 18.04 with unity desktop and nvidia-390 driver, and the solution of restarting lightdm worked for me.

I didn't like having to always open a terminal, run the command, then re-login, so I wanted a permanent fix. I figured if everything works, just not if lightdm is started at it's usual time, then it must be a timing issue.

I added 1 second delay into the launch of lightdm by changing the ExecStartPre= line in /lib/systemd/system/lightdm.service from

ExecStartPre=/bin/sh -c '[ "$(basename $(cat /etc/X11/default-display-manager 2>/dev/null))" = "lightdm" ]'

to

ExecStartPre=/bin/sleep 1 ; /bin/sh -c '[ "$(basename $(cat /etc/X11/default-display-manager 2>/dev/null))" = "lightdm" ]'

(just adding /bin/sleep 1 ; before what was already there)

works for me :)

Jeremy
  • 31
1

And another tip:

If you use a laptop computer when you unplugged the USB3.0 cable for some cases and you try to plug the USB3.0 again. If the DisplayLink does not work maybe you can try shutdown your computer and power off your display machine(for me, I use pluggable UD-3900). then it will work. unfortunately, you have to :sudo service lightdm restart again. This is useful for me. Because my DisplayLink does not work after taking my computer for a presentation in another room and at the same time I installed some other software. and when I came back, it did not work. I thought it was because of the updates and newly installed software. So I reinstalled Linux(I installed yesterday), it still did not work. So I POWERED OF my laptop and powered off my UD-3900, then start both computer and UD-3900. It works.

leileilei
  • 181
0

Go to additional driver and then change the radio button selection from Nvidia to any other (whichever present in your dialogue box). Apply and restart your system.

0

In the meantime I have upgraded to Ubuntu 18.04, installed the newest Displaylink driver (https://www.displaylink.com/downloads/ubuntu) and the nvidia-390 driver. Furthermore, I selected the nvidia-driver via sudo prime-select nvidia. Now it works fine, and the lagging box has also vanished. However, it did not work with the nvidia-410 driver, which currently is the recommended one. In contrast to the situation before, it now works smoothly with the nvidia-driver, and the intel-driver produces some annoying mouse glitches on the secondary and tertiary screen. The other solution suggested here did not work for me. Maybe they work for others.

Rolch2015
  • 428
0

On Ubuntu 20.04, you have to do

sudo systemctl gdm restart

The screens will flash for about one minute and then everything will work.