How to install CUDA on old GPU systems

Problem

NVIDIA Driver 41* does not support Kepler GPUs.
So, you can't install CUDA using CUDA Installation run file.

[mutsuki@kaya-01 ~]$ cat /var/log/cuda-installer.log
[INFO]: Setting silent=true
[INFO]: Silent install of all components
[INFO]: Driver not installed.
[INFO]: Checking compiler version...
[INFO]: gcc location: /bin/gcc

[INFO]: gcc version: gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

[INFO]: Initializing menu
[INFO]: Components to install:
[INFO]: Driver
[INFO]: 418.87.00
[INFO]: Executing NVIDIA-Linux-x86_64-418.87.00.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check --install-libglvnd  2>&1
[INFO]: Finished with code: 256
[ERROR]: Install of driver component failed.
[ERROR]: Install of 418.87.00 failed, quitting

Solution

First, download NVIDIA driver installation run file from here and Install NVIDIA Driver.

sudo sh NVIDIA-Linux-x86_64-390.129.run -s
'-s' is a silent installation mode.
In the case of CentOS, you have to install 'kernel-header' and 'kernel-devel' before driver installation.

Second, download CUDA installation run file and install only CUDA toolkit.

sudo sh cuda_9.2.148_396.37_linux.run --silent --toolkit

Date:2019-09-29