detecting GPU memory size

Get answers to all your basic programming questions. No Ogre questions, please!
Post Reply
hugox
Gnoblar
Posts: 6
Joined: Wed Dec 04, 2013 5:30 pm

detecting GPU memory size

Post by hugox »

Hi,

I'm also looking for a simple way to detect memory size of GPU in windows(DirectX) and linux(OpenGL) case!
I've found this tutorial for DirectX:
http://ogre3d.org/forums/viewtopic.php?f=2&t=58282

And i Know how to get the same with opengl function, but I was thinking that maybe there is something better already include in Ogre SDK?

Thx!

regards!
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: detecting GPU memory size

Post by dark_sylinc »

Often, there is no reliable way to determine GPU memory size on multiple platforms, which is why it's not included in Ogre.

On Intel cards, there is no real answer, because it uses "dynamic" vram, which reserves normal RAM for the GPU dynamically depending on system needs (there is an always-reserved minimum, usually of 8MB)
On dedicated GPUs (i.e. GeForce, Radeon), although they have dedicated GDDR memory (and hence this is what one normally wants to retrieve) drivers sometimes return the total available ram the GPU can use (which is usually all of addressable normal RAM + GDDR) and not just the dedicated silicon.
On UMA SoC (i.e. mobile, PS4, XBone); the GPU ram is the system ram, but there might be arbitrary OS restrictions.
Furthermore, GPUs are now starting to support virtual memory, which makes the scene even more heterogenous.
Post Reply