189

I installed or upgraded to Ubuntu 16.04, but I'm having some problems with my graphics card.

  • The display is blank
  • The display flickers
  • Items on the screen do not display correctly
  • Certain programs complain of graphics issues
  • The computer boots to low-graphics mode

  • Your specific issue may not be here, but try the solutions described in the answers anyway.

This question is very broad, but each one of these issues likely has one solution.


If you are experiencing a login loop, check the last part of my answer.


If you experience one of the listed issues and have your own solution (mine didn't work, or there's a faster way), feel free to post another POLITE answer, describing your problem and how you fixed it.


Those attempting to install Ubuntu, please refer to the section titled: If you are unable to enter a TTY or are trying to install Ubuntu.

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172
TheWanderer
  • 19,395
  • 12
  • 50
  • 65
  • 3
    For those stuck in login loop after installing the nvidia driver... please have a look at http://askubuntu.com/a/760469 it seems the nvidia drivers are not yet compatible with the latest kernel version. You can also try the steps mentioned here http://askubuntu.com/a/761326, if you still want to install the nvidia drivers though... I havent proceeded as my flicker problem has stopped. – Ajinkya Patil Apr 26 '16 at 22:14
  • My issue isn't listed, but it certainly qualifies for "NVidia & 16.04" problems. http://askubuntu.com/questions/789972/add-secondary-monitor-nvidia-367-27-16-04-displayport – andyczerwonka Jun 22 '16 at 11:58
  • I solved this problem with proprietary driver, version 304 – valeriocomo Jul 17 '16 at 13:20
  • Through the years I have tried a lot of suggested solutions such as purging, graphics ppa, additional drivers etc. etc. on various laptops. For me none of this ever worked. With nvidia drivers I always fallback on downloading and installing drivers from nvidia, following instructions in the runnable. – Eduard Drenth Aug 07 '16 at 09:19
  • 1
    I cant answer this question but installing from NVIDIA's drivers with the flag "--no-opengl-files" helped me – shaunakde Sep 30 '16 at 16:40
  • A display connected to on-board graphics showed stripes/interleaved output in the main window while the menu bar was fine most of the time. In boot settings, I raised the nvidia frame buffer size from 32M to 128M - that appears to have fixed the issue for that system. – Rainer Rillke Jun 02 '19 at 18:44

12 Answers12

218

Please be aware that this answer may become slightly outdated. I will do my best to update it regularly, but I can't guarantee anything. The driver version used below may not be the latest. Please check the Launchpad page to confirm.

Each of the issues described (and maybe even more) can be fixed by following the steps below.


If you're installing Ubuntu, follow section 3.


1. First make sure you can enter a TTY

Press Ctrl+Alt+F1

If this brings you to a black screen with a login prompt, continue on. Otherwise, you will likely have to boot with a special kernel flag. Instructions are below.


2. Now for the fix

  1. Log into your account in the TTY.
  2. Run sudo apt-get purge nvidia-*
  3. Run sudo add-apt-repository ppa:graphics-drivers/ppa and then sudo apt-get update.
  4. Run sudo apt-get install nvidia-driver-430.
  5. Reboot and your graphics issue should be fixed.

3. If you are unable to enter a TTY or are trying to install Ubuntu

  1. Reboot into GRUB.
  2. Highlight the Ubuntu option and press E.
  3. Add nouveau.modeset=0 to the end of the line beginning with linux.
  4. Press F10 to boot.
  5. Follow the instructions above.
    • (If installing Ubuntu, ignore this step, but follow the rest of the tutorial after the installation is finished.)

This solution should fix many problems described by users after an upgrade to 16.04. If a fresh install is affected, the solution is the same.


