Matlab 2020a-AWS cluster
显示 更早的评论
Hi , am just set up a cluster on AWS with the setting:
MATLAB Version:R2020a
Shared State:Personal
Auto-Manage Cluster Access:Yes
Worker Machine Type:Double Precision GPU (p3.8xlarge, 16 core, 4 GPU)
Workers per Machine:16
Use a dedicated headnode:Yes
Headnode Machine Type:Standard (m5.xlarge, 2 core)
Machines Requested:2
Machines Available:0
Allow cluster to auto-resize:No
Access to MATLAB Drive:Yes
Initial Worker Count:16
and got it running online, however, when I set this cluster as a defult for my matlab, when I use gpuDevice, I think I am only finding the gpu on my own computer, not the cluster. What did I do wrong or is there a mis-setting.
回答(1 个)
Raymond Norris
2020-8-26
Hi Kevin,
Start a parallel pool and then run your GPU code from within a parallel construct. For example:
% Time x = A\b on CPU and GPU
% Start parallel pool on AWS
parpool(32);
spmd
sz = 2^14;
t0 = tic;
A = rand(sz);
b = rand(sz,1);
x = A\b;
cpu_t = toc(t0)
t1 = tic;
gA = gpuArrya.rand(sz);
gb = gpuArray.rand(sz,1);
gx = gA\gb;
x2 = gather(gx);
gpu_t = toc(t1)
end
Keep in mind that the GPU might need to warm up the first time through, so you might need to run it again.
Raymond
类别
在 帮助中心 和 File Exchange 中查找有关 Parallel and Cloud 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!