GPU Memory going down
显示 更早的评论
Hi,
I have a Mac Book Pro with NVIDIA GeForce GT 750M 2048 MB installed.
I noticed that when I am trying to assign a variable using GPUARRAY, I go out of GPU memory when I shouldn't.
So, check the online docs and I was instructed to reset the device. I did but no luck. However, I got something even more confusing. It seems that by reseting my GPU device actually the memory goes down instead of going up. Here it is:
>> format longg
>> d=gpuDevice;d.AvailableMemory/1024/1024
ans =
807.6171875
>> reset(d); d.AvailableMemory/1024/1024
ans =
659.1171875
>> reset(d); d.AvailableMemory/1024/1024
ans =
555.4921875
>> reset(d); d.AvailableMemory/1024/1024
ans =
633.1171875
>> reset(d); d.AvailableMemory/1024/1024
ans =
615.1171875
>> reset(d); d.AvailableMemory/1024/1024
ans =
633.1171875
>> reset(d); d.AvailableMemory/1024/1024
ans =
581.1171875
By the way, note that for the first line after "format longg", I just restarted my entire system, and just launched the MATLAB and then issue that commands. So nothing else was even running on my system. Yet only about 800MB of the total 2000MB gpumemory was available within MATLAB.
Any Idea what is going on?
10 个评论
Mohammad Abouali
2014-10-16
Mohammad Abouali
2014-10-16
I tried a few times in Matlab R2014b (though without the format longg first) and only the first reset caused a slight drop in available memory, after that it was constant:
>> d=gpuDevice; d.AvailableMemory / 1024 / 1024
ans =
3607.890625
>> reset(d); d.AvailableMemory / 1024 / 1024
ans =
3607.76171875
>> reset(d); d.AvailableMemory / 1024 / 1024
ans =
3607.76171875
>> reset(d); d.AvailableMemory / 1024 / 1024
ans =
3607.76171875
>> reset(d); d.AvailableMemory / 1024 / 1024
ans =
3607.76171875
>> reset(d); d.AvailableMemory / 1024 / 1024
ans =
3607.76171875
format longg only applied to the current session so if you restarted after executing that I assume that is irrelevant to the GPU behaviour.
Mohammad Abouali
2014-10-16
José-Luis
2014-10-16
Can confirm. Available memory doesn't change in my two gpu's.
Mohammad Abouali
2014-10-16
Adam
2014-10-20
Sorry, I was full on busy at work on Friday.
I just ran the command 20 times in a row now and again totally constant after the first very small drop.
Matt J
2014-10-20
Do you have a single graphics card, or multiple?
Adam
2014-10-20
Just one so that could certainly be a factor I guess. Though it does also mean that card is absolutely used for everything else the system may be doing related to graphics.
回答(1 个)
Matt J
2014-10-17
0 个投票
But that aside as I said, I was not running anything on the machine. and If I just type that over and over this happens.
The display functions of your monitor are always running, though, and at least one of your graphics cards is always servicing that. In Windows, there are settings to designate one card as the display handler. Presumably, there is a way to do likewise on a Mac. If you can verify that the card you are using for GPGPU is not tied to the display, it would be informative.
3 个评论
Mohammad Abouali
2014-10-17
编辑:Mohammad Abouali
2014-10-17
Why not? "Available Memory" surely refers to the memory on the card that the display is not using, and surely only that memory is controlled by reset(). Further, the mere act of typing "reset(d)" causes the display to change its status. I would also point out that your memory numbers aren't going down all the time. They seem to fluctuate up and down randomly.
Yes, it's still a theory, but it's worth eliminating as a consideration, if nothing else.
that's about 200MB reduction in memory after multiple time reseting the device, without putting any new request to the device.
I don't say it makes sense that the memory fluctuations are that large, or that it's a mark of good software engineering. I'm just saying that when you lose memory, it must go somewhere, and maybe the display is taking it. It's as good an initial suspect as any if it's the only other known thing using the card.
类别
在 帮助中心 和 File Exchange 中查找有关 Get Started with GPU Coder 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!