If you run into problems afterward, you should ask a different question. (Refer to this question so that we know it isn't a duplicate.) However, there are a few other small fixes you can try out before you do.

  • Reinstall Xorg

    • Go back into the TTY and run sudo apt-get purge xorg-* xserver-xorg; sudo apt-get install xorg xserver-xorg; sudo dpkg-reconfigure xorg.
  • Reinstall your desktop environment

    • If on Unity, run sudo apt-get purge ubuntu-desktop; sudo apt-get install ubuntu-desktop.
    • If on GNOME run sudo apt-get purge ubuntu-gnome-desktop gnome-desktop-environment; sudo apt-get install ubuntu-gnome-desktop.
    • If on MATE run sudo apt-get purge ubuntu-mate-desktop mate-desktop-environment; sudo apt-get install ubuntu-mate-desktop
    • Each Ubuntu DE has its own package name. If you have KDE or something else, the name should be similar to the ones above.
  • Fresh reinstall
    • It's not the most inviting option, but sometimes it's the best thing to do in cases like this.

Please remember that there are a lot of things that can go wrong, and this is not a guaranteed fix for everything. Even if you are experiencing something listed in the question, the solution may not fully work for you.

This answer is merely for driver issues with 16.04 and nVIDIA. Your issue may go deeper than a bad driver.


Other issues after the fix

  • If you get to a working display, but run into a login loop (you login and get returned to the login screen), take a look here.
TheWanderer
  • 19,395
  • 12
  • 50
  • 65
  • Hi Zacharee1, I have tried every command line except for the painful refresh reinstall. Nothing worked for my situation. Could you shadow some insight on my case at here? I reported what I did in the comments of the first solution. Maybe the latest kernel is not compatible with any nVidia driver yet. Thanks. – Xiaodong Qi Apr 29 '16 at 05:35
  • 1
    @XiaodongQi Have you tried disabling Secure Boot? The other answers here suggest that fixes the login loop. – TheWanderer Apr 29 '16 at 10:19
  • I did turn the Secure Boot off in BIOS. – Xiaodong Qi Apr 29 '16 at 22:00
  • Similar issue. Nothing of the above helps. Have to either purge nvidia and use Nouveаu or switch to intel with sudo prime-select intel. Tried 340, 364, 352, 361 - no difference. – Pavel May 08 '16 at 10:21
  • @Pavel what's your card? – TheWanderer May 08 '16 at 10:50
  • In my case, the display comes up and freezes a few minutes later...Tried the 364 and it didn't solve it. my card is a geforce gt540M – fccoelho May 08 '16 at 13:34
  • @fccoelho is this a fresh install or an upgrade? – TheWanderer May 08 '16 at 13:35
  • @Zacharee1 Dual head GeForce 820M + Intel HD 4400. – Pavel May 08 '16 at 15:17
  • @Pavel and you have a fresh install? – TheWanderer May 08 '16 at 15:24
  • @Zacharee No, an upgrade from 15.10. Unfortunately, I don't remember which driver version I was using under 15.10. Must've been 352. Actually, there's one curious thing I noticed. I can add the graphics-drivers PPA, I can install drivers from it from terminal, but the "Software & Updates" program only sees the 340; when I install any other version from the PPA, "Software & Updates" shows as if I'm using Nouveau which isn't true. – Pavel May 08 '16 at 15:55
  • 1
    That's very strange. OK, this might break your system even further, but I guess it's worth a shot: sudo apt-get purge nvidia*. No dash before the asterisk. Then try the rest of the steps. – TheWanderer May 08 '16 at 16:03
  • @Zacharee1 And, it's different depending on whether I switch to 340 via GUI (brings login loop which is curable by purging nvidia*) and switching to a newer version via TTY (brings black screen). – Pavel May 08 '16 at 16:04
  • 1
    I think you need to reinstall :/ @Pavel – TheWanderer May 08 '16 at 16:12
  • @Zacharee1 I would've reinstalled already, but I also have a laptop with NV 9300M GS which ran Kubuntu 15.10 + Nouveau. Upgraded it to 16.04, installed 364 driver from PPA.. and got a black screen, too. Purged nvidia, and it works again.. – Pavel May 08 '16 at 16:27
  • @Pavel well they are different situations. – TheWanderer May 08 '16 at 16:32
  • @Zacharee1 A clean install helped. At first, I tried to preserve settings and home; auto-reinstall option was unavailable, so I did a manual reinstall by pointing the installer towards the / and /home partitions. Installation went smoothly but once completed, couldn't boot up: failed to load nvidia kernel modules -> tainted kernel. So I formatted the system partition; did a clean install; migrated home folder back to the home partition; installed 340 (it worked); then 364 from PPA (worked, too). Now OK. So perhaps it's not even the driver which was the problem? Thanks for the advice. – Pavel May 09 '16 at 10:28
  • @Zacharee1 I was experiencing the blank screen after reboot on Ubuntu GNOME 16.04 on each of this drivers: nvidia-361, nvidia-364 and nvidia-367. Nouveau worked fine btw. Only ebridge is already registered message was displayed in terminal. I have nvidia 920m card in my asus R556L. I couldn't find the option to disable secure boot in my BIOS like you suggested, but first I installed the nvidia-364 and then run update-grub and update-initramfs -u and that solved the problem. Maybe this comment will help someone so i'm leaving it here, you can add it to the original answer if you like. – Keammoort Jun 16 '16 at 19:24
  • @Keammoort add your own answer. That was the point of this Q&A :). – TheWanderer Jun 16 '16 at 19:34
  • @Zacharee1 I would, but I only have 101 reputation for association bonus (from stackoverflow) and can't add answers on a protected questions till I earn 9 more so I though at least I will leave a comment :) – Keammoort Jun 16 '16 at 21:00
  • @Keammoort really? The trust rep doesn't get you past that? – TheWanderer Jun 16 '16 at 23:01
  • Does one need to apt-get install nvidia-prime after this? – user3728501 Jun 29 '16 at 22:14
  • @user3728501 I don't think so. – TheWanderer Jun 29 '16 at 22:15
  • Okay separate issue now, I've followed the steps above (purge nvidia-* then install version nvidia-364) and I've just got a blank screen... Before I was having problems where I login and my system either freezes, crashes and turns off, or logs out immediately. I thought this would fix the problem but it's made it worse. Any advice? – user3728501 Jun 29 '16 at 22:19
  • @user3728501 you can try 367 or 368. – TheWanderer Jun 29 '16 at 22:22
  • I'm going back through history now - I recently installed intel-microcode... I'm going to try removing it and rebooting. – user3728501 Jun 29 '16 at 22:23
  • 1
    Ha - this did not help. – user3728501 Jun 29 '16 at 22:25
  • 2
    Still the same symptoms with nvidia-367. – sds Jul 20 '16 at 17:15
  • Yes I'm having similar problems as I explain here http://askubuntu.com/questions/809725/graphic-issues-after-ubuntu-16-04-with-nvidia-gtx-970-second-screen-flickeri Hoping this problem will be resolved through an update of drivers or system soon, but in the meantime it would be nice to see different approaches. Any suggestions? I have tried a fresh install. – Thomas Aug 09 '16 at 14:48
  • Just want to comment that the approach here of adding ppa then trying latest fixed it for me - i was finally able to get my gtx 1060 to work with linux with nvidia-370 package. also for those who can't get into a terminal even with the above, i was able to by booting into recoverymode, then enabling networking (that also mounts filesystem for write), and then dropping from root shell from there, so that you can apt-get purge the nvidia packages that weren't working. – Tom Florkiewicz Aug 25 '16 at 05:14
  • 1
    I got this to work (kind of) for "GeForce GTX 965M hardware". The caveat was that I had to use the 367.57 driver. There appear to be 2 newer drivers (370.28 and 375.26), but when using either of these drivers, and running 2 monitors (one built into the laptop, one external), windows are proportioned oddly and the mouse cursor doesn't respond to clicks (the visible cursor doesn't correspond to its actual location). With the 3.67.57 driver, it works correctly if I plug the monitor in after the machine is booted and I've logged in. – StvnBrkdll Jan 16 '17 at 18:25
  • 1
    awesome, please add a note for others to make sure their second screen is not connected to the laptop (by HDMI) during download/update of driver. I did first and I couldn't get passed login screen. then I removed everything and repeated the process on laptop while was not connected to monitor. This time everything was successful. – Hesam Jan 18 '17 at 04:53
  • I had to use prime-select nvidia – Jan Tojnar Apr 08 '17 at 20:13
  • I didn't need to add the new repository because I noticed that when I did the purge, the output listed the package I needed to install in the subsequent steps. Is this okay? – khatchad Apr 10 '17 at 15:49
  • I'm surprised this didn't tell me to uninstall nouveau. – Selah Sep 27 '17 at 20:49
  • please alter that in newer versions (up to 17) tty mode is running by ctrl + alt + f3 drivers. – Amir Fo Feb 06 '19 at 09:04
  • Better to do sudo apt-get purge 'nvidia-*' to prevent the globbing issue. – Nathan B Oct 22 '19 at 07:10
  • This solved my problem when recent updates to 14.04 LTS caused it to boot to low graphics mode and then couldn't login. The common .Xauthority solution didn't work. From TTY I removed the NVIDIA graphics drivers 384.130. After reverting to nouveau I could login. Then the "can't login" problem re-appeared after I reinstalled the NVIDIA drivers. Fixed again after removing them. Upgraded to 16.04 LTS and then 18.04 LTS. 18.04 LTS then had the same can't login problem with default drivers 340. Opened a TTY, updated to drivers 390 and was then able to login and update to latest drivers 435. – Charles Jan 05 '20 at 20:35
  • This was a bit of a surprising one for me after trying a bunch of different recommended Nvidia drivers for my slightly older laptop I simply removed all Nvidia drivers as in step 2 and it worked fine for me. No more missing driver warnings. – Josh Jan 13 '20 at 05:47
