Out of memory on device. To view more detail about available memory on the GPU, use 'gpuDevice()'

6 ビュー (過去 30 日間)
Alberto Paniate
Alberto Paniate 2021 年 7 月 24 日
編集済み: Matt J 2021 年 7 月 24 日
Hi, I am using a new pc and I have found this problem for the first time. The error is the following:
Error using gpuArray/subsref
Out of memory on device. To view more detail about available memory on the GPU, use 'gpuDevice()'. If the problem persists, reset the GPU by calling 'gpuDevice(1)'.
Error in matlab.internal.builtinhelper.circshift (line 87)
b = a(idx{:});
Error in ifftshift (line 27)
x = circshift(x,ceil(size(x)/2));
Error in propagate2 (line 130)
Eout_pad=ifft2(ifftshift(E0fft.*H.*mask));
Error in Prova24luglioOutofMemory (line 17)
D=propagate2(A, lambda, dz1, ps);
where A is a matrix, lambda, dz1 and ps numbers in order to propagate the matrix in free space.
If I execute gpuDevice()
CUDADevice with properties:
Name: 'GeForce MX330'
Index: 1
ComputeCapability: '6.1'
SupportsDouble: 1
DriverVersion: 11
ToolkitVersion: 10.1000
MaxThreadsPerBlock: 1024
MaxShmemPerBlock: 49152
MaxThreadBlockSize: [1024 1024 64]
MaxGridSize: [2.1475e+09 65535 65535]
SIMDWidth: 32
TotalMemory: 2.1475e+09
AvailableMemory: 1.6409e+09
MultiprocessorCount: 3
ClockRateKHz: 1594000
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 1
How can I overcome this problem?
I have found that if I have a size of the matrix A less than 4000 I have no problem but when I overcome that limit, I found this error message
  3 件のコメント
Matt J
Matt J 2021 年 7 月 24 日
編集済み: Matt J 2021 年 7 月 24 日
Yes. The output of gpuDevice says that your GPU card (the GeForce MX330) has only about 2 GB RAM total. I don't know what other variables your propagate2() function is creating on the GPU but it is clearly exceeding the space you have there.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by