Nvidia drivers installed, but not used

Okay, I found out of it.

I did a full apt-get purge nvidia* and apt-get dist-upgrade etc. But the thing that fixed it was actually to set the alternative correct. I guess this would've worked from the start. So here's how:

$ sudo update-alternatives --config x86_64-linux-gnu_gl_conf

  Selection    Path                                       Priority   Status
------------------------------------------------------------
  0            /usr/lib/nvidia-310/ld.so.conf              9702      auto mode
  1            /usr/lib/nvidia-310/ld.so.conf              9702      manual mode
* 2            /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf   500       manual mode

As you see, for me, this setting was wrongly set. So I used 0 instead, and lo' and behold. Lots more nvidia- utilities in the PATH.

If you're not on 64-bit, then use i386 instead of x86_64.


Install latest nvidia drivers

sudo apt-get install nvidia-313-updates

Generate /etc/X11/xorg.conf by executing

sudo nvidia-xconfig

Then execute

sudo software-properties-gtk which will show you a window like this

enter image description here

Select the latest driver from that list and then do

sudo reboot


For those of you that end up in this thread when shooting in the Google dark because nvidia drivers are loaded, but all graphics in X go through the CPU instead of the GPU.

Symptoms

  • nvidia drivers were loaded correctly (lsmod | grep nvidia)
  • under X, nvidia-settings was reporting no issues accessing my GTX 680 GPU

BUT

  • any graphics-intensive program would drive CPU load unusually high, instead of the expected load on the GPU. For example, games would stutter even at an animated main menu, glxgears (from the mesa-utils package) would load the CPU up to 10%, unigine load test would show FPS around 2 and lock up on first scene.

The misleading factor was that nvidia-settings was not reporting any problems accessing the GPU. I did what most threads suggested (purged and reinstalled nvidia drivers), but to no effect. In desperation I finally checked Xorg.0.log in /var/log: it turned out that X was loading it's own libglx.so module instead of nvidia's. Now that I was asking the right question, I got the proper answer (Xorg loads wrong libglx.so).

Solution

Originally the Files section in my /etc/X11/xorg.conf was empty:

Section "Files"
EndSection 

I found where nvidia keeps its own libglx.so (more precisely, I found where it keeps a symlink to it). The solution is to tell X to first look for modules in nvidia's path, and then in Xorg's path, so the Files section now looks like this:

Section "Files"
    ModulePath "/usr/lib/nvidia"
    ModulePath "/usr/lib/xorg/modules"
EndSection 

I'm on Debian, but as Ubuntu is based on Debian, a similar approach should work on Ubuntu systems.


I experienced problem with nvidia module not found after update too. Just black screen - no grafics at all. I have tried different commands, so maybe I miss some important actions, but I provided that sequence, and it helps:

boot Ubuntu recovery, root shell

mount -o remount,rw /
mountall
<log in as user>
sudo  apt-get remove nvidia-340 nvidia-340-updates

then reboot the computer. I have already installed nvidia-331 &Co installed.