D3D9DeviceManager::findDriver returns null Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
dragostej
Gnoblar
Posts: 19
Joined: Wed Mar 31, 2021 8:36 am
x 1

D3D9DeviceManager::findDriver returns null

Post by dragostej »

Ogre Version: 1.11.6
Operating System: Win 10
Render System: DirectX 9

Hello Guys,

Sometimes my application crashes, because

Code: Select all

Ogre::D3D9DeviceManager::findDriver
function returns null.

The stack is usually something like this:

Code: Select all

RenderSystem_Direct3D9!Ogre::D3D9DeviceManager::selectDevice
RenderSystem_Direct3D9!Ogre::D3D9DeviceManager::linkRenderWindow
RenderSystem_Direct3D9!Ogre::D3D9RenderSystem::_createRenderWindow
OgreMain!Ogre::Root::createRenderWindow
Could you give me some hints where should i look for the problem?
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 449
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 155

Re: D3D9DeviceManager::findDriver returns null

Post by sercero »

Hello,

Can you post your OGRE log?

Also, are you using OGRE from within a QT window or something like that?

What parameters are being passed to the OGRE root for initialization?

How is OGRE being initialized?

Another thing: do the samples work OK in DirectX9?
dragostej
Gnoblar
Posts: 19
Joined: Wed Mar 31, 2021 8:36 am
x 1

Re: D3D9DeviceManager::findDriver returns null

Post by dragostej »

I have already checked Ogre log, there is no any strange sign in.

Actually Ogre is embedded into my application which is an MFC based app with CodeJock GUI.
Ogre is initialized by that way:

Code: Select all

new Ogre::Root( plugin, config, log );
...
Ogre::Root::getSingleton().initialise(true);
The app and Ogre are running nicely, just sometimes the users complain that it get crash during runtime.
My idea is that it can happen due to multiple monitors, ALT+TAB-ing between desktop and remote-desktop.
But I dont know how to detect that.
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 449
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 155

Re: D3D9DeviceManager::findDriver returns null

Post by sercero »

Your best bet is to read this guide to see if you can get some insight from it:
https://wiki.ogre3d.org/Integrating+Ogre+into+QT5

And also look in the forums for this, which seems related:
search.php?keywords=directx9+lost+device
dragostej
Gnoblar
Posts: 19
Joined: Wed Mar 31, 2021 8:36 am
x 1

Re: D3D9DeviceManager::findDriver returns null

Post by dragostej »

Hello Guys,

Recently, I have started to deal with the problem again, but I can not solve it.

What I noticed that crashes came from Ogre 1.11.5 mostly, and they always happened in _createRenderWindow function.
My idea is to place more log info in the code maybe I can notice some kind of pattern between the crashes.

What kind of problems can cause these crashes what do you think?
What kind of events, hardware parameters or config options should be logged?

Thanks for your advice!
loath
Platinum Sponsor
Platinum Sponsor
Posts: 290
Joined: Tue Jan 17, 2012 5:18 am
x 67

Re: D3D9DeviceManager::findDriver returns null

Post by loath »

how often does this happen? can you reproduce it with the ogre samples or with a very simple minimal ogre app? that way you can isolate if it's ogre (i.e. a bug) or something you're doing. if this happens periodically but randomly i'd be suspicious of some memory corruption.

you could write a minimal app and run in a batch file loop with a post mortem debugger enabled to break into any crashes automatically.

can you update to ogre 1.12? it's very stable and paroj is very fast with the bug fixes.
dragostej
Gnoblar
Posts: 19
Joined: Wed Mar 31, 2021 8:36 am
x 1

Re: D3D9DeviceManager::findDriver returns null

Post by dragostej »

I dont know exactly, sometimes. It happens on the users computer, so I have only crash logs, and stacks. Thats all from I can start investigate the problem. Basically, it is an MFC based app with multiple render windows.

The crash happens in two different phases:
-during ogre init
-during runtime

In the first case, I think it is a driver or rendersystem init config error.
In the second case, it could be anything e.g. user drag and drop the app to the other monitor, the hardware parameters were changed (plug/unplug monitor, switch to projector), Alt+TAB-ing, start the app from remote desktop, after the user wake up the computer from sleep etc.

Can I log these events somehow?

I am planning the update to 1.12 but not in the near future.
Post Reply