Hi everyone. I’m having trouble with my project in Unity 4, the problem is that the game, when being run, is only using 11.5MB to 20.1MB of Video Ram (VRAM) out of 2.00 GB? I’m only getting about 3.0 FPS because of it. I know because I am using the stats window in game. Any help would be appreciated. Thanks!
You don’t understand how the GPU works.
And I said that only so harshly to make sure you understand that, I’ll try to explain (I don’t fully understand the GPU either, but know this at least;)
To try and keep things simple (while trying to avoid saying things that are not true. Feel free to correct me where i’m wrong. I have no knowledge on how much data meshes take i.e. or where they are stored on the GPU.)
Video RAM is used, like normal ram, to cache things so the processing unit (PU of GPU) can make use of it (without having to transfer it from another memory layer first). your FPS are not related to VRAM in any way, untill you would be running out of it.
VRAM generally stores data arrays, meshes and textures. Using that data your GPU still needs to perform (up to a ton ) of calculations -with- that data.
I’ll deduce this a little further with an example;
Your scene hash a cube-shaped mesh, consisting of 12 tri’s (as normal) and which is textured with a Diffuse Map and a Normal Map. Both images use Mip-Maps. and a flat plane as “floor” without any textures
The diffuse map has a base resolution of 1024x1024 at 24-bit depth and the Normal Map is 512x512 at 16-bit-depth. Both texures are save uncompressed.
A 1024x1024 uncrompressed RGBA images would cost about 5.6MB VRAM, a 512x512 texture respectively about 1.4 MB VRAM.
Your scene also employs baked shadowmaps, which are two 1024x1024 uncompressed maps (thus roughly 5.6MB VRAM each)
This would deliver a total VRAM load of roughly 18MB only! but the calculations are still not taken into account.
A shader can make many, many MANY calculations without spending any or much more memory space, but every calculation costs time.
This increment of time is in the end your bottleneck (at least in this case, i suspect).
In the case where a limited assignment of VRAM is your bottleneck, it’s mainly caused by the the GPU will likely:
- Continuously “dump” textures and (re-)load others in order to have enough space for it’s calculation(s), costing extra processing time due to loading while still processing a frame (i.e. i am not sure if this is the exact behaviour)0
- Also has to spend time “waiting” for a texture to arrive from another memory layer (RAM typically and a HDD certainly are much slower sources!)
So a low amount of FPS doesn’t have to mean that your GPU is simply not assigning enough VRAM. Especially when you’re talking in amounts below 64MB that really seems unfeasible to me (simply because very, very few (desktop!) graphics solutions will only allow such a small amount to be allocated)
This page describes it a little more clearly then I can;
And also PCGuide generally describes quite short and clearly the function or operation of specific computer parts, even though sometimes partially outdated;
GPU - PC Guide AND GPU - PC Guide
I used to have a link to a pdf which explained in short the process of a simple mesh with two textures being executed almost exactly like i used in the example, but sadly that link is dead
Nevertheless, I hope this can at least help you getting a head start at understanding the source of the problem