Amount of video memory

I’ve got

  • Windows 98,
  • Matrox Mystique G200 8MB AGP 2x with the latest drivers
  • ASUS P2B AGP 2x motherboard with the latest BIOS
  • 128 MB SDRAM PC133 (single DIMM)
  • DirectX 8.1

if I run this program:

#include “SDL.h”
#include <stdlib.h>

int main(int argc, char **argv)
{
const SDL_VideoInfo * vinfo;

if (SDL_Init(SDL_INIT_VIDEO)==-1)
	return -1;
	
atexit(SDL_Quit);

vinfo = SDL_GetVideoInfo();

printf("Total amount of video memory: %d kb\n", vinfo->video_mem);

return 0;

}

I receive this output:

Total amount of video memory: 61542 kb

But I’ve got 8MB of video RAM… and my “Graphics aperture size” setting in BIOS is 128MB… what’s appening?

CRV?ADER/KY

I receive this output:

Total amount of video memory: 61542 kb

But I’ve got 8MB of video RAM… and my “Graphics aperture size” setting in
BIOS is 128MB… what’s appening?

Don’t yell at me if I am totally wrong, but I believe it is reporting the
amount of memory not used to just display the screen (e.g. 1024x768 at 32 takes
up <2MB). It really isn’t a big deal. My 32MB card reports 30MB, so I don’t
think it is much of a problem. Hey, if you were using X Windows it would
report 0k. How about that?

Mike S. Codename: Freak901010_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

I receive this output:

Total amount of video memory: 61542 kb

But I’ve got 8MB of video RAM… and my “Graphics aperture size” setting in
BIOS is 128MB… what’s appening?

Don’t yell at me if I am totally wrong, but I believe it is reporting the
amount of memory not used to just display the screen (e.g. 1024x768 at 32 takes
up <2MB). It really isn’t a big deal. My 32MB card reports 30MB, so I don’t
think it is much of a problem. Hey, if you were using X Windows it would
report 0k. How about that?

Don’t know about XFree, I must see…
But I repeat, It gives me 60MB, not 6MB…
Effectively, if I switch the resolution from 800x600x32 to 1600x1200x32 it reports 57792 kb, and if you make some
calculations the total video memory is 64MB, but the mistery remains…
WHY THE H* IT REPORTS 64MB IN PLACE OF 8?

It simply reports your free possible graphics memory, which is the GFX boards
8MB and 128MB main memory (because apertured to AGP BUS) minus all used
memory. This is correct behaviour, because the GFX board can directly use the
main memory as graphics memory using direct acces to it. Of course the main
memory is tons slower than the real graphics memory, but it’s still directly
usable.On Sunday 02 June 2002 12:57, CRV?ADER/KY wrote:

I receive this output:

Total amount of video memory: 61542 kb

But I’ve got 8MB of video RAM… and my “Graphics aperture size” setting
in BIOS is 128MB… what’s appening?

Don’t yell at me if I am totally wrong, but I believe it is reporting the
amount of memory not used to just display the screen (e.g. 1024x768 at 32
takes up <2MB). It really isn’t a big deal. My 32MB card reports 30MB, so
I don’t think it is much of a problem. Hey, if you were using X Windows
it would report 0k. How about that?

Don’t know about XFree, I must see…
But I repeat, It gives me 60MB, not 6MB…
Effectively, if I switch the resolution from 800x600x32 to 1600x1200x32 it
reports 57792 kb, and if you make some calculations the total video memory
is 64MB, but the mistery remains… WHY THE H* IT REPORTS 64MB IN PLACE OF
8?

Total amount of video memory: 61542 kb

Don’t know about XFree, I must see…
XFree does the same thing as all other X systems do. They report 0k.

But I repeat, It gives me 60MB, not 6MB…
Well, then that is aa problem. I am assuming you are using windows since you
actually do get a memory output, try running dxdiag and see what it
registers the amount of memory as.

Effectively, if I switch the resolution from 800x600x32 to 1600x1200x32 it
reports 57792 kb, and if you make some
calculations the total video memory is 64MB, but the mistery remains…
WHY THE H* IT REPORTS 64MB IN PLACE OF 8?
I don’t know.

Mike S. Codename: Freak901010_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

03/06/02 15.46.39, Sami N??t?nen <sami.naatanen at kolumbus.fi> wrote:>On Sunday 02 June 2002 12:57, CRV?ADER/KY wrote:

I receive this output:

Total amount of video memory: 61542 kb

But I’ve got 8MB of video RAM… and my “Graphics aperture size” setting
in BIOS is 128MB… what’s appening?

Don’t yell at me if I am totally wrong, but I believe it is reporting the
amount of memory not used to just display the screen (e.g. 1024x768 at 32
takes up <2MB). It really isn’t a big deal. My 32MB card reports 30MB, so
I don’t think it is much of a problem. Hey, if you were using X Windows
it would report 0k. How about that?

Don’t know about XFree, I must see…
But I repeat, It gives me 60MB, not 6MB…
Effectively, if I switch the resolution from 800x600x32 to 1600x1200x32 it
reports 57792 kb, and if you make some calculations the total video memory
is 64MB, but the mistery remains… WHY THE H* IT REPORTS 64MB IN PLACE OF
8?

