3

Let say I have a GPU with memory of 1GB, but my application requires 2GB of video card memory, what will happen when I run the program? Does the application take the memory from RAM? How does it handle the insufficient video memory?

For some reason, I am still able to run the application, and noticed that the process system.exe takes quite a lot of memory (~800 MB), not sure whether this is related to the insufficient video memory or there is other issue.

1
  • 1
    I answer the three questions I could. Your last question is unanswerable without more information.
    – Ramhound
    Sep 30, 2015 at 15:00

2 Answers 2

7

Modern GPUs will run a hybrid mode where the drivers/GPU start streaming texture data from system RAM over the PCIe bus to make up for the "missing" RAM. Since system RAM is 3-5X slower than GDDR5 with much higher latency, running out of "VRAM" would translate into a slower application and significant FPS loss.

However, the performance will be limited by the PCIe bandwitdh (6 GB/s).

When programming with the CUDA toolkit (v2.2+), this is known as zero-copy.

Here is the code for it, for anyone who is curious how it works.

float *a_h, *a_map;
cudaGetDeviceProperties(&prop, 0); 
if (!prop.canMapHostMemory) 
    exit(0); 
cudaSetDeviceFlags(cudaDeviceMapHost);
cudaHostAlloc(&a_h, nBytes, cudaHostAllocMapped);
cudaHostGetDevicePointer(&a_map, a_h, 0);
kernel<<<gridSize, blockSize>>>(a_map);

Read more at: http://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html#ixzz3nEbijjQZ

1

What will happen when I run the program?

It will use 100% of the VRAM available to your system. It either will work without problems because it was implemented to use your system memory also or because you don't have enough VRAM it could behave in unexpected ways.

Does the application take the memory from RAM?

If the application requires 2GB of VRAM then having more system memory won't really help unless the application was designed to do so.

How does it handle the insufficient video memory?

This is entirely up to the implementation the author of the application chooses to implement.

1
  • Many modern GPU's run in hybrid mode, and are allowed to access the host memory if the GPU runs out of VRAM.
    – DrZoo
    Sep 30, 2015 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .