I recently updated from Ubuntu 14.04 to 16.04 to 18.04 (i.e. I am now on 18.04 bionic, and started on 14). In 16.04 everything worked ok, but now I have some severe graphics problems:

Problem(s) description:

First I got the log in screen in correct resolution, but it froze with a black screen showing the mouse cursor (frozen) directly after logging in. I fixed this by installing new Nvidia drivers, following answers here.

After rebooting I got the log in screen with low resolution (640x480). Logging in works fine, but the resolution is still low, and as a result I cannot see the whole screen. Changing resolution does not work: When entering display settings, it says 'Unknown Display', and the Resolution field is just empty and grey (literally no text or figures at all apart from the word 'Resolution'), and clicking it results in a small grey empty speech bubble appearing, but nothing happens.

I tried looking for solutions in several places, such as:

Ubuntu 18.04.1 LTS unable to change resolution

Ubuntu 18 scale problem

and here, but it is for older versions, and perhaps does not seem to apply that well to my situation anyway.

What I have tried:

  • I have checked the zoom feature: It is off.
  • I looked for 'nomodeset' in /etc/default/grub ,but nothing.
  • I have run apt-get purge xserver-xorg-video-intel , and installed the recommended nvidia drivers via ubuntu-drivers autoinstall , these happens to be nvidia-driver-440
  • EDIT1: I have checked the current drivers in use via Software&Updated/Additional Drivers. The drivers I have tried are: nvidia-driver-440 (recommended), nvidia-driver-435, nvidia-driver-390, and xserver-xorg-video-nouveau. I have applied the changes, I have rebooted after each change, and I have checked that the drivers I've changed to are in use (via 'Software & Updates').
  • EDIT2: I have sucessfully run sudo apt-get purge nvidia-*;add-apt-repository ppa:graphics-drivers/ppa; sudo apt-get update; sudo apt-get install nvidia-driver-440.
  • EDIT2.1: Also, After purging nvidia-*, (not reinstalling anything) and rebooting (with xorg drivers) Ubuntu actually gives me a higher res login screen (at least 1920x1080), but it is now back to freezing on a black screen with frozen mouse pointer after login. Choosing 'recovery mode' in GRUB, and the option 'resume' then weirdly gives me a 1024x768 login screen with working login. Still no higher resolution though, but I can at least pick one (1024x768), xrandr still says the same except added highest resolution 1024x768.
  • EDIT3: About Secure Boot: My Bios says: Secure Boot State: Disabled; Platform Key State: Unloaded; OS Type: Other OS. This was described as the best setting for non Secure Boot compatible operating systems, so I understand it as being disabled.
  • EDIT4: lsmod | grep -i i915 returns the empty string (while running either nvidia-440 or xorg). nvidia-smi returns (running nvidia-440):

    NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

I still have the same problem, and get the same outputs below.


Here's the output of 'lspci | grep -i vga':

01:00.0 VGA compatible controller: NVIDIA Corporation GK106 [GeForce GTX 660] (rev a1)

And of 'xrandr':

xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640 x 480, current 640 x 480, maximum    640 x 480
default connected primary 640x480+0+0 0mm x 0mm
640x480       73.00*

Hardinfo shows me: Graphics: 640x480 (Unknown) The X.Org Foundation

And lshw -c -video gives me:

*-display UNCLAIMED
   description: VGA compatible controller
   product: GK106 [GeForce GTX 660]
   vendor: NVIDIA Corporation
   physical id: 0
   bus info: pci@0000:01:00.0
   version: a1
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress vga_controller bus_master cap_list
   configuration: latency=0
   resources: memory:f6000000-f6ffffff memory:e8000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:f7000000-f707ffff

The xrandr output stays the same, no matter which of the above listed drivers I try.

Specs, Conclusion and Question:

Obviously there seems to be some problem reported by xrandr, but my knowledge here is very slim, and I don't really know what the problem means, or how to fix it. I'm guessing this is driver related, but I just don't know how to proceed.

Otherwise I'm on a Intel i7-3770 PC with a Samsung monitor connected via a Display Port connection to a Nvidia GTX 660. And, again, everything worked in both 14.04 and 16.04, and works fine in Windows 7.

Question: Do anyone have any further suggestions on how to resolve this problem? It would be highly appreciated. I've had other graphics related problems with Nvidia and Ubuntu 18.04 on other computers, but not like this.

  • Definitely reboot so that different driver can kick in.
    – K7AAY
    Nov 25, 2019 at 21:43
  • I got the feeling it did kick in anyways, but perhaps not. Also didnt figure this was a solution since Id tried both the recommended 440 with reboot, and I think 390 was the first one I tried so I guess I actually had a reboot there. But not for the others I switched between in 'additional drivers'. I will try this again tomorrow though, and update. Nov 25, 2019 at 21:50
  • @K7AAY I have now updated the question. I have tried many different drivers, and have rebooted after each change. I still can't change resolution, and xrandr still says: "Failed to get size of gamma for output default". I'm still stuck in 640x480 and cannot change. Dec 25, 2019 at 18:15
  • Is Secure Boot disabled?
    – Pilot6
    Dec 25, 2019 at 19:06
  • You need to make sure that You have purged/removed all nvidia drivers before installing a selected one! Dec 25, 2019 at 19:12

