nstall CUDA-7.5 for Telsa K40c on CentOS 7

(The installation is for our new assembled CentOS 7 desktop. Please change accordingly if you have other OS)

The followings changes are made as root.
See "CUDA_Installation_Guide_Linux" and "NVIDA CUDA Getting Started Guide for Linux" for details:

http://developer.download.nvidia.com/compute/cuda/7.5/Prod/docs/sidebar/CUDA_Installation_Guide_Linux.pdf
http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/#axzz3wsTHRso9

1. Pre-Installation
‣ Verify the system has a CUDA-capable GPU.
(make sure you have added ELRepo)
$ yum install nvidia-detect
$ nvidia-detect -v
[10de:1024] NVIDIA Corporation GK110BGL [Tesla K40c]
This device requires the current 352.63 NVIDIA driver kmod-nvidia
[1a03:2000] ASPEED Technology, Inc. ASPEED Graphics Family

‣ Verify the system is running a supported version of Linux.
$ uname -r
3.10.0-327.el7.x86_64

‣ Verify the system has gcc installed.
$ gcc - - version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)

‣ Verify the system has the correct kernel headers and development packages installed.
$ rpm -qa | grep kernel | sort
abrt-addon-kerneloops-2.1.11-36.el7.centos.x86_64
kernel-3.10.0-327.4.4.el7.x86_64
kernel-3.10.0-327.el7.x86_64
kernel-devel-3.10.0-327.el7.x86_64
kernel-headers-3.10.0-327.4.4.el7.x86_64
kernel-headers-3.10.0-327.el7.x86_64
kernel-tools-3.10.0-327.4.4.el7.x86_64
kernel-tools-3.10.0-327.el7.x86_64
kernel-tools-libs-3.10.0-327.4.4.el7.x86_64
kernel-tools-libs-3.10.0-327.el7.x86_64

2. Change OS to Text Mode (Multi-user Mode)
$ systemctl get-default
$ systemctl list-units --type=target
$ systemctl set-default multi-user.target
$ systemctl get-default
$ reboot


3. Block nouveau
$ lsmod | grep nouveau
(You shall see a few outputs)

$ vi /etc/modprobe.d/blacklist-nouveau.conf
add two lines:

blacklist nouveau
options nouveau modeset=0

$ dracut - - force
$ reboot

$ lsmod | grep nouveau
(You shall see NO output)


4. Install Cuda-7.5
$ sh cuda_7.5.18_linux.run

This will install:
a. NVIDIA Accelerated Graphics Drive for Linux_X86_64 352.39
b. OpenGL libraries
c. CUDA 7.5 Toolkit
d. CUDA 7.5 Samples

There is no need to install NVIDIA Drive (NVIDIA-Linux-x86_64-352.63.run) before installing CUDA
Do please make sure the version matches.

The default install location will be:
/usr/local/cuda-7.5

A symbolic link will be created at:
/usr/local/cuda

The CUDA 7.5 Samples will be installed to the default location /root.
Notice that some recommended libraries are missing for those samples.


5. Post-Installation
a. PATH include:
/usr/local/cuda-7.5/bin

b. LD_LIBRARY_PATH include:
/usr/local/cuda-7.5/lib64

Method 1:
At /etc/ld.so.conf.d folder create a file 'cuda-7.5.conf', add the following line:
/usr/local/cuda-7.5/lib64

$ ldconfig
$ ldconfig -v | less

Method 2:
Add the following line in .bashrc (bash)
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH


6. Uninstall
CUDA Toolkit:
use the uninstall script at /usr/local/cuda-7.5/bin

NVIDIA Drive: run nvidia-uninstall




First draft, January 10, 2016.
Email me (HLL at OU dot EDU) if you have questions or comments.
The Huang Group at The University of Oklahoma
@ The Huang Group
Publication
Research
People
Course
Wiki
News