フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Multi-GPU on MATLAB 2013

1 回表示 (過去 30 日間)
Amnah
Amnah 2014 年 5 月 26 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 ?

回答 (1 件)

Edric Ellis
Edric Ellis 2014 年 6 月 2 日
編集済み: Edric Ellis 2014 年 6 月 2 日
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

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by