登 录
註 冊
论坛
微波仿真网
注册
登录论坛可查看更多信息
微波仿真论坛
>
程序
>
利用nvidia CUDA加速MATLAB运算
发帖
回复
3482
阅读
2
回复
[
资料共享
]
利用nvidia CUDA加速MATLAB运算
离线
xasun
UID :26401
注册:
2009-03-01
登录:
2009-11-12
发帖:
2
等级:
旁观者
0楼
发表于: 2009-07-10 15:13:11
星期六早上去参加了旅英侨界运动会,认识了不少好朋友,也第一次听说了NVidia的CUDA,可以用GPU运算!NV牌八系列以上的芯片组就可以用!我的F8SV完全OK阿!据说利用GPU可以大幅缩短MATLAB矩阵运算的时间,我听了感觉很嗨!当然就投入研究看看啰!
XEN-V-Z%*
'ITZz n*
.')^4\
但是想的比做的美,如果乖乖按照NV官网上的教学,我想我到现在还是无法使用吧?最后还是跟先进求救才搞定。就把这步骤记录下来当作我BLOG的第一篇吧!
I.`DBI#-f
ezri9\Ju
先介绍我的laptop
rje;Bf
ASUS F8Sv
lA`-"
OS: VISTA 32bit
uA cvUN-@
MATLAB R2008a
S"`{ JCW$
~RZN+N
接着看看你的显示适配器是不是支持CUDA,底下是支援列表。
I*/:rb
%ofq
Nz%pl!
如果你有,恭喜!
p4kK" \ln
&v Q5+
安装CUDA以前,先安装第三方显卡驱动。对,你没看错NV自家驱动会让你安装不了CUDA driver,够鸟吧!
@moaa} 1
专家帮我找到属于我的规格的最新趋动,连结如下
a.ijc>K
G;USVF-'K
如果你跟我不一样显卡,自己从
4w]<1V
.k#O[^~]
"#iO{uMWb
去找吧!
6j|~oMYP
INF档是当EXE自解压缩完成之后要丢进去替换掉的,这样才能顺利安装。安装前记得先移除原来的显示适配器驱动程序。
u=E &jL5U
K7/&~;ZwT
}r"E\~E
去当漏区把该抓的三样东西都抓一抓,驱动要第一个灌,上面的INF档一样要塞进来,不然不能顺利安装喔!
%CgmZTz~<
接着安装另外两个档案toolkit&SDK
m}2hIhD9
马上就可以看看NV官方提供的GPU强大威力演示啰!
7nM<P4\
Bgai|l
但是这还不够,我要的是MATLAB的API阿!翻来找去,让我找到了Jacket这个project,提供MATLAB用的
ISTAJ8" D
函示库喔!不需要自己的撰写C语言再用MEX function,真是爽阿。下载后,直接把Jacket提供的函式库加进PATH就搞定了!
_^!C4?2!
c;=St1eoz
底下是BLAS范例执行的结果,我就不多做解释了,自己看看有多威吧!
VW^q|B yB
!#E-p?O.
BLAS Example 1: Square Matrix Multiplication
PTTUI
Computing the 2x2 benchmark...
QD1&"T<.d.
On average GPU is 0.177807 times faster than the CPU.
^}:0\;|N
Computing the 4x4 benchmark...
c)q=il7ef
On average GPU is 0.143623 times faster than the CPU.
f/Z-dM\e
Computing the 8x8 benchmark...
tA9Ew{3s
On average GPU is 0.135356 times faster than the CPU.
i?)bF!J
Computing the 16x16 benchmark...
vY[u;VU
On average GPU is 0.182954 times faster than the CPU.
qR , 5
Computing the 32x32 benchmark...
aD~S~L!
On average GPU is 5.28891 times faster than the CPU.
MR,A{X
Computing the 64x64 benchmark...
(X (:h\^
On average GPU is 1.67258 times faster than the CPU.
R/6 v#9m7
Computing the 128x128 benchmark...
PAVlZ}kj
On average GPU is 4.13088 times faster than the CPU.
Ad-_=a%
Computing the 256x256 benchmark...
Eok8+7g0&
On average GPU is 17.4282 times faster than the CPU.
KCqz]
Computing the 512x512 benchmark...
e"Z,!Q^-L
On average GPU is 139.496 times faster than the CPU.
w2U]RI\?2
Computing the 1024x1024 benchmark...
'|M} 3sL
On average GPU is 990.547 times faster than the CPU.
DYew6B-
Plotting results...End of BLAS Example 1.
O_5;?$[m
PC%_^BDW
BLAS Example 2: Matrix-Vector Multiplication (Transformation)
'SIc2H
Computing the 3x1024 benchmark...
j}8^gz]
On average GPU is 1.60066 times faster than the CPU.
/N@NT/.M<
Computing the 3x2048 benchmark...
[u-=<hnoa
On average GPU is 4.33732 times faster than the CPU.
E#kH>q@K`$
Computing the 3x4096 benchmark...
.&K?@T4l
On average GP ..
P+3 ]g{2w
dtXtZ!g2
未注册仅能浏览
部分内容
,查看
全部内容及附件
请先
登录
或
注册
共
条评分
离线
liudada
走自己的路,让别人说去吧!
UID :57462
注册:
2010-04-17
登录:
2011-09-21
发帖:
18
等级:
仿真新人
1楼
发表于: 2010-05-01 07:28:02
长见识了!
共
条评分
--From Blue BarCodes
离线
djtyc
川流不息
UID :72488
注册:
2011-02-18
登录:
2011-09-03
发帖:
90
等级:
仿真二级
2楼
发表于: 2011-08-02 09:18:01
的确是长见识了
共
条评分
发帖
回复