[轉錄]如何利用NVIDIA顯卡GPU提升MATLAB效率
matlab版轉錄過來的
顯示卡也可以這樣搞
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
從朋友那邊聽說了CUDA 也花了點力氣灌好CUDA
可以用官方提供的NVIDIA CUDA SDK Browser看範例 看看安裝是否成功
完成後 記得去找Jacket 這是專門開發matlab api的project
我把安裝的過程貼在我的BLOG 保證不是廣告
http://0rz.tw/ba4q5
跑了幾個他們提供的Matlab範例 效果真的不錯
貼一點結果上來給大家看看
這個範例是方陣相乘
BLAS Example 1: Square Matrix Multiplication
Computing the 2x2 benchmark...
On average GPU is 0.177807 times faster than the CPU.
Computing the 4x4 benchmark...
On average GPU is 0.143623 times faster than the CPU.
Computing the 8x8 benchmark...
On average GPU is 0.135356 times faster than the CPU.
Computing the 16x16 benchmark...
On average GPU is 0.182954 times faster than the CPU.
Computing the 32x32 benchmark...
On average GPU is 5.28891 times faster than the CPU.
Computing the 64x64 benchmark...
On average GPU is 1.67258 times faster than the CPU.
Computing the 128x128 benchmark...
On average GPU is 4.13088 times faster than the CPU.
Computing the 256x256 benchmark...
On average GPU is 17.4282 times faster than the CPU.
Computing the 512x512 benchmark...
On average GPU is 139.496 times faster than the CPU.
Computing the 1024x1024 benchmark...
On average GPU is 990.547 times faster than the CPU.
Plotting results...End of BLAS Example 1.
矩陣大小會影響CPU計算時間
但不會影響GPU計算時間
這就是造成1024X1024矩陣乘法 效率足足有990倍差異的原因
其他幾個範例在大矩陣的狀況也可以快到兩個order左右
如果真的能好好發揮 這 相當恐怖!
但是目前似乎有點小BUG VRAM記憶體不能順利釋放
不知道是我個人的問題還是大家都一樣
我已經上了官方討論區去問了 期待他們的回答
越多人使用CUDA 一起上jacket論壇反映使用上的問題
應該會讓這個技術更快成熟吧 期待各位加入!
※ 編輯: superlaba 來自: 140.121.145.64 (11/18 15:01)
※ 編輯: superlaba 來自: 140.121.145.64 (11/18 15:04)