It simply reports your free possible graphics memory, which is the GFX boards
8MB and 128MB main memory (because apertured to AGP BUS) minus all used
memory. This is correct behaviour, because the GFX board can directly use the
main memory as graphics memory using direct acces to it. Of course the main
memory is tons slower than the real graphics memory, but it’s still directly
usable.

No… Aperture is 128Mb, but free reported memory + screen_xscreen_ybpp = 64MB. There’s a 72Mb leak.

But you forget the memory that the OS and other programs are using, because
those are not free memory areas and shouldn’t be reported as free memory. ;)On Monday 03 June 2002 17:42, CRV?ADER/KY wrote:

03/06/02 15.46.39, Sami N??t?nen <sami.naatanen at kolumbus.fi> wrote:

It simply reports your free possible graphics memory, which is the GFX
boards 8MB and 128MB main memory (because apertured to AGP BUS) minus all
used memory. This is correct behaviour, because the GFX board can
directly use the main memory as graphics memory using direct acces to it.
Of course the main memory is tons slower than the real graphics memory,
but it’s still directly usable.

No… Aperture is 128Mb, but free reported memory + screen_xscreen_ybpp =
64MB. There’s a 72Mb leak.

It simply reports your free possible graphics memory, which is the GFX
boards 8MB and 128MB main memory (because apertured to AGP BUS) minus all
used memory. This is correct behaviour, because the GFX board can
directly use the main memory as graphics memory using direct acces to it.
Of course the main memory is tons slower than the real graphics memory,
but it’s still directly usable.

No… Aperture is 128Mb, but free reported memory + screen_xscreen_ybpp =
64MB. There’s a 72Mb leak.

But you forget the memory that the OS and other programs are using, because
those are not free memory areas and shouldn’t be reported as free memory. :wink:

If it was as you say, it would be any number between 0 and 136. However, it’s almost EXACTLY 64MB. That’s almost
impossible with your theory. (I don’t have any programs running when I run the test, however. Just windows
desktop.)

Well there might simply be restriction that makes the aperture size smaller,
so that the GFX board can’t reserve all memory, or that windows simply takes
about 64 MB or some miss reporting. Try to reserve some say 32MB memory
before doing the test and look what it then does.On Tuesday 04 June 2002 20:16, CRV?ADER/KY wrote:

It simply reports your free possible graphics memory, which is the GFX
boards 8MB and 128MB main memory (because apertured to AGP BUS) minus
all used memory. This is correct behaviour, because the GFX board can
directly use the main memory as graphics memory using direct acces to
it. Of course the main memory is tons slower than the real graphics
memory, but it’s still directly usable.

No… Aperture is 128Mb, but free reported memory +
screen_xscreen_ybpp = 64MB. There’s a 72Mb leak.

But you forget the memory that the OS and other programs are using,
because those are not free memory areas and shouldn’t be reported as free
memory. :wink:

If it was as you say, it would be any number between 0 and 136. However,
it’s almost EXACTLY 64MB. That’s almost impossible with your theory. (I
don’t have any programs running when I run the test, however. Just windows
desktop.)

In any case, the amount of video memory available is a rough guide, and
never to be taken strictly. There are many factors that affect how much
video memory is actually available to you.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

In any case, the amount of video memory available is a rough guide, and
never to be taken strictly. There are many factors that affect how much
video memory is actually available to you.

So the best way is to ask the user how much video memory he has on his video card? Isn’t there anything better?

In any case, the amount of video memory available is a rough guide, and
never to be taken strictly. There are many factors that affect how much
video memory is actually available to you.

So the best way is to ask the user how much video memory he has on his
video card? Isn’t there anything better?

What I would do is where the user gets asked for the amount of vram, I would
have it first autodetect, then if that is incorrect, have the user input the
correct value. At least that would be the best for me.

Mike S. Codename: Freak901010_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

CRV?ADER/KY wrote:

In any case, the amount of video memory available is a rough guide, and
never to be taken strictly. There are many factors that affect how much
video memory is actually available to you.

So the best way is to ask the user how much video memory he has on his video card? Isn’t there anything better?

Pick a size and design for it. That way the code will run well on cards
of the designed for size, and run better on better cards. This is IMHO
the simplest way to go.

You can also use SDL_ListModes to get a list of supported screen sizes.
That information combined with the pixel format information from
SDL_GetVideoInfo will tell you something about the amount of video
memory that is actually available on the machines. The total number of
pixels times the size of the pixels in bytes for the largest screen size
that is supported is a safe estimate of the amount of video memory
available. This estimate is almost certainly lower than the real amount
of memory. But it is a “safe” estimate because it IS lower than the
actual amount of memory, and it will only include memory that can be
displayed on the screen, not AGP memory, not off screen memory, just
displayable memory.

	Bob Pendleton> 

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------------+

  • Bob Pendleton, an experienced C/C++/Java +
  • UNIX/Linux programmer, researcher, and +
  • system architect, is seeking full time, +
  • consulting, or contract employment. +
  • Resume: http://www.jump.net/~bobp +
  • Email: @Bob_Pendleton +
    ±-----------------------------------------+