Ubuntu 16.04 - Unity - Laggy window resize when using NVIDIA GPUs

SneWs's picture

After some time trying to ignore the resize window lag I hit my limit, every time I have chrome, chromium or any electron enabled app running the window resizing becomes excruciatingly slow in Unity.

After some searching around and looking in Chrome/Chromiums bug databases it seems that whenever you run the browser with GPU acceleration enabled this issue occurs. If it's NVIDIAS fault or if it's the devs behind Chrome/Chromium I can't say... But I did manage to find a fix for it.

Do note that this doesn't apply if you're using the Nouveau driver.

So, how to fix it?
In Chrome/Chromium you can just go in under Settings and expand the Advanced options, you will find a checkbox there named "Use hardware acceleration when available", uncheck and restart and that one is fixed.

If you use electron based apps such as Skype for Linux Alpha; Sublime; Atom; or Slack you will need to modify each applications launcher file and add

--disable-gpu

to it's startup args.

I'll provide an example of how I fixed Sublime Text, rinse and repeat for any other electron app you have installed and if needed.

$ locate sublime_text.desktop
/usr/share/applications/sublime_text.desktop

vi /usr/share/applications/sublime_text.desktop

When you have opened up the file, find the Exec= part and insert --disable-gpu like this

Version=1.0
 Type=Application
 Name=Sublime Text
 GenericName=Text Editor
 Comment=Sophisticated text editor for code, markup and prose
 Exec=/opt/sublime_text/sublime_text --disable-gpu %F
 Terminal=false
 MimeType=text/plain;
 Icon=sublime-text
 Categories=TextEditor;Development;
 StartupNotify=true
 Actions=Window;Document;

That's it, hopefully this will get you smooth responsive window resizing restored while we wait for a fix from the NVIDIA and/or Chrome/Chromium teams.

Happy Hacking!

3 comments

by Adam on Fri, 02/17/2017 - 07:34

I installed Ubuntu two days ago (first time trying a linux distro). Been having issues with the same thing, and just thought it was a linux thing, so I wiped the drive haha. Glad I came across your post. Going to reinstall and give it a shot.

SneWs's picture

by SneWs on Fri, 02/17/2017 - 08:12

Good to hear. Welcome to the world of Linux :)

by tuomo on Fri, 05/26/2017 - 10:44

This was a huge help! Thank you so much for the clear and good explanation. :)

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
© 2008 - 2017 Marcus Grenängen. Drupal theme by Kiwi Themes.