[Updated on Jan 22 2015].

Purpose

I needed the latest driver to use GeForce GTX Titan Z.

Preparation

  • The PC must be connected to the network.
  • Prepare another PC connected to the same network (necessary to login remotely during installation).

Methods

The driver installation is divided into 3 parts.

Part 1

  • Install Kubuntu 14.04 normally
  • Login, open the terminal and perform the following
  • Update the installed packages
    • # apt-get update
    • # apt-get upgrade
    • # reboot
  • Install additional necessary packages
    • # apt-get install build-essential dkms ssh
  • Purge packages related to nouveau driver
    • # apt-get purge libdrm-nouveau2:amd64 xserver-xorg-video-nouveau
    • Do purge. apt-get remove doesn’t work well
    • This removes kde-window-manager kde-workspace kubuntu-desktop. Later we will install them again
  • Check the IP address for remote login
    • /sbin/ifconfig -a
  • [Added on Jan 22 2015] I found that this procedure doesn’t work for another PC. After working out a little bit, I found that the following are necessary.
    1. Add ‘blacklist nouveau’ in /etc/modprobe.d/blacklist.conf
    2. # update-initramfs -u
    3. # reboot

    After rebooting, you can see only black screen, but don’t worry. This is because the video driver isn’t installed. You can login remotely by ssh. So, go to Part 2.

Part 2

  • Login from another PC remotely
  • Shutdown X server
    • /etc/init.d/lightdm stop
  • Install the latest driver
    • # sh ./NVIDIA-Linux-x86_64-340.24.run
    • Ingore the message on the failure of pre-install script
    • Select to register kernel module with DKMS
    • Ask to edit the configuration files for X server
  • Reboot to enable the installed driver
    • # reboot
    • Always fails to reboot here with some unknown reasons
    • When failed, press the reset button

Part 3

  • Confirm the Kubuntu screen and login
  • Reinstall the removed packages
    • # apt-get install kde-window-manager kde-workspace kubuntu-desktop
  • Reboot again
    • # reboot
  • Confirm the version of the used driver
    • $ nvidia-settings

Done.

Next, we install CUDA.

  • Download CUDA 6.0.37 from NVIDIA
    • Available deb packages are only for 12.04 and 13.04, so download the run package (cuda_6.0.37_linux_64.run)
  • Installed gcc and g++ are too new (4.8), so we install 4.7 as well
    • # apt-get install gcc-4.7 g++-4.7
  • Set the default compilers to 4.7 (Ref)
    • # update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.7 10
    • # update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
    • # update-alternatives –install /usr/bin/g++ g++ /usr/bin/g++-4.7 10
    • # update-alternatives –install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
    • # update-alternatives –config gcc
    • # update-alternatives –config g++
  • Start installation
    • # sh ./cuda_6.0.37_linux_64.run
    • Yes for ‘install with unsupported configuration?’
    • No for ‘install driver 331.62?’
  • Set paths
    • # vi /etc/ld.so.conf.d/cuda6.conf
    • write one line /usr/local/cuda-6.0/lib64
    • # ldconfig
    • vi /etc/login.defs
    • Add /usr/local/cuda-6.0/bin to PATH
    • Add export PATH=/usr/local/cuda-6.0/bin:$PATH to my ~/.bashrc just in case
  • Install necessary packages to compile samples
    • # apt-get install libglu1-mesa-dev libxi-dev libxmu-dev freeglut3-dev
  • Compile samples
    • $ cd NVIDIA_CUDA-6.0_Samples
    • $ make

Done.

snapshot1