12

I installed Ubuntu 16.04 and everything worked fine until I switched to NVIDIA driver. After rebooting I couldn't get past the login screen. The solution that worked for me was to disable secure boot.

While stuck in login loop, I switched to console Ctl+Alt+F1, rebooted and disabled secure boot in UEFI. Now everything works with nvidia driver installed.

Karhu
  • 451
  • 2
  • 4
  • 9
  • http://askubuntu.com/questions/761886/ubuntu-16-04-kernel-4-4-0-21-not-loading-nvidia-vboxdrv-modules-anymore-require/773852#773852 and you will able to use nvidia and efi – QkiZ Sep 19 '16 at 13:03
  • as should be obvious from the name, disabling secure boot makes you insecure. – tbodt Jan 01 '17 at 20:32
7

For The display is blank & The display flickers

I faced the same issue but now every thing works fine.

There are two solutions to this:

  1. Use NVIDIA driver version 364 from the Graphics drivers PPA (Best Option)

    • sudo add-apt-repository ppa:graphics-drivers/ppa
    • sudo apt update && sudo apt install nvidia-364
  2. Use LightDM instead of GDM

    • sudo apt-get install lightdm
    • choose lightdm as the default when prompted.

NOTE If that didn't work for you, install intel-microcode (if available) from the Additional Drivers app before installing the NVIDIA driver.

