GPU + Parallel processing(par for loop)

14 次查看(过去 30 天)
Jun
Jun 2012-8-6
Is it possible speed up the usual "for" loop in matlab code using "parfor" feature in "parallel processing toolkit" and a GPU system("Nvidia Tesla GPU C2050")? That is, can you create and deploy multiple matlab workers in GPU system just like in a machine with multiple CPU's?

回答(2 个)

Jason Ross
Jason Ross 2012-8-6
编辑:Walter Roberson 2012-8-6
There are a few ways of doing this, explained as follows:
Subject:
Is it possible to use MATLAB GPU functionality on a compute cluster with NVIDIA Tesla cards on each node in MATLAB Distributed Compute Server 5.0 (R2010b)?
Problem Description:
I have a cluster with NVIDIA Tesla GPUs on each node. I would like to know if it is possible use MATLAB GPU functionality with MATLAB Distribtued Compute Server and Parallel Computing Toolbox.
Solution:
The functionality to use GPU Computing with MATLAB on a cluster is supported in MATLAB 7.11 (R2010b). The only limitation is, that each MATLAB worker can at most use one GPU at a time.
There are three use cases possible:
1. Each nodes has only a single GPU and is of a single core processor. In this configuration there will be no issues.
2. Each node has a multi-core processor and a single GPU per node. In this configuration two uses are possible:
  • run only one MATLAB worker per each node at a time.
  • allow multiple workers to run on the same node at the same time and share the GPU. However, then GPU Computation will be serialized across workers.
3. Each nodes has a multi-core processor and has multiple GPUs per node. In this situation you will need to manually assign GPUs to workers on each node to ensure that each worker gets an independent GPU card. An example is shown below:
matlabpool open 8
spmd
gpuDevice( labindex );
% customer GPU code goes here
end
matlabpool close

Walter Roberson
Walter Roberson 2012-8-6
No, GPU processing has to be done differently than parfor processing.
  1 个评论
Walter Roberson
Walter Roberson 2012-8-6
Also, if you have multiple GPU, it is only possible to bind one GPU per worker. I would suspect that this implies that different workers cannot access the same GPU, but I am not confident of that being a limitation.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by