7 Answers 7


system: ubuntu 18.04
My solution was

$ sudo apt purge nvidia*
## if you reboot here , the computer will use Nouveau driver.
##check the recommended drivers
$ ubuntu-drivers device
## that show me 390 as recommended but didn't work , 340 works in my case
$ sudo apt install nvidia-340

Reboot the computer.

  • 1
    As written clearly in my question, I had both tried the noveu drivers with and without purging nvidia drivers, it did not work. Jan 19, 2020 at 10:49
  • This helped a lot
    – AturSams
    Apr 15, 2021 at 21:12
  • 1
    Thank you for the advice. It worked for me on Ubuntu 20.04.2 LTS using the driver nvidia-driver-465 for my card GeForce GTX 1050
    – KodeFor.Me
    Jun 4, 2021 at 5:57

Please note that the NVidia 435 and 440 drivers are not compatible with Linux kernel versions 4.xx.x.

The above answers are all partially correct. On Ubuntu 18.04, you should update to NVidia 435 or 440 drivers in order for the computer to boot properly. However, for some users (like OP) with outdated kernel versions, this will result in issues with the resolution settings & monitor inputs.

Please check your kernel version by running uname -r.

I had all of the issues on this thread. Tried every suggestion & they were not enough. I kept hunting down the errors, which brought me to this forum post.

Finally, the solution was to update the kernel to 5.3.0 with (source):

sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04


Since I was unable to solve these issues, and as it was suggested in the comments above, I just did a fresh install.

I noted that even the gui installation was buggy though. It hung on me several times, and I saw weird checker patterns appearing. Around about the third time or so, the installation managed to get all the way through, I guess going without gui would have been better. Afterwards, ubuntu-drivers recommended nvidia-435 instead of 440 as earlier. I installed them using ubuntu-drivers autoinstall, and now everything works fine.

I never had such issues with any other linux dist on this computer, and I had similar issues with 18.04 + nvidia on a different computer. So, I really wonder what's up with 18.04 + nvidia (?).

Hopefully this question/answer can still serve as somewhat of an additional trouble shooting guide for people with similar problems; I know it would've for me.


right solution just small correction on:

$ ubuntu-drivers devices # to check possible devices for nvidia card.

Driver 390 also showed by me did worked since install off 18.04 till this week sudden it does not work anymore. nvidia-340 works perfect by me. Nouveau drivers also but they give not full use of device possibility .

However since 18.04 did worked ok before with nvidia 390 drivers now anymore it looks to be a problem from one of the last updates. 390 self.

I always have a crash repport nvidia-dkms-390.0.crash into /var/crash. Suspect an error during config and or build of module due to ... I do have card GeForce GT 440 and it should be ok with driver version.

For the time working with 340 version thanks to christianbueno.1 That is a very good temporary solution.

Ok Finally it's ok. EUREKA SOLVED. PC is now running with nvidia-driver-390 like it should be. How to do :

(In the mean time I was with 340 as used driver version). When I analysed the build report of 390.116 driver version included in base ubuntu 18.04. Could be seen that build of nv modules failed. The real reason I could not find but suspected some error in source who I guess do not build anymore since last gcc version update and or some missing stuff.So I decided to use the last avbl source version on ubuntu using ppa:graphics-drivers.

$ sudo add-apt-repository ppa:graphics-drivers

$ sudo apt-get update

$ sudo apt-get upgrade

It updated 340 and installed a lot of extra graphic stuff. Reboot pc. It runned fine.

Then removed 340 (purged)

$ sudo apt remove --purge nvidia*

checked recomended drive with $ ubuntu-drivers. 390.129 version was preferred.

$ sudo ubuntu-drivers autoinstall.

Build of dkms modules went fine now installation ok. Reboot ok now running with last version avbl by ubuntu of nvidia-390 driver.

  • Just confirming that this solution worked for me. I just had the same problem after a minor update on Ubuntu 20.04 LTS using a GTX 970. It just refused to detect the monitor and was stuck at 1024x768. Using the Settings > Screen Display I was able to switch to X.org and it worked. Then I followed the above instructions to add ppa:graphics-drivers, apt-get update, apt-get upgrade then run ubuntu-drivers autoinstall, which installed the 440 drivers (current). Reboot and it worked. Jul 5, 2020 at 0:06

I solved this trouble in Ubuntu 18.04 LTS relatively easily in this way: I updated the driver from 'Software & Updates', in the 'Additional drivers' tab. I selected nvidia-driver-440. It appears a progress bar, when it is over, I rebooted. After reboot, my resolution was higher than before, but not yet FHD resolution. So, I went to Settings-> Devices->Displays and now I can change the resolution to 1920*1080.


In my case I had nvidia drivers issues after changing system default gcc.

I had only one resolution option (800x600) and I've found a hint on the nvidia thread (https://forums.developer.nvidia.com/t/nvidia-driver-is-not-loaded-ubuntu-18-10/70495/2).

You have your system compiler set to clang/llvm but gcc 7.5 is needed. Please set your cc back to gcc-7.5 using update-alternatives


I discovered that when installing the drivers, it asks for a password for secure boot. After rebooting Ubuntu, you need to enrol the MOK. If you don't do the enrolment, then Ubuntu will still boot but not with the Nvidia drivers. So it will use the default driver.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.