Ubuntu – Black screen when in nvidia mode after updating to kernel 3.13.0-45

nvidia

After I updated to kernel 3.13.0-45, I cannot use nvidia anymore. Whenever I try to switch to nvidia mode, my laptop screen goes black. I cannot even switch to terminal mode using ctrl+alt+F1. However, I can type the following without seeing anything on the screen:
first type my password to login and press enter (without seeing anything). wait a little bit.
ctrl+alt+T . Then
sudo prime-select intel (then password and hit Enter)
And finally
sudo reboot

The laptop reboots and then I get my screen again in Intel mode. So it seems that while not being able to see anything with the black screen, everything is still working in background.
This happens whatever the version of nvidia I am using.

My laptop is a Lenovo T430. I am using Ubuntu 14.04 and I am also using nvidia-prime. My kernel version is 3.13.0-45.

Best Answer

I was having exactly the same problem with nvidia-346 and kernel 3.13.0-45 on Ubuntu 14.04 amd64. After too many hours of searching and experimentation, I managed to fix it. I explain the whole problem along with a solution in detail here: http://vxlabs.com/2015/02/05/solving-the-ubuntu-14-04-nvidia-346-nvidia-prime-black-screen-issue/

In short, try the following:

  • Switch to console (Ctrl-Alt-F1) and stop lightdm: sudo service lightdm stop

  • Disable gpu-manager by commenting out everything in /etc/init/gpu-manager.conf

  • Switch to nvidia mode by doing sudo prime-select nvidia

  • Change your /etc/X11/xorg.conf to look like the one at the bottom of this answer, making sure that the nvidia BusId is correct (check with lspci):

  • Start X up again with sudo lightdm start

If after this you still get a black screen, please double-check that your xorg.conf has not been reset to the configuration without modesetting. If so, make sure that lightdm has been stopped and gpu-manager disabled before you edit the xorg.conf to change the intel driver to modesetting.

Switching back to Intel you will have to stop lightdm, re-enable gpu-manager, activate intel mode with sudo prime-select intel and then restart X with sudo service lightdm start.

It's very possible that later versions of gpu-manager might have fixed this behaviour.

Here's the correct xorg.conf:

Section "ServerLayout"
  Identifier "layout"
  Screen 0 "nvidia"
  Inactive "intel"
EndSection

Section "Device"
  Identifier "intel"
  Driver "modesetting"
EndSection

Section "Screen"
  Identifier "intel"
 Device "intel"
EndSection

Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BusID "PCI:1:0:0"
EndSection

Section "Screen"
  Identifier "nvidia"
  Device "nvidia"
  Option "UseDisplayDevice" "None"
EndSection