Archived

This topic is now archived and is closed to further replies.

666_1337

video memory

Recommended Posts

maybe u could try some assembly but i dont think that will help coz the video memory is arranged in a ugly manner. if u ever looked at some code using VESA u''ll know what i mean and i dont know how to do so on newer cards.

but u could look for detailed reference on video chipset registers and ports.

Share this post


Link to post
Share on other sites
Well, that''s for DirectX. Since he posted in the OpenGL forum, we can assume that he wants VRAM usage for framebuffer, textures, etc. And in OpenGL, only the driver has access to that information.

Share this post


Link to post
Share on other sites
quote:
Original post by 666_1337
how do i determine how many video memory a card has, and how much of it is being used?



Ha ha ha!!!

quote:

... but on a not operating-system dependent way



Ha ha ha!!! ha ha ha!!!

Sorry!

Everything depends by OS! There is not an ANSI-C function to test the video card memory (or memory itself) !!!
It is very hard to write a portable code in standard ANSI-C under different compilers...think about a video-card-memory-test under different OS...
However under OpenGL and Windows it''s impossible to do this!






Share this post


Link to post
Share on other sites
Blizzard, you imply that the only things you can do OS independent is the ANSI functions. That isn''t correct. Suppose there was an OpenGL function queryVramCapacity(). If so, then I would consider it an OS-independent way to query VRAM!

Share this post


Link to post
Share on other sites
is this videocard mem or videocard + AGP mem?
is FSAA etc enabled?
just write a simple routine that loads + uses textures until speed decreases dramatically this will give u a rough idea

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
quote:
Original post by drslush
Blizzard, you imply that the only things you can do OS independent is the ANSI functions. That isn''t correct. Suppose there was an OpenGL function queryVramCapacity(). If so, then I would consider it an OS-independent way to query VRAM!


Yes and I''m surprised why there is not at least an extension to do this...unfortunately this does not exist!
Perhaps the reason is to mantain OpenGL very device independent (it is not only OS independent!)...

quote:

zedzeek:
just write a simple routine that loads + uses textures until speed decreases dramatically this will give u a rough idea



Interesting! Really! A good idea!

Share this post


Link to post
Share on other sites
quote:
Original post by siaspete
Does knowing the amount of VRAM available help you in any genuinely useful and non-flawed way?


Actually, a rough estimate of the available onboard VRAM is useful, if you want to determine an appropriate pixelformat for your textures (lower quality / compression, if less VRAM available), or the size of a VRAM geometry cache, for example.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
That''s why we have all those F**N sliders in all 3D aps, or at least console comands. But ther''s a good thing about that too, you can choose how high should be your LOD

Share this post


Link to post
Share on other sites
lookin in the device manager at my video card's resource allocation i saw Memory Range 00A0000 - 00AFFFF, 00B0000 - 00BFFFF (this i think is the protected mode memory mapping for the 0xB000 and 0xA000 segments - text and graphics mode in DOS)

also 00C0000 - 00C7FFF and DC000000 - DC01FFFF
dunno what these are but u could find out. the first is 32mb and the sec is 128mb (my VRAM is 64 though) but these mem ranges look interesting


ah and DX provides a function for this. find out in which dll this is and dissassemble it and if ur lucky u might get ur answer

[edited by - Ilici on April 30, 2003 11:47:38 AM]

Share this post


Link to post
Share on other sites
That won''t help, that''s kernel level code, which will give you an exception when used in an user mode program.

Can you please use "you" instead of "u" and because instead of "cuz", that''s really annoying. Thank You.

Share this post


Link to post
Share on other sites
¡hey axel!

quote:
Original post by Ilici
also 00C0000 - 00C7FFF and DC000000 - DC01FFFF
dunno what these are but u could find out. the first is 32mb and the sec is 128mb (my VRAM is 64 though) but these mem ranges look interesting


ah and DX provides a function for this. find out in which dll this is and dissassemble it and if ur lucky u might get ur answer

[edited by - Ilici on April 30, 2003 11:47:38 AM]


00c000 - 00c7fff and the other range looks quite usefull... but i think there''s no way of getting this values at runtime?

Share this post


Link to post
Share on other sites
However I''ve not thought about a problem in the "performance test" to get avaliable VRAM...

Suppose your bind does not work...your speed will not decrease and we can think to have about 4GByte of VRAM!!!
In other words:
if glAreTextureResidents() works we have no need for any test
(just load textures and wait for FALSE)

if glAreTextureResident() doesnt work we have no way to know if the texture is actually loaded or not!

The only solutions are

- limit our VRAM usage to 16/32 MByte

AND/OR

- suppose glAreTexturesResidents() works

Why not a simple glGetString(GL_RENDERER) with the MB on card?
Probably there is a reason for this...


Share this post


Link to post
Share on other sites
There shouldn''t be a reason, the whole point of OpenGl is beeing an Open standard. If the ARB decided to says there is going to be a function called gimeAvailableRAM(), then all video card vendors would implement it. It wouldn''t be a bad idea for OGL to have device capabilities functions handy.

Share this post


Link to post
Share on other sites
thanks...

i see, there is no way of determining video ram (yet) . ...
so i''ll have to get values from the user directly, or by using that dX-func in windos & the XF86Config -file in unix.

Share this post


Link to post
Share on other sites
The reason is that, unlike D3D, OpenGL is designed with more than home PCs in mind.
Imagine you are programming OpenGL for a PDA or something. What should

glTellMeHowMuchVideoMemoryIsAvailable()

return then?

Share this post


Link to post
Share on other sites
quote:

The reason is that, unlike D3D, OpenGL is designed with more than home PCs in mind.
Imagine you are programming OpenGL for a PDA or something. What should

glTellMeHowMuchVideoMemoryIsAvailable()

return then?


The amount of RAM available for textures, framebuffer, etc.

PDAs & co are not the problem. The real issue behind this level of abstraction, is the client/server concept of OpenGL. OGL was intended to be used on massive parallel, distributed systems (and it is still used like this in the professional CGI domain). Unlike DirectX, OpenGL wasn't designed as game API, but as large scale graphics API for super computers - parallel systems with several hundered parallel GPU's and CPU's, multiple layers of VRAM in the terrabyte region, unified architectures, VRAM accessible over optical networks, etc.

On such systems, there is no notion of 'how much RAM is available', since that can change from one second to the next, as resource availability changes, a CPU/GPU unit is taken off the network, a RAM module is hotplugged into the system, etc.


[edited by - Yann L on April 30, 2003 4:09:57 PM]

Share this post


Link to post
Share on other sites
Maybe we shoud also ask why we need the size of the avaidable video memory.Will this prevent any allocation from failing or will just add a cool msg on the screen:"Video memory left:%d",bla-bla.Perhaps not to have access to such kind of data is for the best...

The PAIN is coming...this summer!!!In cinemas everywhere.

Share this post


Link to post
Share on other sites
Here''s an example of why the original question is futile (great word!)

An OpenGL app with two windows open is using 4mb out of 32mb on the video card. You launch a game which needs 22 mb. Fine you say - there''s enough memory for me ... so you launch with full res textures. Suddenly the other app opens another GL window which requires 16mb. Do you then unload all you''re textures etc and reload low res ones? Of course not. You let the driver decide.

I hope that wasn''t an overly patronising example, but you see the point?

Regards

Share this post


Link to post
Share on other sites
Shag, maybe I misunderstood you, but are you saying that the driver can choose to unload all my textures and upload new low-res ones when the card is low on memory, and without telling me or asking for permission to do so?

Share this post


Link to post
Share on other sites