DX10 Approx. Total Memory: 1500MB

MistaPi

Regular
Im guessing this has something to do with DX10 virtual memory? Does it eat into available memory for other uses?
I have a 8800GTX BTW.
 
Umm, AFAIR, it`s the memory footprint that would be available for rendering, made out of the cards effective RAM, and the memory that can be accessed through PCI-Express.
 
Im guessing this has something to do with DX10 virtual memory?
Not really.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>

int spamVideoMemory(int texSize)
{
  const unsigned int memoryPerTexture = texSize * texSize;
  void const *textureContents = malloc(memoryPerTexture);
  unsigned int totalMemoryAllocated = 0;

  for(;;)
  {
    GLuint textureId;
    glGenTextures(1, &textureId);
    glBindTexture(GL_TEXTURE_2D, textureId);
    glTexImage2D(GL_TEXTURE_2D, 0, 1, texSize, texSize, 0, GL_ALPHA, GL_UNSIGNED_BYTE, textureContents);

    switch (glGetError())
    {
      case GL_NO_ERROR:
      {
        totalMemoryAllocated += memoryPerTexture;
        const int megs = totalMemoryAllocated / (1024 * 1024);
        printf("\rWoot, I've just allocated %d megabytes of texture data!", megs);
        break;
      }

      case GL_OUT_OF_MEMORY:
        printf("\nAppearently, that's the limit.\n");
        return 0;

      default:
        printf("\nWTF?\n");
        return 1;
    }
  }
}

int main( int argc, char *argv[] )
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
  glutCreateWindow("Won't be visible anyway.");

  int texSize = 1024;
  if (argc >= 2)
    texSize = atoi(argv[1]);
  return spamVideoMemory(texSize);
}

On my system, this program reports almost x10 memory then my sh!tty card has.
 
Most graphics card drivers don't actually allocate video memory until the textures are used. Textures will be uploaded into video memory once they are "touched", i.e. used in rendering. Hence the importance of warming the texture (and other) cache before rendering a scene.
Thus the driver is usually happy to allow oversubcription of texture memory since only textures used in a particular frame need to be resident in video memory. If all the textures you've created are actually used in the same frame then some of them will end up in nonlocal video memory and/or worse, paging in/out constantly from virtual memory.
 
Actually, the worst case is if the card uses video memory as a simple FIFO cache for textures, wherein if you use more textures than can fit in video memory, every texture that frame will be loaded.
 
I don't have the code to hand, but the DXGI interfaces can give you good insight into where the RAM is available/allocated.

For example, my 8800GTS has 601mb VRAM and 255mb shared SYSRAM ...

Direct3D9 on XP always reported nearer 600mb for my 512mb Gf6800.

The graphics virtualization stuff is most likely responsible for this - but I've noticed that Vista will grab as much free memory as possible and stick it in various cache's and pools. I've got 1gb physical RAM yet TaskMgr rarely reports more than 50mb free with only 1-2 programs running... Yet I've never had it give me "out of memory" so it seems to release/reallocate the cache areas when something genuinely needs it.

hth
Jack
 
Yeah dxdiag gives me weird numbers (like 1500, etc) for my 8800GTX on Vista.

I've got 1gb physical RAM yet TaskMgr rarely reports more than 50mb free with only 1-2 programs running... Yet I've never had it give me "out of memory" so it seems to release/reallocate the cache areas when something genuinely needs it
I have 2GB and it's pretty similar - I've actually been quite impressed with Vista's memory management so far compared to XP.
 
I don't have the code to hand, but the DXGI interfaces can give you good insight into where the RAM is available/allocated.

For example, my 8800GTS has 601mb VRAM and 255mb shared SYSRAM ...

Direct3D9 on XP always reported nearer 600mb for my 512mb Gf6800.

The graphics virtualization stuff is most likely responsible for this - but I've noticed that Vista will grab as much free memory as possible and stick it in various cache's and pools. I've got 1gb physical RAM yet TaskMgr rarely reports more than 50mb free with only 1-2 programs running... Yet I've never had it give me "out of memory" so it seems to release/reallocate the cache areas when something genuinely needs it.

hth
Jack
AFAIK vista trying to use all your memory is just a result of the memory manager, not so much virtualization.
Btw, my 8800GTS is listed as having 860~ total memory in vista.

Atm with Opera open with 5 tabs, a dvd loaded up (and paused), dxdiag and thunderbird I have 3MB~ free.
500MB~ of it is cached.
You are correct that is "lets go" of the cached stuff as soon as you need the memory, like launching a game.
You will see that when you launch a program that uses a bunch of ram (say a recent game) and close it you'll see you'll have quite a bit of ram free and not alot cached, atleast for a bit before it starts caching things.
 
Back
Top