Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Multi-GPU on MATLAB 2013

1 visualización (últimos 30 días)
Amnah
Amnah el 26 de Mayo de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Salam, I am trying to do a MultiGPU implementation in MATLAB2013. But when I copy my array (say A) which i need to divide on multiple gpus, the copy is only made to one gpu, not all. Then I tried to set 4 gpus to 4 matlab workers separately, but the gpuDevice(i) is called inside the parfor loop, and every time the iteration starts, the gpu initializes, and it takes more time than single gpu to implement my code. Kindly help
Also i Attached a different m-file setGPU
function setGPU()
n = (matlabpool('size'));
parfor idx=1:n
t = getCurrentTask()
t.ID
if(t.ID<3)
gpuDevice(1)
end
if(t.ID>2 && t.ID<5)
gpuDevice(2)
end
if(t.ID>4 && t.ID<7)
gpuDevice(3)
end
if(t.ID>6 && t.ID<=8)
gpuDevice(4)
end
end
and called it in my matlabpool function like this:
matlabpool ('open' ,2,'AttachedFiles',setGPU)
but still i can't set 4 separate gpus to 4 separate workers.. any solution ?

Respuestas (1)

Edric Ellis
Edric Ellis el 2 de Jun. de 2014
Editada: Edric Ellis el 2 de Jun. de 2014
Why not use SPMD to do this once after you've opened the pool?
matlabpool(...);
spmd
n = numlabs;
if labindex < 3
gpuDevice(1);
end
if labindex > 2 && labindex < 5
gpuDevice(2);
end
...
end

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by