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