標籤:

matlab中運行gpuDevice為什麼那麼慢?

以前的伺服器顯卡是k20c,運行gpuDevice基本秒出,新換的伺服器是兩塊1080,matlab是r2016b,運行gpuDevice要3分鐘左右感覺很不正常,導致調程序的效率大大降低。不知道是顯卡的問題還是matlab的問題


這個應該是MATLAB的問題。題主用profiler跑一下gpuDevice就能看出那句話最耗時了。可惜最耗時的那句代碼無法查看源代碼。另外,不知道題主是否會用MATLAB來搞深度學習,如果是的話,對於最新的compute capability 6.0以上的顯卡(gtx1080 gtx1070 gtx1060等)MATLAB 目前為止採用的cuDNN庫(matlabrootinwin64cudnn64_4.dll)支持的不好,有bug。Mathworks官網上有介紹:

Summary

Incorrect output when using newer GPUs with convolutional neural network functions such astrainNetwork, classify and activations

Description

Neural Network Toolbox uses the cuDNN Deep Learning library to train and execute convolutional neural networks on the GPU. The version of this library used by MATLAB does not work correctly for GPUs with a compute capability of 6.0 or above, including the latest Pascal architecture cards.

If you build any neural networks using trainNetwork with one of these cards, the network is invalid. When running trainNetwork with verbose output, you see that accuracy is poor and the algorithm fails to converge. classify, predict and activations methods of SeriesNetwork give incorrect answers with convolutional neural networks.

An existing valid network built using an older card also gives incorrect answers on a newer GPU.

To see if your GPU is affected, in MATLAB, enter:

gpuDevice

Examine the field ComputeCapability. If this value is 6.0 or higher, your card will not work with convolutional neural networks.

目前英偉達已經發布最新的cuDnn庫解決上述bug,估計下來的MATLAB版本也會進行相應修正。

-----------------------分割線----------------------------------

Mathworks給出了這個bug的解決辦法。有需要的童鞋移步https://www.mathworks.com/support/bugreports/1439741 去看吧。


請問樓主,我用的是2015的matlab,用了cudnnV5,也是出現這個問題,怎麼修復呢?


推薦閱讀:

求推薦matlab編程比較好的書籍?
matlab做量化投資分析,怎麼學?
還有沒有類似傅里葉變換那麼有用的正交變換?
卷積神經網路如何應用在彩色圖像上?
matlab如何讀入混合變數格式的dat文件?

TAG:MATLAB | GPU |