Nvidia drivers don't work with mainline kernel

Solution 1:

(answering my own question, as Bruno suggested in comments)

This problem is fixed by installing the Nvidia-provided drivers by hand, following the below steps.

  1. Download the drivers from the Nvidia website
  2. Reboot into recovery mode as the drivers won't install with X running. Do this by rebooting, holding shift if necessary to get into Grub and choosing the recovery option, then "Root shell" at the text menu.
  3. You should now be faced with a shell that looks something like this:

    root@sirius:~# 
    

    Enter the following command so that the root filesystem is writable:

    mount -o rw,remount /
    
  4. Install a few required packages (you may need to do dhclient eth0 to bring the network up beforehand):

    apt-get install dkms
    
  5. Make the Nvidia installer executable and run it:

    chmod +x $INSTALLER_FILE
    ./$INSTALLER_FILE
    

    where $INSTALLER_FILE is the location where the installer is downloaded to (use tab-completion to help you, probably something like /home/josh/Downloads/NVIDIA-Linux-x86_64-302.17.run)

  6. Work through the steps in the installer. The defaults should work.

  7. Reboot into a normal system.