Video memory available

BlitzMax Forums/MiniB3D Module/Video memory available

SLotman(Posted 2010) [#1]
People... please test this:



This should, in theory, report the memory stats of your video card - at least for nvidia and ati models. It works here on my ATI, altough I can't understand anything about the values returned... it displays here:

VBO_FREE_MEMORY_ATI
  Total memory free in the pool: 244771200
  Largest available free block in the pool: 52229120
  Total auxiliary memory free: 190772832
  Largest auxiliary free block: 23000640

TEXTURE_FREE_MEMORY_ATI
  Total memory free in the pool: 244771200
  Largest available free block in the pool: 52229120
  Total auxiliary memory free: 190772832
  Largest auxiliary free block: 23000640

RENDERBUFFER_FREE_MEMORY_ATI
  Total memory free in the pool:244771200
  Largest available free block in the pool:52229120
  Total auxiliary memory free:190772832
  Largest auxiliary free block:23000640


I haven't tested it on any nvidia card yet also; values *should* be in Kb size, but those numbers I get from ATI are very, very strange. Maybe I'm doing something wrong in the code?

Last edited 2010


ima747(Posted 2010) [#2]
MacPro 2010 ATI 5770 1GB



MacMini 2009 Nvidia GeForce 9400 256mb (shared with system ram, 128mb base upgrades to 256 with system ram of 2gb or more, 2gb installed).


I've spent a lot of time trying to get VRAM sizes, and I have yet to find something reliable on any platform, even when it targets specific cards. The OS, the motherboard, the card hardware, the drivers, and on windows directx all seem to get in the way. On mac it's possible (thought I don't have the code handy) to query the system info and get a real number that *should* be reliable. On windows directx is *supposed* to have a way to tell you but I've never found anything that works. People always seem to resort to card specific access like this, but I've never found anything that works for more than 2 driver revisions, and it's always ATI or NVIDA only... REALLY REALLY annoying :0(

I will be forever in your debt if you can figure something out, I've resorted to a min requirement listing of 128mb card on my software with a user setting to change to something higher if they know their hardware supports it which is FAR from optimal, in fact it's only 1 step better than nothing really.

Last edited 2010


ima747(Posted 2010) [#3]
Let me know if you'd like me to try my PC (Win 7 with a GeForce 8800gt 512mb). Can't do it now, brownouts are trying to kill things here, not cool, can't risk ANOTHER computer on, but I can't work without 1 or 2 :0)


SLotman(Posted 2010) [#4]
Yikes, I just tested on 2 computers with nvidia cards, and also got "0" everywhere :(

Ima747: Your MacBook with ATI doesn't have (apparently) the "GL_ATI_meminfo" flag, so it can't report the memory available... the strangest part is that the program *should* detect this, but it isnt O_o

The second computer, reports the video card as *apple* (sight) not nvidia as the vendor... so it doesn't try to get the values.
Even if it reported as nvidia, there isn't the flag "GL_NVX_gpu_memory_info", so, no solution either :(

Edit: changed the code, to detect properly if the card can or cannot report the memory available.

Edit 2: apparently, only drivers from 196.21 and up have this extension for nvidia. (Yes, I just tested it, one of the computers who didn't report the memory size, now does after I updated the driver!)

Last edited 2010


ima747(Posted 2010) [#5]
Just FYI it's a macpro (the monstrous tower) rather than a MacBook pro. So still desktop hardware. When the power comes back (again) I can try that system via windows as well to see if those drivers might make a difference with the same hardware...

Again, I spent a couple weeks on this, and came up with nothing but anger :0) You can't make any assumptions either based on texture sizes, or even trial and error attempting to overload the VRAM to find the limit, since sometimes that just crashes the app, or sometimes even the drivers on some os revisions etc... You need a real hardware reported number and there's just no reliable way I could find to get it... Total nightmare. Fingers crossed you have better luck than me! Would be REALLY handy.


SLotman(Posted 2010) [#6]
Edited the main program once again, removing the test on the vendor name... now, if it finds any of the GL Extensions needed, it will try to read it. (so if by any chance Intel or SIS or whatever cards implements one of those methods, it will work)

Prettier version, displays memory info on window; also added another query to show 'total video memory' on ATI:



Still, no idea how to read memory on Intel, SIS or other cards :P

Last edited 2010