*  CentOS 7 : installation of CUDA 6.5 to 8.0

The objective here is to propose a method of installation making it possible for several versions of CUDA to cohabit.

The installation described here was done the 10/20/2016 on a freshen udpate system by using :

sudo yum update && yum upgrade

We add the nvidia key and repository from www.elrepo.org :

sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

Then we install nvidia-detect

sudo yum install nvidia-detect

When we run nvidia-detect, we obtain as result kmod-nvidia. So we install it

sudo yum install kmod-nvidia

The version of the installed driver is the 367.57-1. A reboot is needed to use the new driver.

For each CUDA version there is a minimal version of Nvidia driver for which CUDA functionality works

CUDA version Driver version download link

6.5 >= 340.00 cuda_6.5.14_linux_64.run

7.0 >= 346.00 cuda_7.0.28_with_346.75_linux.run

7.5 >= 352.00 cuda_7.5.18_linux.run

8.0 >= 361.00 cuda_8.0.44_linux-run

So we can download and install all these versions !

Before starting CUDA installation, we install the gcc, g++ and gfortran compiler

sudo yum install gcc gcc-c++ gcc-gfortran

The current version is the 4.8.5-4.

We also install some libraries to avoid some warning messages

sudo yum install mesa-libGLU-devel libXi-devel libXmu-devel

Otherwise, on my computer, I have these warning messages during the installation process :

Missing recommended library: libGLU.so  
Missing recommended library: libX11.so  
Missing recommended library: libXi.so  
Missing recommended library: libXmu.so

Due to an unsupported compiler (version 4.8.5), we use –override option for CUDA 6.5 installation.

chmod u+x cuda_*.run
sudo ./cuda_6.5.14_linux_64.run --silent --verbose --toolkit --samples --samplespath=/usr/local/cuda-6.5/samples --override
sudo ./cuda_7.0.28_with_346.75_linux.run --silent --verbose --toolkit --samples --samplespath=/usr/local/cuda-7.0/samples
sudo ./cuda_7.5.18_linux.run --silent --verbose --toolkit --samples --samplespath=/usr/local/cuda-7.5/samples
sudo ./cuda_8.0.44_linux-run --silent --verbose --toolkit --samples --samplespath=/usr/local/cuda-8.0/samples