Nevertheless you will need to choose a driver that is compatible with the 9800GTX, which restricts you to a 340.xx or 343.xx driver at the latest. This will restrict you to a CUDA 6.5 toolkit at the latest (which you already seem to be aware of.)
My suggestion would be as follows:
Remove the K20c from the system.
Do a clean load of Ubuntu 14.04. Make sure the GUI is working properly with the monitor attached to your 9800GTX. If it is not, this has nothing to do with NVIDIA software, since you haven’t loaded any yet.
Stop the lightdm GUI and X, and switch to command line mode:
- Remove the nouveau driver as described in section 4.3.5 here:
- Select an appropriate 340.xx or 343.xx driver for your system using the runfile installer, such as 340.93 from here:
(you may want to download this runfile installer before stopping the GUI in step 3)
Install the driver using the runfile installer. If you are prompted as to whether you want to install openGL libraries, select yes. If you are prompted whether you want to modify the xorg.conf, select yes.
Restart the GUI (see step 3). At this point, the GUI should be working correctly. If not, stop and troubleshoot this before the remaining steps. You may want to test a reboot cycle.
Power down the system, and install the K20c.
Power up again. Things should still be working correctly. If the GUI is not working correctly, stop and troubleshoot this before the remaining steps. If the GUI was working correctly in step 7, but not now, it may be necessary to edit the xorg.conf file to identify the specific GPU to be used for X with a PCI indicator as described here:
- Download the 64-bit CUDA runfile installer for Ubuntu 14.04 for CUDA 6.5 from here:
Run the CUDA 6.5 runfile installer. When prompted, select “no” to skip the installation of the bundled driver. Your previously installed 340.93 driver will work in this scenario.
Apart from the above, review and follow the steps for CUDA runfile installation in the linux getting started guide: