GPU amount of availible shared memory is less that it is seemed to be

5 views (last 30 days)
Hi all, I am just started to use GPU. So, I tried to compute example from http://www.mathworks.com/products/parallel-computing/tutorials.html
Basically, it is:
A = magic(5000);
f = ones(1,20)/20;
AonGPU = gpuArray(A);
BonGPU = filter(f, 1, AonGPU);
This is from tutorial video. But in my machine I got error:
Error using parallel.gpu.GPUArray/filter An unexpected error occurred trying to launch a kernel. The CUDA error was: CUDA_ERROR_INVALID_VALUE.
I figured out that this is due to the lack of memory: if I use A = magic(3000) instead there is no error.
Now, I checked - size of array A= magic(5000) is 200 megabytes. The same size on gpu has array AonGPU -
I checked it with the help of gpuDevice command. My Graphics card is Nvidia Geforce 650 Ti with 1 GB
memory.
However, only about 700 mb is availible (gpuDevice). Nevertheless, 200 mb is less then 700 mb. Also my array BonGPU
should be 200 mb (sizes are equal), but still 400 mb is less then 700 mb.
Why it happens?
Second, if you use are using GPU calculations, please provide what Graphics card do you have.
Thanks,
Mikhail

Answers (1)

Erik S.
Erik S. on 8 Feb 2015
Hi,
I tried your code with A=magic(5000); It works on my Gpu. I am using a Nvidia Geforce GT 640M, with 2 GB memory. What functions do you use to check the available Gpu memory?

Community Treasure Hunt

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

Start Hunting!