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
Mohammad Abouali 2014년 10월 16일
Any one willing to answer this?
Matt J
Matt J 2014년 10월 16일
편집: Matt J 2014년 10월 16일
You have only the one graphics card installed? It is being used for both display and GPGPU? If so, anything displayed on the desktop (sidebars, gadgets, etc...) that could be drawing on the resources of the card?
Mohammad Abouali
Mohammad Abouali 2014년 10월 16일
I have two graphic cards actually.
One is the Intel Iris Pro and the other is the NVIDIA.
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.
On the same machine, if I use CUDA I would be able to assign much larger variable onto the memory. But using MATLAB it appears that most of the memory is not accessible.
Sometime ago, I also tried the same thing on a linux Ubuntu machine, which had multiple GPUs. Same thing happens. at the same time I used nvidia utilities to check how much load is on the card and how much of the memory is free I end up having different numbers.
Adam
Adam 2014년 10월 16일
편집: Adam 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
Mohammad Abouali 2014년 10월 16일
So, what could be causing it on my system? Driver? and how big is your GPU memory, 4GB?
José-Luis
José-Luis 2014년 10월 16일
Can confirm. Available memory doesn't change in my two gpu's.
Mohammad Abouali
Mohammad Abouali 2014년 10월 16일
Adam, could you please run reset(d); d.AvailableMemory / 1024 / 1024 at least 20 times to see if the free memory still stays the same.
Here is what happened. I force the system to go to use the integrated card, then MATLAB was not recognizing the GPU at all.
After switching the NVIDIA card back on, MATLAB was recognizing and it was reporting more memory. The first 5 6 issue of reset command didn't reduced the memory, but after that it started to gradually go down. That's why I am saying could you issue that command for like 20 times see what happens?
If you can do it this way, issue 5 6 time the command, then wait for couple of seconds, and then issue another 5 6 times.
Adam
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
Matt J 2014년 10월 20일
Do you have a single graphics card, or multiple?
Adam
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
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
Mohammad Abouali 2014년 10월 17일
편집: Mohammad Abouali 2014년 10월 17일
Matt J, even if the NVIDIA card is used for display, when there is no change in system status, other than issuing "reset(gnuDevice)" it does not make sense that the available memory goes down, instead of going up. If you check it goes down from 800MB down to 580MB. that's about 200MB reduction in memory after multiple time reseting the device, without putting any new request to the device.
Matt J
Matt J 2014년 10월 17일
편집: Matt J 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.
Matt J
Matt J 2014년 10월 17일
편집: Matt J 2014년 10월 17일
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에 대해 자세히 알아보기

제품

태그

질문:

2014년 10월 15일

댓글:

2014년 10월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by