Get available video memory?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
AlainSE
Posts: 5
Joined: Wed Jun 12, 2013 8:27 am

Get available video memory?

Post by AlainSE »

Hi,

I am looking for a function to retrieve the available video memory (it is useful to know if I can load all textures at the beginning of the application or if I have to wait until I really need them).

I noticed Irrlicht display this information on the debug log when starting the application (I am using OpenGL):

...
OpenGL driver version is 1.2 or better.
Dedicated video memory (kB): 2097152
Total video memory (kB): 2097152
Available video memory (kB): 1621140
...

Is there a way to retrieve this information through irrlicht API?

thanks.
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Get available video memory?

Post by zerochen »

hi,

the api is your friend^^

http://irrlicht.sourceforge.net/docu/cl ... ee0b9e8270

regards
zerochen
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Get available video memory?

Post by hendu »

No, and it isn't portable either - you can't get it everywhere, and what AMD and Nvidia expose is different.

@zerochen, the API exposes RAM, not VRAM.
zerochen
Posts: 273
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: Get available video memory?

Post by zerochen »

ups yes you are right. hm but i think i saw something related in the irrlicht code.
AlainSE
Posts: 5
Joined: Wed Jun 12, 2013 8:27 am

Re: Get available video memory?

Post by AlainSE »

Ok thanks for the answer...

but it is really annoying - I was using DirectX (on a different engine) and I was able to know exactly the amount of available ram. I am switching to OpenGL because I want to create a cross platform product and this limitation is .. well.. a real limitation.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Get available video memory?

Post by Nadro »

You can use eg. http://www.opengl.org/registry/specs/ATI/meminfo.txt for AMD cards. I think that in future we should add support for available VRAM to Irrlicht API.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Get available video memory?

Post by hybrid »

We actually print out this value when starting Irrlicht. Instead, we could introduce some attribute we could query so more easy access - and especially access at any time - would be possible. Driver attributes structure is not easily possible, though, as it does not update dynamically.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Get available video memory?

Post by hendu »

Then we get apps that only work on AMD cards, or Nvidia, or only AMD+Nvidia...
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Get available video memory?

Post by Nadro »

hendu wrote:Then we get apps that only work on AMD cards, or Nvidia, or only AMD+Nvidia...
As I know Intel doesn't provide any extension (source: http://www.opengl.org/registry/) for VRAM statictics, so if application really require VRAM available informations etc for properly working, Intel GPU's can't be fully supported.

BTW. VRAM data handling in OpenGL is problematic because not a programmer, but a gfx driver decide when leave a data in VRAM or move it back to RAM.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply