Install fedora16, cuda First install linux http://wiki.debian.org.hk/w ...

wireanticipatedSoftware and s/w Development

Dec 14, 2013 (3 years and 10 months ago)

112 views

I
nstall fedora16, cuda

F
irst install linux

http://wiki.debian.org.hk/w/Install_Fedora_Linux

安裝
KDE
版本


G
pu dirver

http://www.nvidia.com.tw/Download/index.aspx?lang=tw


合適的驅動程式
並下載

安裝套件

更新
kernel

yum update kernel* selinux
-
policy*

reboot

安裝
NVIDIA
專有的的套件

yum install kmod
-
nvidia xorg
-
x11
-
drv
-
nvidia
-
libs

## B
ackup old initramfs nouveau image ##

mv /boot/initramfs
-
$(uname
-
r).img /boot/initramfs
-
$(uname
-
r)
-
nouveau.img

## Create new initramfs image ##

dracut /boot/initramfs
-
$(uname
-
r).img $(uname
-
r)

reboot

yum install make gcc
-
c++ freeglut
-
devel libXi
-
devel l
ibXmu
-
devel

進到
root

init 3

到下載位置執行
chmod +x


開始安裝
nvidia
官方版驅動程式

./

NVIDIA
-
Linux
-
x86_64
-
319.23.run

接著就進入了
Nvidia
的授權頁,第一個選
accept
同意他的授權聲明


tab
鍵可
移動

There appears to already be a driver installed on your system (version: 173.14.12).
As part of installing this driver (version: 173.14.12), the existing driver will be
uninstalled. Are you sure you want to continue? ('no' will abort installation)
(Answer
: Yes)

No precompiled kernel interface was found to match your kernel; would you like the
installer to attempt to download a kernel interface for your kernel from the NVIDIA
ftp site (ftp://download.nvidia.com)? (Answer: No)

Install NVIDIA's 32
-
bit compati
bility OpenGL libraries? (Answer: No)
此項只有
amd64
版本才會出現

Would you like to run the nvidia
-
xconfig utility to automatically update your X
configuration file so that the NVIDIA X driver will be used when you restart X? Any
pre
-
existing X configuration file will

be backed up(Answer: Yes)

有沒有安裝成功

glxinfo | grep "OpenGL version string:"

lspci | grep VGA

接著就用
nvidia
-
settings
來調整螢幕解析度與刷新率了

nvidia
-
settings



NVIDIA CUDA

https://developer.nvidia.com/cuda
-
downloa
ds

下載你的版本的
CUDA Installer
is
include the CUDA Toolkit, SDK code samples, and
developer drivers.

偵測到的顯示介面

lspci |grep
-
i VGA

進到
root

vi /etc/default/grub

加入紅色部分

GRUB_TIMEOUT=5

GRUB_DISTRIBUTOR="Fedora"

GRUB_DEFAULT=saved

GRUB_CMDLINE_LINUX="nomodeset

rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap
KEYTABLE=us quiet SYSFONT=latarcyrheb
-
sun16 rhgb rd.lvm.lv=VolGroup/lv_root
rd.luks=0 LANG=en_US.UTF
-
8
rdblacklist=nouveau nouveau.modeset=0
"

重新配置
grub

g
rub2
-
mkconfig

o /boot/grub2/grub.cfg

重新開機

R
eboot

進到
root

in
it 3

到下載位置執行
chmod +x

./cuda_5.0.35_linux_64_fedora16
-
1.run

重新開機

R
eboot

cp

r /usr/local/cuda
-
5.0/samples/0_Simple/matrixMul /hom/ken/matrixMul

vim /home/ken/matrixMul/Makefile

# Common includes and paths for CUDA

INCLUDES :=

-
I$(CUDA_INC_PATH)
-
I.
-
I..

I
..
/
..
/common/inc

改成絕對路徑

# Common includes and paths for CUDA

INCLUDES :=
-
I$(CUDA_INC_PATH)
-
I.
-
I..
-
I/usr/local/cuda
-
5.0/samples/common/inc

另一個部分

matrixMul: matrixMul.o


$(GCC) $(CCFLAGS)
-
o $@ $+ $(LDFLAGS) $(E
XTRA_LDFLAGS)


mkdir
-
p
../.
./bin/$(OSLOWER)/$(TARGET)


cp $@
../.
./bin/$(OSLOWER)/$(TARGET)

改成

matrixMul: matrixMul.o


$(GCC) $(CCFLAGS)
-
o $@ $+ $(LDFLAGS) $(EXTRA_LDFLAGS)


mkdir
-
p ./bin/$(OSLOWER)/$(TARGET)


cp

$@ ./bin/$(OSLOWER)/$(TARGET)

cd /home/ken

vim .bashrc

# User specific aliases and functions

export PATH=/usr/local/cuda
-
5.0/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda
-
5.0/lib64:/lib:$LD_LIBRARY_PATH

log out
之後再
log in

cd /home/ken/matrixMul

make

cd
bin/linux/release

./matrixMul


顯示結果

[Matrix Multiply Using CUDA]
-

Starting...

GPU Device 0: "Tesla C2075" with compute capability 2.0


MatrixA(320,320), MatrixB(640,320)

Computing result using CUDA Kernel...

done

Performance= 170.90 GFlop/s, Time= 0.767 m
sec, Size= 131072000 Ops,
WorkgroupSize= 1024 threads/block

Checking computed result for correctness: OK


Note: For peak performance, please refer to the matrixMulCUBLAS example.