Jump to content

D3D9 : Out of texture memory


photo

Recommended Posts

21:48:46 D3D9Texture::create(): can't create DXT5 1024x1024 2D texture

21:48:47 Direct3D9 error: out of video memory

 

 

We've been getting a lot of these errors, even from players with video cards that Unigine reports to have 1024MB of video memory. Our game runs in non-exclusive mode, does this mean that other apps share the video memory with our game and consequently our game runs out of memory? Another possibility is that the video memory reported by Unigine is not accurate - is this possible?

At maximum texture settings we take around 768MB (we are in the process of optimizing textures)

 

Thanks.

Link to comment

Your are simply throwing to much textures on the GPU. Keep in mind that GPU memory not only uses by other programm, but also by allocated meshes, shaders, render buffers etc.

 

BTW do you force loading of all textures via render_manager_load_textures 1 ? Otherwise UNIGINE texture streaming should be able to load only subsets of your textures currently visible in the scene (at least if they are not all visible in the scene at the same time...)

Link to comment

While I agree texture usage is too much, when I look at the video memory taken by other objects like meshes is negligibly small - Unigine reports around 30MB

And the other elements probably take similar amounts.

 

"Our game runs in non-exclusive mode, does this mean that other apps share the video memory with our game and consequently our game runs out of memory?"

This was the key part of my question - if video memory is shared, then we need to advice users to stop other programs when running our game, else such advice doesn't make sense.

 

And yes Ulf, we do use render_manager_load_textures 1 since our game is a Real Time Strategy game and at least in theory the whole map is visible at any given time. Not preloading all textures would mean "jerks" when panning to a new are and this is unacceptable.

 

Thanks for your reply!

Link to comment

Well, good engines contain streaming to not get out of memory by loading everything at once. If you need everything in the memory and you are not able to do various optimizations, probably only solution is to implement custom virtual texture system. This would allow you to have constant memory budget no matter of number of textures in the scene. On the first sight it should be possible with Unigine API.

Link to comment

No reason to blame the engine, UNIGINE offers automatic texture streaming out of the box, but by setting render_manager_load_textures to 1 BlueGiant disables this and that's why they get out of memory exception.

 

In fact BlueGiant needs to implement a game-dependent, more intelligent texture resource management scheme depending on their specific use case (therefore it's always hard to solve this by some general advices).

 

This starts on the modelling level with a critical screening of all used textures, sometimes certain textures provides much to high resolutions wasting a lot of texture memory (->down scaling can save HUGE amounts of memory).

 

Another optimiziation in complex scenes might be maximizing reuses of just a set of base textures (e.g. in best case put into a texture atlas to minimize draw calls).

 

Next level might be more detailed analysis of texture mipmap usage for textures. UNIGINE has an editor visualizer mode for this purpose. Sometimes some texture mipmap levels might never be used, so they could be potentially dropped, saving some memory (BTW I am sure that BlueGiant already uses best possible texture compression for all used resources).

 

If this still produces too much textures, than there is no other way as to think about intelligent texture streaming. This of course highly depends on the scene and is closely related to the employed level of detail scheme for geometry. If I remember right there is an option where UNIGINE loads the smallest mipmap level already on startup, so this might already hide delayed streaming of higher resolution mipmap layers during zooming in.

 

Finally with the help of WorldSector it is possible to control texture/mesh/mask streaming explicitly depending on your scene requirements. In most cases this will require some form of spatial / distance based partitioning of the scene and scripting for intelligent streaming/locking of resources based on dynamic player position.

 

All in all, there are plenty of options, but this requires detailed analysis and planing...just some of my thoughts from a far distance

Link to comment
No reason to blame the engine, UNIGINE offers automatic texture streaming out of the box, but by setting render_manager_load_textures to 1 BlueGiant disables this and that's why they get out of memory exception.

 

Indeed. IMHO virtual texture is proper solution for him, it solves all his problems and works as intelligent optimalization.

Link to comment

I agree with ulf and demostenes on this one, maybe in the future we'll get the time to do this. But my worry is the below question -

 

"Our game runs in non-exclusive mode, does this mean that other apps share the video memory with our game and consequently our game runs out of memory?"

This was the key part of my question - if video memory is shared, then we need to advice users to stop other programs when running our game, else such advice doesn't make sense.

 

Any insights anybody on this question?

Link to comment
×
×
  • Create New...