You can get the amount of videoRam from the x-server log (python script attached). This is a little unsafe since the video driver is responsible for logging this info and I don't know if my script works on the format of all drivers. Also, certain drivers (fbdev) don't output this at all. Then again, there is no hardware openGL support for this anyway ;-). Another way to obtain the videoRam would be to use 'lspci -v'. This is however not error prone either since the the the size reported by lspci is not necessarily correct.
The script doesn't work for me, fglrx driver. The videoram line in Xorg.log is
(--) fglrx(0): VideoRAM: 65536 kByte, Type: DDR SGRAM / SDRAM
I don't know how to program python, so I can't fix your script - sorry. Stefan