TheWanderer
  • 19,395
  • 12
  • 50
  • 65
6

I upgraded from Ubuntu GNOME 15.10 to 16.04 and was faced with a black screen. Using systemctl status and digging through logs, I found that the proprietary NVidia drivers were broken.

Purging nvidia-* and reinstalling gdm got me to low-graphics mode, but reinstalling the NVidia drivers brought back the black screen. As it turns out, Secure Boot had been set to "Windows" in the BIOS settings. I changed it to "Other", and my issue was solved.

Before I found the Secure Boot option I'd tried purging and reinstalling nvidia-*, xorg*, xserver-xorg, ubuntu-gnome-desktop, gnome-desktop-environment. I'm not sure whether or not this helped, but it seems best to put it in. Also, the upgrade tool had said that it would have to disable Secure Boot in order to succeed, but that it would turn it back on afterwards. That is what led me to go look for it.

kd8azz
  • 181
4

I checked the X11 log file at /var/log/Xorg.0.log for (EE) error entries:

root@computer:/var/log# grep EE Xorg.0.log
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   156.124] (EE) No devices detected.
[   156.127] (EE) no screens found(EE) 

so the graphics card was not detected by the nouveau driver.

checking the installed card with lspci gave the following result:

root@computer:/usr/share/X11/xorg.conf.d$ lspci | grep NVIDIA 
02:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210]    (rev a2)
02:00.1 Audio device: NVIDIA Corporation High Definition Audio Controller (rev a1)

