Matrix multiplication optimization using GPU parallel computation
Afficher commentaires plus anciens
Dear all,
I have two questions.
(1) How do I monitor GPU core usage when I am running a simulation? Is there any visual tool to dynamically check GPU core usage?
(2) Mathematically the new and old approaches are same, but why is the new approach is 5-10 times faster?

%%% Code for new approach %%%
M = gpuArray(M) ;
for nt=1:STEPs
if (there is a periodic boundary condition)
M = A1 * M + A2 * f * M
else
% diffusion
M = A1 * M ;
end
end
6 commentaires
Jan
le 18 Août 2022
Just curious: What timings do you get for:
M = (A1 + A2 * f) * M;
Are A1, A2 and f gpuArrays also?
Nick
le 18 Août 2022
Nick
le 19 Août 2022
Jan
le 19 Août 2022
Okay. As far as I understand, you do not want to tell me the speed difference between
M = A1 * M + A2 * f * M;
and
M = (A1 + A2 * f) * M
and you do not want to show the complete code for the "old" implementation. Then I cannot estimate, if storing the data in "B(t_n)" is a cause of the problem.
Nick
le 20 Août 2022
Réponse acceptée
Plus de réponses (1)
Joss Knight
le 19 Août 2022
1 vote
The Windows Task Manager lets you track GPU utilization and memory graphically, and the utility nvidia-smi lets you do it in a terminal window.
Neither the CUDA driver nor the runtime provide access to which core is running what, although you might be able to hand-code something using NVML.
3 commentaires
Nick
le 19 Août 2022
Joss Knight
le 20 Août 2022
Ah, I forgot that you cannot see utilization information for GeForce cards, sorry. Those charts are for graphics and so not relevant for compute (except the memory one).
You'll have to use nvidia-smi.
Nick
le 29 Août 2022
Catégories
En savoir plus sur GPU Computing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

