0

I have a question about using the GPU in Matlab. I followed a simple code for the code running on GPU on the Matlab website But when I run the code and I check the CPU and GPU simultaneously, I see that the code runs on CPU instead of GPU!

Actually, Matlab website says gpuArray() automatically transfers the code on GPU but it seems the code is run on CPU instead of GPU.

this is the code :

r = gpuArray.linspace(0,4,N);
x = rand(1,N,'gpuArray');
numIterations = 10000000;
for n=1:numIterations
    x = r.*x.*(1-x);
end

and this is the snapshot taken from processing statistics.

enter image description here I would appreciate any help you can provide.

Captain
  • 193
  • 1
  • 10
  • 1
    Try checking the Performance tab of the task manager instead, and click on the relevant GPU. It will give you more detailed information about the GPU's current activity level. – MrAzzaman Aug 30 '19 at 07:46
  • What is the output of `gpuDevice` ? – Paolo Aug 30 '19 at 09:09
  • @UnbearableLightness I tested this command, it detects the GPU and gives me the details about GPU. Also I tested `existsOnGPU(x)` and it gave me `1` which means `x` is on the GPU. But I can not understand why there is no activity on GPU. Could it be related to installing CUDA? – Captain Aug 30 '19 at 11:26

0 Answers0