With this type of graphics card the answers recommending to install the NVIDIA drivers given here didn't help me since the latest NVIDIA driver doesn't support my card.

Therefore after some internet search i found the suggestion to help the X11 system a bit by specifying the details of the card in a file

/usr/share/X11/xorg.conf.d/20-nouveau-conf and using the info from the lspci command:

# lspci | grep NVIDIA 
# 02:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2)
Section "Device"
   Identifier  "NvidiaGraphics"
   Driver      "nouveau"
   VendorName "NVIDIA Corporation"
   BusID    "PCI:2:0:0"   
EndSection

Now things work like expected and no (EE) error lines show up in the log file.

4

For those who are following the guide but the problem still appears, then maybe it has something to do with the driver itself.

Some of the NVIDIA's GPUs doesn't play well with the newest driver. If you've suspected that you're the victim of that problem, then you can follow my guide below.


Below are just copy paste answer from my own question here.


I did it!! It was a problem with the driver itself!

Problem : My Card (NVIDIA GTX980M) doesn't run well with new proprietary NVIDIA Linux driver. Solution : Use the old driver that supports my graphic card.


Basically, after lurking the internet for a while, some people said that maybe I can try to use stable nvidia-352 instead of new drivers.

However, upon looking at apt-cache search nvidia-352, I have found out that nvidia-352 is just a transition driver for nvidia-361 graphic driver.

However, based on my previous test, nvidia-361 up to newest (nvidia-370 at the time of writing) is the source of my problem.

So I need to download the exact nvidia-352 instead of transition nvidia-361.


If you're having the same problem as mine, then below are the steps on how I solved it.

Steps :

  1. Uninstall all your current problematic NVIDIA drivers.

    sudo apt-get purge nvidia-* libcuda-* 
    

    .

  2. Create temporary folder to store nvidia-352 required files

    cd ~/Desktop
    mkdir nvidia-352
    cd nvidia-352
    

    .

  3. Download the required files for nvidia-352 graphic driver.

    wget https://launchpad.net/ubuntu/+archive/primary/+files/libcuda1-352_352.63-0ubuntu3_amd64.deb
    wget https://launchpad.net/ubuntu/+archive/primary/+files/nvidia-libopencl1-352_352.63-0ubuntu3_amd64.deb
    wget https://launchpad.net/ubuntu/+archive/primary/+files/nvidia-opencl-icd-352_352.63-0ubuntu3_amd64.deb
    wget https://launchpad.net/ubuntu/+archive/primary/+files/nvidia-352_352.63-0ubuntu3_amd64.deb
    

    Edit 1:

    If you have problem downloading nvidia-352_352.63-0ubuntu3_amd64.deb from the link above (occurred to me), you can also download it from different sources.

    Here is an alternative link for that file :

    http://mirrors.mit.edu/ubuntu/pool/restricted/n/nvidia-graphics-drivers-352/nvidia-352_352.63-0ubuntu0.15.10.1_amd64.deb
    

    Edit 2:

    The links above is for 64-bit NVIDIA driver, for those who are looking for 32-bit then do a look at below link :

    https://launchpad.net/ubuntu/+source/nvidia-graphics-drivers-352
    

    The steps are just the same, just you need to download a different files that support your 32-bit setup.

    .

  4. Install all the debs files.

    sudo dpkg -i *.deb
    

    .

  5. Reboot

    .


