2 views (last 30 days)

I have 2-GPU in my computer, I wanted to use both the GPU's to perform the function. Hence I feed, part of the array to one GPU and the remaining to the second GPU.

Agpu1=gpuArray(A(:,:,1:n/2)); %chunk #1 : send to GPU with device index 1

Agpu2=gpuArray(A(:,:,n/2+1:n)); %chunk #2 : send to GPU with device index 2

F(1)=parfeval(@Function,2,Agpu1,1);

F(2)=parfeval(@Function,2,Agpu2,2);

[o1,o2] = fetchOutputs(F,'UniformOutput',false); % Blocks until complete

When I fetch the outputs using the last statement, I get the error "Error using parallel.Future/fetchOutputs : One or more futures resulted in an error" .

1) Does this mean, fetch outputs is trying to fetch the output, when the other GPU is still performing the operation. How to solve this ?

In the above link, when I try printing the gpuDevice used, it always shows gpu2 is being used and gpu 1 is idle. How to confirm both GPU's are being used ?

Thankyou!

Opportunities for recent engineering grads.

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

Start Hunting!
## 3 Comments

## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/441747-fetching-outputs-from-different-gpu-s-results-in-an-error#comment_665082

⋮## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/441747-fetching-outputs-from-different-gpu-s-results-in-an-error#comment_665082

## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/441747-fetching-outputs-from-different-gpu-s-results-in-an-error#comment_665134

⋮## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/441747-fetching-outputs-from-different-gpu-s-results-in-an-error#comment_665134

## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/441747-fetching-outputs-from-different-gpu-s-results-in-an-error#comment_666034

⋮## Direct link to this comment

https://la.mathworks.com/matlabcentral/answers/441747-fetching-outputs-from-different-gpu-s-results-in-an-error#comment_666034

Sign in to comment.