How do you actually 'view' the GPU VRAM usage? Specfically the software suffer from out of memory error during quite a long drive (it is a ground simulator). The software page in and page out okay - judging from the log, and also from the free VRAM report using this code:-
Code: Select all
RenderWindow* win = SimRoot::getSingleton().getRenderWindow();
win->getCustomAttribute("WINDOW", (void*)&mMainWnd);
void *d3dDevice = 0;
win->getCustomAttribute("D3DDEVICE", (void*)&d3dDevice);
mD3D9 = reinterpret_cast<IDirect3DDevice9*>(d3dDevice );
MYLOG("VRAM left: " + StringConverter::toString(mD3D9->GetAvailableTextureMem()/1000000) +"MB");
It is possible that there are leakages (like texture not released), but those seem ok using the code snipped above. You can see VRAM going down.. and then as you moved around the VRAM get reduced and increased. Last time when there are bugs causing textures not released, the VRAM get reduced over the time and when it is < 100K, the program starts 'texture-thrashing' ie FPS suddenly gets too low. But now, there are many cases where there are still huge VRAM available, but the Out Of Memory error still thrown.
So to recap:-
1) How do you actually view the available VRAM?
2) Is it possible that VRAM was too fragmented, which then lead to Out Of Memory error?