Voila! If you booted into your desktop without having a single crash, then you have successfully solved this graphic problem!

Enjoy! :D

2

After struggling with this issue for a day and a half, eventually it was solved by disabling secure boot in Bios settings. during installation of driver I was prompted to disable secure boot and I did, but somehow, perhaps because windows is also installed, it was not disabled (while installing). rebooting and pressing F2 (on Asus) I got into Bios, security, then disabled secure boot. rebooted, and voila! Although this may be specific to certain bios versions or dual boot systems, no one posted this solution here before.

1

I tried many solutions and non worked. Finally, I tried this and worked perfectly, without any need to do things like sudo service lightdm stop and so on. Just run the followings:

This shows you the list of compatible drivers for your devices: sudo ubuntu-drivers list

Then run to install the compatible ones:

sudo ubuntu-drivers autoinstall

Finally do (or just restart your machine):

sudo service lightdm restart

Amir
  • 609
  • 1
  • 9
  • 21
0

Every day I check for update and download them using Software Updater. But last night Ubuntu asked me for a partial download (said, something not installed correctly - something like that), so I follow Partial Download process. End of the download process it asked for a restart, so I restart Ubuntu. After reboot, the boot logo and login window are on low-resolution, login loop and no internet connection (wifi + ethernet both I tried)! So, I can't even log in!

I'm using Ubuntu 16.04.2 LTS in ASUS X556UQ Laptop.

After a long experiment (trying above and other solution from Google), I find that the problem occurs for the latest Linux Kernel 4.8.0-42 with Nvidia 378 driver! So I downgrade to Nvidia 370 driver using TTY (Ctrl + Alt + F1) and restart Ubuntu using Linux Kernel 4.8.0-41 (Using grub menu) and all problem solved!

-1

When I first installed Ubuntu 16.04.1 I had graphics issues that were resolved by using nvidia-304 (already mentioned above as a solution). I just updated my system a week or so ago and since then I found myself in the "can't log in loop problem" as many people has already described. Logging in via a tty, I tried installing nvidia-304, 324, 350, and 370. NONE of them worked. Finally I tried something very drastic. I installed Xubuntu 16.04.1. It worked immediately with NO specific effort on my part. So it seems the problem is intimately tied to the desktop manager (Gnome). So if you can switch to Xfce from within a shell window, you might be good with your current version of Ubuntu (sorry but I don't know how to do that). Otherwise, install Xubuntu.

Good luck!

-1

I've been having this login loop problem for months now up to no end. Now I've finally got an answer, and really want to share it with all of you out there who are pulling your hair out for the solution. If there is a simpler way to do this as well, please do tell.

I went to BIOS setup and then disabled the "Onboard display" option. That solved the problem. Now when I opened fedora, it actually started working along with the GPU card and the driver was not installed yet. This was a great improvement from before. After installing the Nvidia driver the OS starting working well.

Joe
  • 17
  • 1
    Please [edit] your answer to focus on the actual solution. Leave out things you have tried without success. This is a question & answer site, not a blog or forum. – Melebius Oct 01 '19 at 12:49
-2

My solutions is this.

OS ubuntu 16.04 nvidia driver before 350, installed in software updates from ubuntu

I download from nvidia the driver 370 and i execute sh./path-to-driver in terminal enter to tty

ctrl alt f1

and kill process lightdm

sudo service lightdm stop

with this commands have problems

Solution

First reboot the pc and my first problem was i cannot enter to desktop in ubuntu and cannot enter to tty terminal, i enter in recovery mode and go to root terminal and make this

nvidia-uninstall

this remove the nvidia driver that your install with command ./nvidia.run

and reboot and look. you need to install driver of ubuntu with

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt-get install nvidia-current

or find in software and updates and install the driver

This solution is my solution of same problem before. i cannot uninstall driver when i download of nvidia web page