I eventually solved my problem with my nvidia.
I found the fix on the post #15 of https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-331/+bug/1362848
Here how I fixed in details:
Log out and go to the console:
CTRL-ALT-F1
if (like me) you tried to install latest nvidia driver (nvidia-340 ...), you need to revert back with following commands:
sudo apt-get install ppa-purge
sudo ppa-purge xorg-edgers
sudo apt-get purge nvidia*
Then copy all xorg config files in a temporary dir:
cd
mkdir temp
sudo mv /etc/X11/xorg.conf* ./temp/
Then clean, update, upgrade and reboot the system:
sudo apt-get autoremove
sudo apt-get update
sudo apt-get upgrade
sudo reboot
Go to the console:
CTRL-ALT-F1
Install nvidia 331:
sudo apt-get install nvidia-331 nvidia-prime
Copy the old xorg.conf made by nvidia back in its directory:
sudo cp temp/xorg.conf.nvidia-xconfig-original /etc/X11/xorg.conf
And edit it (I used vi, you may prefer nano):
sudo vi /etc/X11/xorg.conf
To be as the following:
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "intel"
Driver "intel"
BusID "PCI:0@0:2:0"
Option "AccelMethod" "SNA"
EndSection
Section "Screen"
Identifier "intel"
Device "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1@0:0:0"
Option "ConstrainCursor" "off"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration" "on"
Option "IgnoreDisplayDevices" "CRT"
EndSection
Eventually reboot the system:
sudo reboot
Now I have nvidia set as graphic card and the hardware acceleration works fine.
I had this issue too with the nvidia drivers and Ubuntu 18.10. I found a thread on the French Ubuntu website which helped me. It's a fix for Ubuntu 17.10 but it worked for me on 18.10.
Try this:
Edit /etc/gdm3/custom.conf
:
sudo gedit /etc/gdm3/custom.conf
Here uncomment the line
#WaylandEnable=false
which becomes also
WaylandEnable=false
Don't forget to save!
With this you should be able to install the nvidia drivers (I'm using the 390 version which works for me).
Source
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 withlspci
):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-enablegpu-manager
, activate intel mode withsudo prime-select intel
and then restart X withsudo service lightdm start
.It's very possible that later versions of
gpu-manager
might have fixed this behaviour.Here's the correct xorg.conf: