Google Analytics

Tuesday, December 3, 2013

Ubuntu and NVIDIA - header problem

I recently installed a Ubuntu software update, which made use of a new Linux kernel.

On reboot, I found the GUI screen to be in this huge, clunky graphics mode, where only about 1/3 of my screen was now visible.

It was obvious something was different about usage of my NVIDIA graphics card.

I did a lot of research, and finally got it working again - until the next update that included a new kernel.  Same goes for upgrades - they also broke my NVIDIA graphics card normal operation.

One of the things my research led me to was the Bug Reports for Ubuntu.  The developers have made a deliberate decision, after identifying the problem with the updates/upgrades to kernels which causes the NVIDIA driver to not function correctly, to not include some header files that are needed.  It appears they are being 'purists' instead of making a simple addition to the distribution that would prevent this problem.

As it turns out, NVIDIA drivers need to be built for the specific kernel that is being run.  And, in order to be rebuilt, NVIDIA needs the new header files (have a look at /usr/src/linux-headers* and you should see some linux-header folders) - it needs the source header files for the new kernel, and these new source header files are deliberately not being included in the Ubuntu update/upgrades, even though the developers know this is a problem - they are willing for you, and thousands of other users, to not have a working computer and expect you to fix this problem yourself.

So - this is how I went about fixing my problem.
Note: here's a useful link.

I didn't know where my original NVIDIA driver was at, and didn't really care to find it - I wanted to make sure I was running the newest drivers.

From a high level, this is what I did - I am not saying this will work for you, and in fact it may cause you problems with your system.  More detailed information will follow.

Outline:
( I am not an expert.  I am not responsible for any problems caused from use of this information.  You assume all risk.  If something goes wrong, I will not help you.):

  • I downloaded the NVIDIA driver for my card and Operating System.
  • I changed the NVIDIA driver script to executable
  • I went to a user console (this is not a X-Terminal) - NVIDIA wants the X GUI stopped.
  • stop the X GUI
  • I moved to my download directory where I placed the NVIDIA driver
  • I ran the NVIDIA driver script - it will report an error for missing source linux-header files
  • I noted the missing source linux-header file
  • I downloaded and installed the missing linux-header file
  • I ran again the NVIDIA driver script - this time it succeeded
  • I rebooted


From a detailed level, this is what I did - I am not saying this will work for you, and in fact it may cause you problems with your system.  More detailed information will follow.


Details:
 ( I am not an expert.  I am not responsible for any problems from use of this information.  You assume all risk.  If something goes wrong, I will not help you.):


  1. I made a backup of my Operating System before proceeding, in case something went wrong), and placed this backup onto a different hard drive. I know how to reinstall this backup successfully, having tested doing so in the past. 
  2. First, I downloaded the NVIDIA driver for my operating system (64 bit), and for my graphics card (series 500), from this site (current as of 12/3/13).  
    1. My default download location is ~/Downloads.  http://www.nvidia.com/Download/index.aspx
  3. I went to a user console (this is NOT an X-Terminal)
    1. I Depressed simultaneously these keys: Ctrl-Alt-F1
    2. I logged into my computer with my userid and password
  4. I stopped the X GUI - (NVIDIA shell script requires this)
    1. sudo stop lightdm
  5. I changed to my Downloads directory where I had placed my NVIDIA driver
    1. cd ~/Downloads
  6. I changed the NVIDIA driver script to be executable (my downloaded driver was named NVIDIA*.run   - the * is mine, to keep from typing the whole string)
    1. sudo chmod +x NVIDIA*.run
  7. I executed the NVIDIA*.run shell script
    1. sudo sh NVIDIA*.run
    2. I selected Yes to all questions.
    3. This should produce an error message - if it had not,  I would have tried rebooting now, as I was probably good to go)
  8. I Noted the error message where it mentions the 'linux-headers' source file - this is the header files the NVIDIA driver needed to be download and installed
  9. I obtained the specific linux-header source file identified by the NVIDIA.run script and installed it
    1. sudo apt-get install linux-headers-THE-FULL-NAME-I-OBTAINED-FROM-ERROR-MSG
    2. Example: sudo apt-get install linux-headers-3.11.0-12-generic
  10. I re-ran the NVIDIA*.run shell script
    1. sudo sh NVIDIA*.run
    2. I selected Yes to all questions
    3. It reported success
  11. I rebooted my compuer
    1. sudo reboot
  12. My computer rebooted, and my problem was fixed.