In wp8, we have devicetotalmemory property. As MSDN says, it returns the physical RAM size of the device in bytes.
But when I tested it on my lumia 920 with 32Gb storage it returns 898Mb size.
My device is running wp8.1 developer preview.
Can you tell me what wrong with total memory property? Maybe I do something wrong, or there is
bug in wp8.1.
It returns device RAM size.looks like you have device with 1GB RAM.
Remark:
The value returned is less than the actual amount of device memory, but can be used to help determine memory consumption requirements.
Related
I'm on an Ubuntu 19.10 machine (with KDE desktop environment) with 8GB of RAM, an i5 8250u and an MX130 gpu (2GB VRAM), running a Jupyter Notebook with tensorflow-gpu.
I was just training some models to test their memory usage, and I can't see any sense in what I'm looking at. I used KSysGUARD and NVIDIA System Monitor (https://github.com/congard/nvidia-system-monitor) to monitor my system during training.
As I hit "train", on NVIDIA S.M. show me that memory usage is 100% (or near 100% like 95/97%) the GPU usage is fine.
Always in NVIDIA S.M., I look at the processes list and "python" occupies only around 60MB of vram space.
In KSysGUARD, python's memory usage is always around 700mb.
There might be some explanation for that, the problem is that the gpu's memory usage hits 90% with a model with literally 2 neurons (densely connected of course xD), just like a model with 200million parameters does. I'm using a batch size of 128.
I thought around that mess, and if I'm not wrong, a model with 200million parameters should occupy 200000000*4bytes*128 bytes, which should be 1024gb.
That means I'm definitely wrong on something, but I'm too selfless to keep that riddle for me, so I decided to give you the chance to solve this ;D
PS: English is not my main language.
Tensorflow by default allocates all available VRAM in the target GPU. There is an experimental feature called memory growth that let's you control that, basically stops the initialization process from allocating all VRAM and does it when there is a need for it.
https://www.tensorflow.org/api_docs/python/tf/config/experimental/set_memory_growth
I made a very simple network using mxnet(two fc layers with dim of 512).
By changing the ctx = mx.cpu() or ctx = mx.gpu(0), I run the same code on both CPU and GPU.
The memory cost of GPU is much bigger than CPU version.(I checked that using 'top' instead of 'nvidia-smi').
It seems strange, as the GPU version also has memory on GPU already, why GPU still need more space on memory?
(line 1 is CPU program / line 2 is GPU program)
It may be due to differences in how much time each process was running.
Looking at your screenshot, CPU process has 5:48.85 while GPU has 9:11.20 - so the GPU training was running almost double the time which could be the reason.
When running on GPU you are loading a bunch of different lower-level libraries in memory (CUDA, CUDnn, etc) which are allocated first in your RAM. If your network is very small like in your current case, the overhead of loading the libraries in RAM will be higher than the cost of storing the network weights in RAM.
For any more sizable network, when running on CPU the amount of memory used by the weights will be significantly larger than the libraries loaded in memory.
I want to find the limit of my app's ram so that i can design my app properly.
Earlier in windows phone 8 there was a class named DeviceStatus which could provide me with this result but in windows phone 8.1 that class has been removed. So could anyone provide me with an alternative of this class for windows phone 8.1
The new class you're looking for is Windows.System.MemoryManager; in particular, the AppMemoryUsageLimit property.
This value can vary based on the amount of RAM the device has, and whether or not the process is a background task.
For 512MB RAM devices, the limit is 185MB.
For 1GB RAM devices, the limit is 390MB.
For 2GB RAM devices, the limit is 825MB.
You can't extend the memory limit.
What is the application memory usage limit of windows phone 8 application, I need memory limit for the three different devices available (like 720p, WXVGA etc)
The zen of WP8 memory caps has three aspects: default baseline (150MB+), extended memory (180MB+) and low-memory device opt-out (300MB+).
Baseline:
By default all apps (D3D, XAML and XNA) on WP8 have at least 150MB which is up from 90MB on WP7. The increase from 90MB to 150MB is done to accommodate the extra memory needed for more detailed visuals on HD displays.
Extended Memory Caps
Apps can also ask for additional memory by specifying ID_FUNCCAP_EXTEND_MEM. When asking for additional memory you're guaranteed at least 180MB on all devices. When asking for additional memory your app may actually get all the way up to 380MB memory on high-memory devices.
Low memory device opt-out
Apps can also opt-out of low-memory devices (512MB RAM) by specifying ID_REQ_MEMORY_300. That guaranteed your app will only run on high-memory devices (more then 1GB of RAM) and with at least 300MB of memory.
The way you should think about "high memory devices" is that it's just like having an optional sensor (Gyroscope, Compass, etc) or any other optional hardware (NFC, etc). Don't assume users have this extra memory unless you want to limit the distribution of your app considerably. Public statistics show that low-memory devices sell pretty well and you shouldn't disqualify your app from those devices unless it's an absolute must.
App memory limits for Windows Phone 8 (MSDN)
I'm writing matrix addition program for GPUs using Streams and obviously pinned memory.So I allocated 3 matrices in pinned memory but after particular dimensions it shows API error 2:out of memory.My RAM is 4GB but i'm not able to use beyond 800MB.Is there any way by which we can control this upper limit?
My sys config:
nVidia GEForce 9800GTX
Intel core 2 Quad
For streamed execution code looks as follows
(int i=0;i<no_of_streams;i++)
{
cudaMemcpyAsync(device_a+i*(n/no_of_streams),hAligned_on_host_a+i*(n/no_of_streams),nbytes/no_of_streams,cudaMemcpyHostToDevice,streams[i]);
cudaMemcpyAsync(device_b+i*(n/no_of_streams),hAligned_on_host_b+i*(n/no_of_streams),nbytes/no_of_streams,cudaMemcpyHostToDevice,streams[i]);
cudaMemcpyAsync(device_c+i*(n/no_of_streams),hAligned_on_host_c+i*(n/no_of_streams),nbytes/no_of_streams,cudaMemcpyHostToDevice,streams[i]);
matrixAddition<<<blocks,threads,0,streams[i]>>>(device_a+i*(n/no_of_streams),device_b+i*(n/no_of_streams),device_c+i*(n/no_of_streams));
cudaMemcpyAsync(hAligned_on_host_a+i*(n/no_of_streams),device_a+i*(n/no_of_streams),nbytes/no_of_streams,cudaMemcpyDeviceToHost,streams[i]);
cudaMemcpyAsync(hAligned_on_host_b+i*(n/no_of_streamss),device_b+i*(n/no_of_streams),nbytes/no_of_streams,cudaMemcpyDeviceToHost,streams[i]);
cudaMemcpyAsync(hAligned_on_host_c+i*(n/no_of_streams),device_c+i*(n/no_of_streams),nbytes/no_of_streams,cudaMemcpyDeviceToHost,streams[i]));
}
So, you haven't specified if this happens after the cudaMalloc or the cudaHostAlloc function calls.
Pinned memory is a limited resource. Any memory defined as being in pinned memory must always be in RAM. As such, that leaves less room in RAM for other system applications. This means, you can't have 4GB of pinned memory if you have 4GB of RAM, or else nothing else could run.
800MB might be a system imposed limit. Considering it's a quarter of your RAM, it might be a reasonable limit. It is also quite close to the size of your global memory. A failure on the card wouldn't translate to a failure on the host, so if it's complaining without having to run something like cudaGetLastError, it's probably a problem on the host.
Sorry I don't know specifics of increasing your pinned memory limit.