Using both GPUs of Nvidia Tesla k80 in one MALTAB code simultaneously

10 views (last 30 days)
I am aiming to run a MATLAB code on both Tesla k80 GPUs and take advantage of both GPUs at the same time. Can someone tell me if it is possible in practice to do that with MATLAB? I noticed that it is possible to transfer data to only one gpuDevice using gpuArray command. However, I beileve that there should be a trick to activate and force both GPUs on Tesla k80 to work together simultaneously.
I will apprecite any comments and your experience on this!
Thank you.
  1 Comment
scottneh
scottneh on 13 May 2020
Hello, I see thsi post is less than a year old so I hope you may see my question. I am setting up a machine with the following parameters :
Dual Xeon Silver 4216
128 GB Memory
3 Tesla K80 cards
Asus WS C621E SAGE main board
HDDs are all solid state NVMe
Asus GeForce RTX2070 video card
PSU: Corsair AX1600i (main) Corsair RX850 (for a little extra power)
Latest BIOS installed
I have read is other forum posts this is impossible but It looks like you made it work. I am still working on a 3D print for an air duct to cool them with a couple 120mm fans so it will be a few weeks before I am really trying to run them. Wanted to see if you have any pointers from your experience.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 29 Sep 2019
The trick is that the limitation is per worker, so you can use parfor or parfeval to run computation on multiple gpu.
Mathworks has also started supporting dual communicating GPUs in fairly limited circumstances, deep learning if I recall correctly.

More Answers (1)

Amir Masoud Kordbacheh
Amir Masoud Kordbacheh on 1 Oct 2019
Thank you very much Walter and Jason for your useful advise and information.
I worked it out and could run my code on my two GPUs. At this time, I have got one NVIDIA GeForce GTX 1080 Ti and one NVIDIA TESLA K40. When running my code on my workers, I noticed that it runs a bit slower than the time I am only running it on one of those GPUs. I note that TESLA K40 generally performs faster as it has got more double precision.
My code includes a large 2D-array matrix (a wavefunction of the non-linear Schrodinger Equation) that propagates and is evoluted over time by a for-loop including a number of FFT in 2D. What I have used is something like this:
spmd
for ii=1:(the end time)
statement...
end
end
I have done a bit of research and noticed that it might be due to the communication slowness between two GPUs that Windows 10 causes. Do you think installing Linux can solve the issue? What else do you recommend to speed up working with 2 GPUs. I am also wondering if having 2 GPUs on one PCB can help, like using a TESLA K80? Would it increase the communication speed between the two GPUs?
Thank you for your reply!
  4 Comments
Jason Ross
Jason Ross on 1 Oct 2019
It looks like the difference between the 150 watt and 300 watt V100 is that the clock speed is turned down, and delivers 80% of the performance according to nVidia. SOURCE
The source of the performance numbers for the cards is found on Wikipedia:
As for V100 vs. Titan V, that comes down to what your chassis will accept and support (plus budget, of course!). With the V100 you do need to know that your chassis provides adequate cooling for the card, as it is entirely passive with no fan of its own. The Titan V has a built-in fan so it can provide its own cooling. But it looks like the performance is very similar.
Amir Masoud Kordbacheh
Amir Masoud Kordbacheh on 2 Oct 2019
Thanks again Jason for providing the refrences and information. It was all really useful, much appreciated!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!