Ubuntu – Graphics and resolution problems (Nvidia) in Ubuntu 18.04 after update

display-resolutiondriversgraphicsnvidia

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 (640×480). 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 1920×1080), 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 1024×768 login screen with working login. Still no higher resolution though, but I can at least pick one (1024×768), xrandr still says the same except added highest resolution 1024×768.
  • 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.

Outputs:

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: 640×480 (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.

Best Answer

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.

Related Question