Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Multi-GPU on MATLAB 2013

1 vue (au cours des 30 derniers jours)
Amnah
Amnah le 26 Mai 2014
Clôturé : MATLAB Answer Bot le 20 Août 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 ?

Réponses (1)

Edric Ellis
Edric Ellis le 2 Juin 2014
Modifié(e) : Edric Ellis le 2 Juin 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

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by