Sign in to follow this  
Constantin

CreateDevice returns D3DERR_OUTOFVIDEOMEMORY

Recommended Posts

I do this once and only once in my app. What could be happening? I close my app and try again and the same problem occurs until I close another app like Visual Studio. Appreciate any help.

Share this post


Link to post
Share on other sites
What OS? What video card? Are you using the debug runtimes? Any relevant debug output? What size is your backbuffer? How many backbuffers? What format? Are you creating a depth buffre? What format? Are you using miltisampling? If so, what type?

It's entirely possible that there isn't ennough video memory for you to create the device you request.

Share this post


Link to post
Share on other sites
Kinda vague post there, with what information you have provided, so along with the suggestions Steve made, my guesses are:

1. Multiple instances of your application are running, each of which has called CreateDevice() but hasn't shut down properly (an app can still be running even if it isn't displaying a window).

Check the Processes tab of the Windows Task Manager to see if your .exe is running multiple times.

If this is the case, double check how you handle window messages, in particular WM_QUIT, and the general operation of your message pump. It could be that your application never exits its message pump/loop and so never terminates and therefore never frees up resources such as the device.


2. Some other application, perhaps using a different 3D API has swallowed up all of the available video memory. Once again, use the task manager to see what else is running on your system. Sometimes seemingly neutral programs do use DirectX resources (e.g. Netmeeting once used to cause a few problems for other apps due to it using DirectDraw).


3. Buggy device drivers for your graphics hardware not handling your usage patterns or system setup well. If the drivers are 'new', and perhaps a major new revision (e.g. Vista drivers) this might be a problem. Try with different (older) driver revisions and try on another system if possible.

Share this post


Link to post
Share on other sites
It runs OK in the begininng. But after a while, the memory problem starts.
I turned on memory leak checking. It complains when the app termnates.

That is because the app releases the device in the C++ destructor of a global,
after the memory leak detection.

I run it from the Visual Studio debugger.

The mystery is that it creates the device OK in the beginning with exactly the same parameters and the app runs smoothly. Afetr repeated use (only one instance is running at any one time).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this