文栏 - 信息技术 - 浏览文章 - Installing NVidia Driver, CUDA Toolkit 7.5 and CUDA samples on CentOS 7.2 1511 GOME DESKTOP
Installing NVidia Driver, CUDA Toolkit 7.5 and CUDA samples on CentOS 7.2 1511 GOME DESKTOP
发布时间: 2016/5/18 23:18:52 作者: 素素, 彭彭 出处: 本站发布

Pre-Installation

Update packages

# yum update -y

Install general deps, to install gcc, g++, Peal and other necessary packages

# yum groupinstall "Development Tools" -y

Install wget

# yum install wget

Disable the Nouveau drivers

The Nouveau drivers are loaded if the following command prints anything

# lsmod | grep nouveau

Create a file at /etc/modprobe.d/blacklist-nouveau.conf

# vim /etc/modprobe.d/blacklist-nouveau.conf

Fill the file with following contents: (if copying, copy line by line and enter the newline by yourself, or it will not active)

blacklist nouveau
options nouveau modeset=0

Check the file content

# cat /etc/modprobe.d/blacklist-nouveau.conf

Regenerate the kernel initramfs, reboot system and verify that the Nouveau drivers are not loaded

# dracut --force
# # reboot    # comment to avoid unexpected reboot
# lsmod | grep nouveau

Prepare Kernel

The order is a little different from that on CentOS 6.x. dkms is installed at the last stage.

# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
# rpm -K rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# rpm -i rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# yum install kernel-devel kernel-headers

# yum install epel-release
# yum repolist

# yum install dkms

Install Cuda Toolkit

Go to this page https://developer.nvidia.com/cuda-downloads. Select Linux, x86_64, CentOS, 7, runfile(local), Download. Check the MD5 for your downloaded file. Recommended Version: cuda_7.5.1_linux.run

Transfer the cuda_7.5.18_linux.run to your system

# mkdir /opt/cuda_items
# cd /opt/cuda_items/
# wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run

Change the system up level to runlevel3

# init 3

Run the installer and follow the on-screen prompts

# chmod +x cuda_7.5.18_linux.run
# sh cuda_7.5.18_linux.run

Options for the run file

Do you accept the previously read EULA? (accept/decline/quit):accept
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 352.39? ((y)es/(n)o/(q)uit): y
Do you want to install the OpenGL libraries? ((y)es/(n)o/(q)uit) [ default is yes ]: y
Install the CUDA 7.5 Toolkit? ((y)es/(n)o/(q)uit): y
Enter Toolkit Location [ default is /usr/local/cuda-7.5 ]: 
Do you want to install a symbolic link at /usr/local/cuda? ((y)es/(n)o/(q)uit): y
Install the CUDA 7.5 Samples? ((y)es/(n)o/(q)uit): y
Enter CUDA Samples Location [ default is /root ]: /opt

Check points, run the following two commands

# nvidia-smi
# nvidia-smi -a

end Check points

Environment setup

# vi /etc/profile

Add following two lines at the end of the file

export PATH=/usr/local/cuda-7.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH

It is better to reboot the system after installation

Compile and run Cuda Samples

Relogin to the terminal, /opt is the path of Cuda samples you entered before

# cd /opt/NVIDIA_CUDA-7.5_Samples/
# make    # wait server minutes
# cd bin
# cd x86_64
# cd linux
# cd release

Check points

detect the device

# ./deviceQuery 

base function

# ./bandwidthTest
# ./matrixMul

test cuBLAS

# ./matrixMulCUBLAS 

end Check points

所属分类: 信息技术   所属专题: 原创
共有 8013 人次浏览

相关文章
    评论作者:
    电子邮件:
    评论内容:
    投票评价:
    验 证 码:
    图片包含4个随机字符,点击刷新
    请输入上面图片中的随机字符