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