Graphics issues after/while installing Ubuntu 16.04/16.10 with NVIDIA graphics
Solution 1
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
- Log into your account in the TTY.
- Run
sudo apt-get purge nvidia-*
- Run
sudo add-apt-repository ppa:graphics-drivers/ppa
and thensudo apt-get update
. - Run
sudo apt-get install nvidia-driver-430
. - Reboot and your graphics issue should be fixed.
3. If you are unable to enter a TTY or are trying to install Ubuntu
- Reboot into GRUB.
- Highlight the
Ubuntu
option and press E. - Add
nouveau.modeset=0
to the end of the line beginning withlinux
. - Press F10 to boot.
- 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
.
- Go back into the TTY and run
-
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.
- If on Unity, run
- 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.
Solution 2
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.
Solution 3
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:
-
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
-
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.
Solution 4
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.
Solution 5
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.
Related videos on Youtube
TheWanderer
I'm an Android app developer, a writer for XDA Developers, and an Ubuntu enthusiast. I ask and answer things sometimes.
Updated on September 18, 2022Comments
-
TheWanderer almost 2 years
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
.-
Admin about 8 yearsFor those stuck in login loop after installing the nvidia driver... please have a look at 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 askubuntu.com/a/761326, if you still want to install the nvidia drivers though... I havent proceeded as my flicker problem has stopped.
-
Admin about 8 yearsMy issue isn't listed, but it certainly qualifies for "NVidia & 16.04" problems. askubuntu.com/questions/789972/…
-
Admin almost 8 yearsI solved this problem with proprietary driver, version 304
-
Admin almost 8 yearsThrough 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.
-
Admin almost 8 yearsI cant answer this question but installing from NVIDIA's drivers with the flag "--no-opengl-files" helped me
-
Admin about 5 yearsA 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.
-
TheWanderer about 8 yearsSo you had a login loop? There are five 'issues' in the question.
-
Independent Peculiar about 8 yearsi had both The display is blank & The display flickers
-
TheWanderer about 8 yearsAh. Well you should probably put that in the answer ;).
-
Xiaodong Qi about 8 yearsHi 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.
-
TheWanderer about 8 years@XiaodongQi Have you tried disabling Secure Boot? The other answers here suggest that fixes the login loop.
-
Xiaodong Qi about 8 yearsI did turn the Secure Boot off in BIOS.
-
Pavel about 8 yearsSimilar 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.
-
TheWanderer about 8 years@Pavel what's your card?
-
fccoelho about 8 yearsIn 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
-
TheWanderer about 8 years@Pavel and you have a fresh install?
-
Pavel about 8 years@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.
-
TheWanderer about 8 yearsThat'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. -
Pavel about 8 years@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).
-
TheWanderer about 8 yearsI think you need to reinstall :/ @Pavel
-
Pavel about 8 years@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 about 8 years@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.
-
Martin R. about 8 yearsAlternatively, run:
sudo dpkg-reconfigure lightdm
if lightdm was already installed. -
Independent Peculiar about 8 yearsjust use nvidia driver version 364
-
pandaadb about 8 yearsHi - I tried 361, 364 and 367 without any success. Tried to reconfigure lightdm as well, no results. I still can not get rid of tearing when scrolling or watching videos/movies. Only solution to have decent graphics is to use intel only through prime-select. I would happily try any other solution if there is something else I am forgetting
-
Keammoort about 8 years@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 runupdate-grub
andupdate-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. -
TheWanderer about 8 years@Keammoort add your own answer. That was the point of this Q&A :).
-
Keammoort about 8 years@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 :)
-
TheWanderer about 8 years@Keammoort really? The trust rep doesn't get you past that?
-
user3728501 about 8 yearsDoes one need to
apt-get install nvidia-prime
after this? -
TheWanderer about 8 years@user3728501 I don't think so.
-
user3728501 about 8 yearsOkay separate issue now, I've followed the steps above (
purge nvidia-*
then install versionnvidia-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? -
TheWanderer about 8 years@user3728501 you can try 367 or 368.
-
user3728501 about 8 yearsI'm going back through
history
now - I recently installedintel-microcode
... I'm going to try removing it and rebooting. -
atilkan about 8 yearsI did exactly, now i can't login ubuntu at all.
-
sds almost 8 yearsStill the same symptoms with
nvidia-367
. -
Thomas almost 8 yearsYes I'm having similar problems as I explain here askubuntu.com/questions/809725/… 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.
-
Tom Florkiewicz almost 8 yearsJust 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.
-
QkiZ almost 8 yearsaskubuntu.com/questions/761886/… and you will able to use nvidia and efi
-
tbodt over 7 yearsas should be obvious from the name, disabling secure boot makes you insecure.
-
StvnBrkdll over 7 yearsI 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.
-
Hesam over 7 yearsawesome, 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.
-
Jan Tojnar about 7 yearsI had to use
prime-select nvidia
-
Raffi Khatchadourian about 7 yearsI 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?
-
Selah almost 7 yearsI'm surprised this didn't tell me to uninstall nouveau.
-
Amir Fo over 5 yearsplease alter that in newer versions (up to 17) tty mode is running by ctrl + alt + f3 drivers.
-
Melebius almost 5 yearsPlease 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.
-
Nathan B over 4 yearsBetter to do sudo apt-get purge 'nvidia-*' to prevent the globbing issue.
-
Charles over 4 yearsThis 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.
-
Josh over 4 yearsThis 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.