【转】CUDA5/CentOS6.4
转载自http://wenzhang.baidu.com/article/view?key=076f36658dd0828c-1393896446
This article explains how to install CentOS 6.4 and CUDA5 on a PC, which is equipped with Tesla K20.
The specification of hardware is shown below
- CPU: Core i7 3770(3.4GHz,4core/8thread)
- Memory: 32GB(DDR3-12800 8GBx4)
- HDD: 1TB(SATA,7200rpm)
- GPU: ETSK20-5GER(nvidia Tesla K20c)
Since ETSK20-5GER does not have terminals of display outputs, such as D-SUB, DVI, HDMI, and so on, use the terminals of the mother board are used. To use the terminals, at the configuration of UEFI, the Primary Display is On Board.
The settings of installing CentOS 6.4 are shown below.
- Language & Keyboard: Japanese
- Package: Standard Desktop Install
- HDD Partition: Using whole disk, the standard configuration
- Network: DHCP
To install CentOS, there is no customization (modification) on packages.
Please follow the instruction that the installer of CnetOS provides.
Both Firewall and SELinux are configured as Disable.
This part describes how to prepare for installing CUDA after the installation of CentOS is completed.
The Kernel version of CentOS, which has been just installed, is shown below.
$ uname -a
Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
To update Kernel of CentOS, please apply to yum command.
# yum update
After updating Kernel is completed, please reboot the OS and make sure that the updated Kernel works.
# reboot
After rebooting the CnetOS, please check the newer version of Kernel is installed. The newer version of Kernel is shown below.
$ uname -a
Linux localhost.localdomain 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Create a new user. Then, add the new user to sudo account.
# useradd beat
# passwd beat
# /usr/sbin/visudo ...<Omitted>
## user MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
beat ALL=(ALL) ALL
The addition of packages and modification of configuration are not directly related to install CUDA.
However, to make installing process easier, install ntpd and openssh.Install ntpd.
# yum install ntp
Add ntp server.
# vi /etc/ntp/step-tickers # List of servers used for initial synchronization.
ntp.nict.jp
ntp.jst.mfeed.ad.jp
ntp.ring.gr.jp
Boot ntpd.
# /etc/init.d/ntpd start
ntpd is added to the service.
# chkconfig --level 3 ntpd on
# chkconfig --level 5 ntpd on
Install openssh.
If openssh is already installed, please skip this part of the instruction.
# yum install openssh
PermitRootLogin and PermitEmptyPasswords, which are located at the inside of the directory /etc/ssh/sshd_config, are set as No.
# vi /etc/ssh/sshd_config ... <Omitted>
# Authentication: #LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
... <Omitted>
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
PermitEmptyPasswords no
PasswordAuthentication yes
...
Boot sshd.
# /etc/init.d/sshd start
Add service to sshd.
# chkconfig --level 5 sshd on
# chkconfig --level 3 sshd on
This section describes how to install the driver for Tesla K20c.
To install the deriver for Tesla K20c, the Developer Tools and packages of CentOS are installed. Then, these packages are configured if they are necessary.
# yum groupinstall 'Development tools'
An error will occur if X is booted during the diver for Tesla K20c and CUDA5, so runlevel is changed to runlevel 3. Then, it is rebooted.
# vi /etc/inittab ...<Omitted>
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault: # reboot
After rebooting, NVIDIA-Linux-x86_64-319.23.run is downloaded from the URL shown below.
http://www.nvidia.co.jp/object/linux-display-amd64-319.23-driver-jp.htmlExecute
NVIDIA-Linux-x86_64-319.23.run, and if you agree to the license
agreement, then the instillation process of the driver for Tesla K20c is
completed. After the installation is finished, the version file is
created at the directory of /proc/driver/nvidea/.
# chmod +x NVIDIA-Linux-x86_64-319.23.run
# ./NVIDIA-Linux-x86_64-319.23.run # cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 304.54 Sat Sep 29 00:05:49 PDT 2012
GCC version: gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
Caution:
The driver is needed to be re-built after the kernel update and reboot process are done.
The re-build process is required since the updated kernel cannot read
the nvidea driver. Without updating the driver, the CUDA5 Samples are
not be executed.
For the reference, the version of the new driver and the directory for the new nvidia driver are listed below.
# uname -a
Linux tesla.beatcraft.com 2.6.32-358.18.1.el6.x86_64 #1 SMP Wed Aug 28 17:19:38 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux # cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 319.23 Thu May 16 19:36:02 PDT 2013
GCC version: gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
To read the driver, create a file at /etc/init.d/nvidea, and let runlevel3 and 5 be executed as the system is booted. For more details of the startup script, please visit the URL shown below.
http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#install-cuda-software
# vi /etc/init.d/nvidia #!/bin/bash /sbin/modprobe nvidia if [ "$?" -eq 0 ]; then
# Count the number of NVIDIA controllers found.
NVDEVS=`lspci | grep -i NVIDIA`
N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l`
NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l` N=`expr $N3D + $NVGA - 1`
for i in `seq 0 $N`; do
mknod -m 666 /dev/nvidia$i c 195 $i
done mknod -m 666 /dev/nvidiactl c 195 255 else
exit 1
fi # cd /etc/rc5.d/
# ln -s S99nvidia ../init.d/nvidia
# cd /etc/rc3.d/
# ln -s S99nvidia ../init.d/nvidia
This section shows how to install CUDA5 and executes a sample CUDA program.
Download CUDA for CentOS6 64bit version (cuda_5.0.35_linux_64_rhel6.x-1.run) from URL below.
Add a PATH for CUDA5 in .bashrc. This is a precautionary measure. If the
sample programs can not find the PATH, the samples cannot be installed
correctly.
$ cd /home/beat
$ vi .bashrc # .bashrc # Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi # User specific aliases and functions
export PATH=/usr/local/cuda-5.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:/usr/local/cuda-5.0/lib:$LD_LIBRARY_PATH # source .bashrc
To build the samples, these packages listed below are required.
# yum install freeglut-devel.x86_64 libXi-devel.x86_64 mpich2-devel.x86_64 libXmu-devel.x86_64
Execute cuda_5.0.35_linux_64_rhel6.x-1.run. Specify the directory that the sample program is installed at the default directory, which is /usr/local/cuda-05.
# chmod +x cuda_5.0.35_linux_64_rhel6.x-1.run
# ./cuda_5.0.35_linux_64_rhel6.x-1.run
Sample programs are installed at the directories of /usr/local/cuda-5.0/samples and /root/NVUDA-5.0_Samples.
To let a root user build the samples, add ld.so.conf.d/cuda.conf, then, execute ldconfig.
# cat /etc/ld.so.conf.d/cuda.conf /usr/local/cuda-5.0/lib
/usr/local/cuda-5.0/lib64
# ldconfig
Let a user build and execute NVIDIA_CUDA-5.0_Samples.
Copy the file NVIDIA_CUDA-5.0_Samples from /root/NVIDIA_CUDA-5.0_Samples.
Change the owner of the file NVIDIA_CUDA-5.0_Samples to a user. Then, execute make.
# cp -afr /root/NVIDIA_CUDA-5.0_Samples /home/beat/.
# cd /home/beat
# chown -R beat.beat NVIDIA_CUDA-5.0_Samples
$ cd ~/NVIDIA_CUDA-5.0_Samples
$ make
After the build process is completed, Change the directory to /NVIDIA_CUDA-5.0_Samples/bin/linux/release/. Then, execute sample programs, which are listed on Running the Binaries of the NVIDIA CUDA Getting Started Guide for Linux. The URL of this page is show below. The names of sample programs, which are going to be executed are deviceQuery and bandwidthTest.
http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#running-binaries
To look at the outputs shown below, both deviceQuery and bandwidthTest recognize Tesla K20c.
$ cd ~/NVIDIA_CUDA-5.0_Samples/bin/linux/release/
$ ./deviceQuery
./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) Detected 1 CUDA Capable device(s) Device 0: "Tesla K20c"
CUDA Driver Version / Runtime Version 5.0 / 5.0
CUDA Capability Major/Minor version number: 3.5
Total amount of global memory: 4800 MBytes (5032706048 bytes)
(13) Multiprocessors x (192) CUDA Cores/MP: 2496 CUDA Cores
GPU Clock rate: 706 MHz (0.71 GHz)
Memory Clock rate: 2600 Mhz
Memory Bus Width: 320-bit
L2 Cache Size: 1310720 bytes
Max Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536,65536), 3D=(4096,4096,4096)
Max Layered Texture Size (dim) x layers 1D=(16384) x 2048, 2D=(16384,16384) x 2048
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Maximum sizes of each dimension of a block: 1024 x 1024 x 64
Maximum sizes of each dimension of a grid: 2147483647 x 65535 x 65535
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 2 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Enabled
Device supports Unified Addressing (UVA): Yes
Device PCI Bus ID / PCI location ID: 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 5.0, CUDA Runtime Version = 5.0, NumDevs = 1, Device0 = Tesla K20c
$ ./bandwidthTest
[CUDA Bandwidth Test] - Starting...
Running on... Device 0: Tesla K20c
Quick Mode Host to Device Bandwidth, 1 Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(MB/s)
33554432 6431.7 Device to Host Bandwidth, 1 Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(MB/s)
33554432 6396.1 Device to Device Bandwidth, 1 Device(s)
PINNED Memory Transfers
Transfer Size (Bytes) Bandwidth(MB/s)
33554432 143752.5
After the install and configuration of CUDA, the remaining Hard Disk space is shown below.
# df -h
Filesystem Size Used Avail Use% マウント位置
/dev/mapper/vg_beattesla-lv_root
50G 4.3G 45G 9% /
tmpfs 16G 0 16G 0% /dev/shm
/dev/sda1 485M 66M 394M 15% /boot
/dev/mapper/vg_beattesla-lv_home
852G 1.4G 808G 1% /home
【转】CUDA5/CentOS6.4的更多相关文章
- Linux虚拟机的安装(使用Centos6.3)
1.什么是虚拟机? 虚拟机指通过软件模拟的具有完整硬件系统功能的.运行在一个完全隔离环境中的完整计算机系统 2.安装Linux虚拟机前要做的准备 2.1:一台windows环境的pc 2.2:下载VM ...
- centos6和centos7防火墙的关闭
CentOS6.5查看防火墙的状态: [zh@localhost ~]$service iptable status 显示结果: [zh@localhost ~]$service iptable st ...
- centos6.3与jexus5.4.4配置支持php(wordpress)
centos6.3与jexus5.4.4配置支持php,并搭建自己的wordpress博客,供那些在Linux平台下想让 php和asp.net一起跑的初学者参考. 1.搭建webserver 首先准 ...
- 分布式存储 CentOS6.5虚拟机环境搭建FastDFS-5.0.5集群
前言: 由于公司项目需要,最近开始学习一下分布式存储相关知识,确定使用FastDFS这个开源工具.利用周末的时间在虚拟机上搭建了分布式存储系统,在搭建过程中,发现网上的资料说的并不是很全, ...
- Linux3 在VMware中搭建CentOS6.5虚拟机
前言: 本文主要是我在大家hadoop集群之前 ,需啊先安装CentOS虚拟机,记录在此,作为参考.如果能帮助到其他人,自然是更好啦. =========================== ...
- 虚拟机安装CentOS6.4
1 概述 虚拟机(Virtual Machine)指通过软件模拟的具有完整硬件系统功能的.运行在一个完全隔离环境中的完整计算机系统,运行在主机上,完全独立,虚拟机里面的所有操作不会影响主机,即使虚拟 ...
- centos6环境下搭建irc服务器
问题描述 有时候逛技术社区,经常会发现有个叫IRC的东西存在,想搭建下看看到底是个什么东西 说明: 操作系统环境为CentOS6.5_64 安装irc服务器 通过yum进行安装,命令如下: yum i ...
- CentOS6.x生产环境下一键安装mono+jexus的脚本,自启动,带服务,版本号自控
转自: http://linuxdot.net/bbsfile-3784 1.支持哪些个平台?答:暂时仅支持CentOS6.x平台,7.x未测试,欢迎测试并到群里反馈给我(昵称:无聊人士) 2.一键安 ...
- 烂泥:centos6 yum方式升级内核
本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb 最近没有时间好久没有写文章了,今天由于需要安装docker学习虚拟容器的知识,需要升级O ...
随机推荐
- C# 解析带前缀的Xml节点内容
一般的xml文件相信大家都会解析了,但是遇到有命名空间的带前缀的xml,对于新手可能会有点问题.我这里在论坛解答的时候就遇到过一题,见怎么获取XML节点里面的内容,在线求教.这里给大家演示一下. 他的 ...
- 使用WebClient上传文件并同时Post表单数据字段到服务端
之前遇到一个问题,就是使用WebClient上传文件的同时,还要Post表单数据字段,一开始以为WebClient可以直接做到,结果发现如果先 Post表单字段,就只能获取到字段及其值,如果先上传文件 ...
- 读书笔记-JavaScript中的全局对象
对于任何JavaScript程序,当程序开始运行时,JavaScript解释器都会初始化一个全局对象以供程序使用.这个JavaScript自身提供的全局对象的功能包括: 1.全局对象拥有一些常用的属性 ...
- php中的preg系列函数
mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int ...
- DELPHI关于文件的操作
caption:= ExtractFileExt(‘带路径,带扩展名的文件名’);//返回的就是扩展名 caption:= ChangeFileExt(ExtractFileName(‘带路径,带扩 ...
- about building flying sauser
download flying sauser: unzip flyingsaucer-master.zip cd flyingsaucer-master/ mvn install
- 【JPA】query新对象 需要 构造函数
构造函数 @Query("select g from Note g where id=?1" ) Note findById(Long id); @Query("sele ...
- 角色控制器 Character Controller
Unity中,1个单位尺寸代表1米.即在Unity中创建一个Cube的尺寸是1x1x1米大小. Unity推荐把人的身高定为大约2个Unity单位高度(2米). 为了截取角色的全身照,需要把角色Ins ...
- javascript高级编程笔记02(基本概念)
ParseInt()函数: 由于Number函数在转换字符串时比较复杂而且不合理,我们常常转换字符串都用parseInt函数, Parseint函数规则: 忽略字符串前面的空格,直到找到第一个非空格字 ...
- mysql procedure返回多数据集
返回多数据集写法:第一种 DROP PROCEDURE IF EXISTS `p_query_user` ; DELIMITER // CREATE PROCEDURE p_query_user( p ...