Have fun with sci.dog

MATLAB使用GPU编译mex加速程序运行

第一步:确认你的显卡是NVIDIA的

第二步:到NVIDIA官网更新显卡驱动到最新版本,链接:
https://www.nvidia.cn/Download/index.aspx?lang=cn

第三步:下载安装NVIDA CUDA KoolKit
https://developer.nvidia.com/zh-cn/cuda-toolkit

第四步:确认CUDA版本
https://blog.csdn.net/m0_37697921/article/details/109989772

在这里插入图片描述

第五步:
根据第四步中表格中matlab的版本对应的cuda版本,如2020b对应cuda toolkit 10.2,到NVIDIA官网下载cuda toolkit 10.2的安装包,并安装。链接如下:
https://developer.nvidia.com/cuda-toolkit-archive

第六步:
确认环境变量设置正确
https://ww2.mathworks.cn/help/gpucoder/gs/setting-up-the-toolchain.html

第七步:检查编译环境是否配置ok
采用命令:coder.checkGpuInstall

第八步:测试下
新建一个函数,打开gpucoder,编译看看。

END.

赞(0)
未经允许不得转载:SciDog » MATLAB使用GPU编译mex加速程序运行

评论 抢沙发