hmm, vram problems!!

Member
Posts: 52
Joined: 2007.06
Post: #1
So there has been this little issue over the past few months that has annoyed me beyond belief.

Im working with large textures and FBOs, total usage on my nvidia 8600M GT 256Mb card is around 200Mb or so per simulation. I can run the simulation twice before it crashes and requires a hard shutdown with my large texture sizes. So i use smaller simulations, ie smaller textures, on my notebook and do the larger simulations in the lab. This is annoying cause i would sooner just do everything on the notebook. Even after 20 or so smaller simulations i still need to reboot.

I found the nifty little tool, opengl driver monitor, very sweet. Im logging the vram and she comes up on a clean boot with about 230Mb available out of a total of around 235Mb. This is understandable,

I run the simulation and close it, i now have about 190Mb of memory left. So im thinking maybe im not destroying something. I double check my clean-up routine and im calling everything correctly when i leave the application,

My texture manager calls,
glDeleteTextures(1,&(*it).second),
for every texture its controlling.

My ParticleRenderer calls,
glDeleteTextures (4,_textureHolder);
glDeleteFramebuffersEXT (1,&_fbPosition);
glDeleteBuffers(1,&_pbo);
glDeleteBuffers(1,&_vboColor);

My Vertex Buffer Object Manager calls,
glDeleteBuffers(1,&_VBO),
for every buffer needing deletion.


On every other workstation i try i do not have any issue with not freeing the memory on the card. However the 8600m on the macbook pro, doesnt free it correctly with those calls.

My total available vram drops every time i run the application by about 30Mb.

One of the calls i do im a little worried about, when i bind textures to color attachment points on the FBO do i need to free this attachment?

For instance this is how i bind it,
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _fbPosition);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
_attachmentpoints[_writeTex],
GL_TEXTURE_RECTANGLE_ARB,
_textureHolder[_writeTex], 0);
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
If the total available VRAM drops even after your process has exited, it's a driver bug. File it at http://bugreport.apple.com/ (sign up for a free ADC account at http://connect.apple.com/ if you haven't yet).

NVidia cards are well known for having poor drivers on Mac OS X, but this is atrocious!

This sounds familiar to me, maybe someone on the mac-opengl list reported the same problem? You may find it's something to do with the precise format of the textures or FBOs you're using (eg. if you don't use depth on your FBO it doesn't leak, or if you use integer rather than FP textures it works).
Quote this message in a reply
Member
Posts: 52
Joined: 2007.06
Post: #3
I signed up a while ago, logged so many bugs im tired of doing it...

Anyway i hate hacks, but i found one today while experimenting with the opengl driver monitor.

If i initialize my particle engine simulator to use like 1Gb of texture memory, it crashes everything and free's all the memory. Im now back to 230Mb out of the available 235Mb available,

So basically every couple of runs i need to crash it purposely, lol. But at least i can play with large particle counts for the Space weather simulations.

At least now i dont need to reboot to carry out more simulations.

YES!!!

Its a hack but its not like its commercial code or anything....
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
I don't know whether to laugh or cry :|
Quote this message in a reply
Member
Posts: 52
Joined: 2007.06
Post: #5
Very true!!

I have to finish up teaching a class this week, then im going to throw leopard on. Will see if that makes any differences.

Never know!
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #6
Perhaps it's related to mipmapping?

http://unity3d.com/unity/whats-new/unity...nity-2.0.1

Check out the 5th item in the release notes of Unity 2.0.1. I've heard it described as "leaking like mad." Smile

Cheers,
-Jon
Quote this message in a reply
Member
Posts: 52
Joined: 2007.06
Post: #7
Well thats not very kool!!! Seems like it still an issue in leopard to.

Argg!!

Sometimes....

I will let you know if turning mipmaps off helps at all,
Quote this message in a reply
Member
Posts: 52
Joined: 2007.06
Post: #8
Well everything seems to work correctly under leopard, VTF's and memory.

Will See after a couple days of testing,

Im very happy!!
Quote this message in a reply
Member
Posts: 52
Joined: 2007.06
Post: #9
Well ran it twenty times and it would seem the gpu memory issue is solved in 10.5


What a day,

Took me about 4 hours to get everything back up and running,

I dont know what to say, but im happy. Props Apple!!!!

Now if only nvidia would release their Cuda drivers for 10.5

Steven
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Dynamically swapping between RAM and VRAM Shunter 7 3,858 May 22, 2009 11:44 AM
Last Post: backslash
  How much VRAM for textures/buffers? Fenris 2 2,643 Nov 24, 2003 10:37 AM
Last Post: Fenris
  VRAM and textures Mars_999 1 2,099 Aug 12, 2003 12:24 AM
Last Post: OneSadCookie